Commits

David Rogers committed 0bcf08b

Add a capabilities check to the texture array sample

  • Participants
  • Parent commits f46d6b7
  • Branches v1-8

Comments (0)

Files changed (1)

Samples/TextureArray/include/TextureArray.h

 
 protected:
 
+    void testCapabilities( const RenderSystemCapabilities* caps )
+    {
+        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !caps->hasCapability(RSC_FRAGMENT_PROGRAM))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your graphics card does not support vertex and "
+                        "fragment programs, so you cannot run this sample. Sorry!",
+                        "TextureArray::testCapabilities");
+        }
+
+        if (GpuProgramManager::getSingleton().isSyntaxSupported("glsles"))
+        {
+            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support the shader model needed for this sample, "
+                        "so you cannot run this sample. Sorry!", "TextureArray::testCapabilities");
+        }
+    }
+
 	void setupContent()
 	{
 		mSceneMgr->setSkyBox(true, "Examples/TrippySkyBox");