diff options
author | Philippe Houdoin <[email protected]> | 2004-08-15 14:06:00 +0000 |
---|---|---|
committer | Philippe Houdoin <[email protected]> | 2004-08-15 14:06:00 +0000 |
commit | 4ad28c9d9a992f387eadfaf057a815e7bbbf9a8e (patch) | |
tree | dd7245de5be5fcb288a0a71ea7adfe9e4d865093 /progs/beos/GLInfo.cpp | |
parent | af2f26f7de01364964c90473417df2677d47c0b7 (diff) |
GLInfo now show GLU and GLUT infos too. Fix the includes paths
Diffstat (limited to 'progs/beos/GLInfo.cpp')
-rw-r--r-- | progs/beos/GLInfo.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/progs/beos/GLInfo.cpp b/progs/beos/GLInfo.cpp index b8788decd29..cfa8c83af82 100644 --- a/progs/beos/GLInfo.cpp +++ b/progs/beos/GLInfo.cpp @@ -12,6 +12,12 @@ #include <String.h> #include <GL/gl.h> +#include <GL/glu.h> + +#define GLUT_INFO 1 +#ifdef GLUT_INFO + #include <GL/glut.h> +#endif class GLInfoWindow : public BWindow @@ -66,11 +72,7 @@ GLInfoWindow::GLInfoWindow(BRect frame) // gl->LockGL(); - s = (char *) glGetString(GL_RENDERER); - if (!s) - goto error; - - list->AddItem(new BStringItem(s)); + list->AddItem(new BStringItem("OpenGL", 0)); s = (char *) glGetString(GL_VENDOR); if (s) { @@ -92,7 +94,7 @@ GLInfoWindow::GLInfoWindow(BRect frame) s = (char *) glGetString(GL_EXTENSIONS); if (s) { - list->AddItem(new BStringItem("OpenGL Extensions", 1)); + list->AddItem(new BStringItem("Extensions", 1)); while (*s) { char extname[255]; int n = strcspn(s, " "); @@ -105,9 +107,36 @@ GLInfoWindow::GLInfoWindow(BRect frame) } } + list->AddItem(new BStringItem("GLU", 0)); + s = (char *) gluGetString(GLU_VERSION); + if (s) { + l = ""; l << "Version: " << s; + list->AddItem(new BStringItem(l.String(), 1)); + } + + s = (char *) gluGetString(GLU_EXTENSIONS); + if (s) { + list->AddItem(new BStringItem("Extensions", 1)); + while (*s) { + char extname[255]; + int n = strcspn(s, " "); + strncpy(extname, s, n); + extname[n] = 0; + list->AddItem(new BStringItem(extname, 2)); + if (! s[n]) + break; + s += (n + 1); // next ! + } + } + +#ifdef GLUT_INFO + list->AddItem(new BStringItem("GLUT", 0)); + l = "API version: "; l << GLUT_API_VERSION; + list->AddItem(new BStringItem(l.String(), 1)); +#endif + // gl->UnlockGL(); -error: UnlockLooper(); } |