From a3e391a523737074cef9bfed4f3b296d2ade200d Mon Sep 17 00:00:00 2001 From: torsten Date: Thu, 20 Aug 2009 11:09:37 +0000 Subject: [PATCH] warning fix: abort program and spit out a message if getNumPrims() is called with unknown mode. (Shouldn't happen anyway) --- simgear/scene/util/PrimitiveUtils.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simgear/scene/util/PrimitiveUtils.cxx b/simgear/scene/util/PrimitiveUtils.cxx index b2f14c1c..2038a40d 100644 --- a/simgear/scene/util/PrimitiveUtils.cxx +++ b/simgear/scene/util/PrimitiveUtils.cxx @@ -20,7 +20,7 @@ */ #include "PrimitiveUtils.hxx" - +#include using namespace osg; namespace @@ -302,6 +302,9 @@ protected: return count - 2; case GL_QUAD_STRIP: return (count - 2) / 2; + default: + std::cerr << "FATAL: unknown GL mode " << mode << std::endl; + throw new std::exception(); } } unsigned _primitiveIndex; -- 2.39.5