mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Expose has_extension to query whether OpenGL extension is supported
This commit is contained in:
parent
0f1243230d
commit
a7d1eb90c5
@ -2972,6 +2972,18 @@ make_shadow_buffer(const NodePath &light_np, GraphicsOutputBase *host) {
|
|||||||
return tex;
|
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
|
// Function: GraphicsStateGuardian::get_driver_vendor
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
|
@ -201,6 +201,7 @@ PUBLISHED:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
virtual bool has_extension(const string &extension) const;
|
||||||
|
|
||||||
virtual string get_driver_vendor();
|
virtual string get_driver_vendor();
|
||||||
virtual string get_driver_renderer();
|
virtual string get_driver_renderer();
|
||||||
|
@ -171,6 +171,25 @@ maybe_gl_finish() const {
|
|||||||
#endif
|
#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
|
// Function: GLGraphicsStateGuardian::is_at_least_gl_version
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -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
|
// Function: GLGraphicsStateGuardian::get_extension_func
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -406,7 +406,7 @@ protected:
|
|||||||
void save_extensions(const char *extensions);
|
void save_extensions(const char *extensions);
|
||||||
virtual void get_extra_extensions();
|
virtual void get_extra_extensions();
|
||||||
void report_extensions() const;
|
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_gl_version(int major_version, int minor_version) const;
|
||||||
INLINE bool is_at_least_gles_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);
|
void *get_extension_func(const char *name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user