diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index c50cfddb4f..fcf5567a4b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -5707,7 +5707,7 @@ draw_patches(const GeomPrimitivePipelineReader *reader, bool force) { } #ifndef OPENGLES - _glPatchParameteri(GL_PATCH_VERTICES, reader->get_object()->get_num_vertices_per_primitive()); + _glPatchParameteri(GL_PATCH_VERTICES, ((const GeomPatches *)reader->get_object())->get_num_vertices_per_primitive()); #ifdef SUPPORT_IMMEDIATE_MODE if (_use_sender) { diff --git a/panda/src/gobj/geomPatches.cxx b/panda/src/gobj/geomPatches.cxx index f5fe9711d0..63ee7fcd1e 100644 --- a/panda/src/gobj/geomPatches.cxx +++ b/panda/src/gobj/geomPatches.cxx @@ -71,21 +71,6 @@ get_primitive_type() const { return PT_patches; } -/** - * If the primitive type is a simple type in which all primitives have the - * same number of vertices, like patches, returns the number of vertices per - * primitive. If the primitive type is a more complex type in which different - * primitives might have different numbers of vertices, for instance a - * triangle strip, returns 0. - * - * In the case of GeomPatches, this returns the fixed number that was - * specified to the constructor. - */ -int GeomPatches:: -get_num_vertices_per_primitive() const { - return _num_vertices_per_patch; -} - /** * Calls the appropriate method on the GSG to draw the primitive. */ diff --git a/panda/src/gobj/geomPatches.h b/panda/src/gobj/geomPatches.h index 85cda81e59..92c84b58c4 100644 --- a/panda/src/gobj/geomPatches.h +++ b/panda/src/gobj/geomPatches.h @@ -32,7 +32,9 @@ public: virtual PT(GeomPrimitive) make_copy() const; virtual PrimitiveType get_primitive_type() const; - virtual int get_num_vertices_per_primitive() const; + virtual int get_num_vertices_per_primitive() const final { + return _num_vertices_per_patch; + } public: virtual bool draw(GraphicsStateGuardianBase *gsg,