GLInfo now show GLU and GLUT infos too. Fix the includes paths
This commit is contained in:
@@ -12,6 +12,12 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include <GL/gl.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
|
class GLInfoWindow : public BWindow
|
||||||
@@ -66,11 +72,7 @@ GLInfoWindow::GLInfoWindow(BRect frame)
|
|||||||
|
|
||||||
// gl->LockGL();
|
// gl->LockGL();
|
||||||
|
|
||||||
s = (char *) glGetString(GL_RENDERER);
|
list->AddItem(new BStringItem("OpenGL", 0));
|
||||||
if (!s)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
list->AddItem(new BStringItem(s));
|
|
||||||
|
|
||||||
s = (char *) glGetString(GL_VENDOR);
|
s = (char *) glGetString(GL_VENDOR);
|
||||||
if (s) {
|
if (s) {
|
||||||
@@ -92,7 +94,7 @@ GLInfoWindow::GLInfoWindow(BRect frame)
|
|||||||
|
|
||||||
s = (char *) glGetString(GL_EXTENSIONS);
|
s = (char *) glGetString(GL_EXTENSIONS);
|
||||||
if (s) {
|
if (s) {
|
||||||
list->AddItem(new BStringItem("OpenGL Extensions", 1));
|
list->AddItem(new BStringItem("Extensions", 1));
|
||||||
while (*s) {
|
while (*s) {
|
||||||
char extname[255];
|
char extname[255];
|
||||||
int n = strcspn(s, " ");
|
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();
|
// gl->UnlockGL();
|
||||||
|
|
||||||
error:
|
|
||||||
UnlockLooper();
|
UnlockLooper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,6 +12,8 @@ include $(TOP)/configs/current
|
|||||||
|
|
||||||
LDFLAGS += -soname=_APP_ $(APP_LIB_DEPS)
|
LDFLAGS += -soname=_APP_ $(APP_LIB_DEPS)
|
||||||
|
|
||||||
|
INCLUDES = -I. -I- -I../../include
|
||||||
|
|
||||||
default: demo sample GLInfo
|
default: demo sample GLInfo
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@@ -25,7 +27,7 @@ sample: sample.o
|
|||||||
$(LD) sample.o $(LDFLAGS) -o $@
|
$(LD) sample.o $(LDFLAGS) -o $@
|
||||||
|
|
||||||
GTLInfo: GLInfo.o
|
GTLInfo: GLInfo.o
|
||||||
$(LD) GLInfo.o $(LDFLAGS) -o $@
|
$(LD) GLInfo.o $(INCLUDES) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
$(CC) -c $< $(CFLAGS) -o $@
|
$(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
|
||||||
|
Reference in New Issue
Block a user