Skip to content

Commit

Permalink
Issue #37: Does not print full list of extensions with OpenGL statist…
Browse files Browse the repository at this point in the history
…ics, created a separate function that can be called for full listing
  • Loading branch information
jpaoneMines committed Aug 26, 2024
1 parent 2c0bcb4 commit 1d98a66
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
- Updated glm dependency to v1.0.1
- Added half sphere and dome to HUD example
- Fixed shader uniform debug output typos
- OpenGLUtils: Does not print full list of extensions with OpenGL statistics, created a separate function that can be called for full listing
- MD5Camera: fixed bug where inverseQ normalization was being discarded and not set
- MD5Model: added GLM_ENABLE_EXPERIMENTAL for quaternion header to match GLM v1.0.1
- OrthographicCamera: fixed bug where _updateProjectionMatrix was not declared inline

## v 5.3.0 - 16 Aug 2024
- Removed [[nodiscard]] from ModelLoader::draw() to silence warnings. Currently method always returns true so the return value isn't applicable.
Expand Down
23 changes: 15 additions & 8 deletions OpenGLUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ namespace CSCI441 {
* @brief Prints information about our OpenGL context
*/
void printOpenGLInfo();
/**
* @brief Prints the list of available extensions
*/
[[maybe_unused]] void printOpenGLExtensions();
};

}
Expand All @@ -102,9 +106,10 @@ namespace CSCI441_INTERNAL {
// Outward facing function implementations

inline void CSCI441::OpenGLUtils::printOpenGLInfo() {
GLint major, minor;
GLint major = 0, minor = 0, numExtensions = 0;
glGetIntegerv(GL_MAJOR_VERSION, &major);
glGetIntegerv(GL_MINOR_VERSION, &minor);
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);

fprintf( stdout, "\n[INFO]: /--------------------------------------------------------\\\n" );
fprintf( stdout, "[INFO]: | OpenGL Information |\n" );
Expand All @@ -113,6 +118,7 @@ inline void CSCI441::OpenGLUtils::printOpenGLInfo() {
fprintf( stdout, "[INFO]: | OpenGL Renderer: %35s |\n", glGetString(GL_RENDERER) );
fprintf( stdout, "[INFO]: | OpenGL Vendor: %35s |\n", glGetString(GL_VENDOR) );
fprintf( stdout, "[INFO]: | Shading Version: %35s |\n", glGetString(GL_SHADING_LANGUAGE_VERSION) );
fprintf( stdout, "[INFO]: | Number of Extensions: %30d |\n", numExtensions );

if( (major >= 2 && minor >= 0) || major > 2 ) {
CSCI441_INTERNAL::printOpenGLParamHeader( 2, 0 );
Expand Down Expand Up @@ -234,19 +240,20 @@ inline void CSCI441::OpenGLUtils::printOpenGLInfo() {
CSCI441_INTERNAL::printOpenGLParam( "[INFO]: | Max # Combined Shader Output Resources: %11d |\n", GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES );
}

fprintf( stdout, "[INFO]: \\--------------------------------------------------------/\n\n");
}

[[maybe_unused]]
inline void CSCI441::OpenGLUtils::printOpenGLExtensions() {
GLint numExtensions = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
fprintf( stdout, "[INFO]: >--------------------------------------------------------<\n" );
fprintf( stdout, "[INFO]: | %3d OpenGL Extensions |\n", numExtensions );
fprintf( stdout, "[INFO]: >--------------------------------------------------------<\n" );

fprintf( stdout, "[INFO]: Number of Extensions: %4d\n", numExtensions );
for (int i = 0; i < numExtensions; i++) {
fprintf( stdout, "[INFO]: | Extension #%2d: %37s |\n", (i+1), glGetStringi(GL_EXTENSIONS, i) );
fprintf( stdout, "[INFO]: Extension #%3d: %s \n", (i+1), glGetStringi(GL_EXTENSIONS, i) );
}

fprintf( stdout, "[INFO]: \\--------------------------------------------------------/\n\n");
}


//**********************************************************************************
//**********************************************************************************
// Internal function implementations
Expand Down

0 comments on commit 1d98a66

Please sign in to comment.