diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index aab3814dd3..31677062c7 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -2972,6 +2972,18 @@ make_shadow_buffer(const NodePath &light_np, GraphicsOutputBase *host) { return tex; } +//////////////////////////////////////////////////////////////////// +// Function: GraphicsStateGuardian::has_extension +// Access: Public, Virtual +// Description: Returns true if the GSG implements the extension +// identified by the given string. This currently +// is only implemented by the OpenGL back-end. +//////////////////////////////////////////////////////////////////// +bool GraphicsStateGuardian:: +has_extension(const string &extension) const { + return false; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsStateGuardian::get_driver_vendor // Access: Public, Virtual diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index deec626996..31282aa820 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -201,6 +201,7 @@ PUBLISHED: #endif PUBLISHED: + virtual bool has_extension(const string &extension) const; virtual string get_driver_vendor(); virtual string get_driver_renderer(); diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.I b/panda/src/glstuff/glGraphicsStateGuardian_src.I index f776d69c2e..2831d5a3d3 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.I +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.I @@ -171,6 +171,25 @@ maybe_gl_finish() const { #endif } +//////////////////////////////////////////////////////////////////// +// Function: GLGraphicsStateGuardian::has_extension +// Access: Published, Final +// Description: Returns true if the indicated extension is reported +// by the GL system, false otherwise. The extension +// name is case-sensitive. +//////////////////////////////////////////////////////////////////// +INLINE bool CLP(GraphicsStateGuardian):: +has_extension(const string &extension) const { + bool has_ext = (_extensions.find(extension) != _extensions.end()); +#ifndef NDEBUG + if (GLCAT.is_debug()) { + GLCAT.debug() + << "HAS EXT " << extension << " " << has_ext << "\n"; + } +#endif + return has_ext; +} + //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::is_at_least_gl_version // Access: Public diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index c297540492..877440e148 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -6781,27 +6781,6 @@ report_extensions() const { } } -//////////////////////////////////////////////////////////////////// -// Function: GLGraphicsStateGuardian::has_extension -// Access: Protected -// Description: Returns true if the indicated extension is reported -// by the GL system, false otherwise. The extension -// name is case-sensitive. -//////////////////////////////////////////////////////////////////// -bool CLP(GraphicsStateGuardian):: -has_extension(const string &extension) const { - - bool state; - - state = _extensions.find(extension) != _extensions.end(); - if (GLCAT.is_debug()) { - GLCAT.debug() - << "HAS EXT " << extension << " " << state << "\n"; - } - - return state; -} - //////////////////////////////////////////////////////////////////// // Function: GLGraphicsStateGuardian::get_extension_func // Access: Public diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 5b331abbc1..4895feced0 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -406,7 +406,7 @@ protected: void save_extensions(const char *extensions); virtual void get_extra_extensions(); void report_extensions() const; - bool has_extension(const string &extension) const; + INLINE virtual bool has_extension(const string &extension) const FINAL; INLINE bool is_at_least_gl_version(int major_version, int minor_version) const; INLINE bool is_at_least_gles_version(int major_version, int minor_version) const; void *get_extension_func(const char *name);