summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-10-19 22:34:11 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-10-19 22:34:11 (GMT)
commit0356c77a2fece07b1376e2bd12cfba5e44d16091 (patch)
treed25ca5d24b83d8a45c51cc6fe5806e18cf52a8d3
parent4799b7b555b3ddf86f9949caf9aae0e706cea4bc (diff)
parentadf7cd51fbd02309a33604223004efe6a3da9380 (diff)
Merge branch 'visitortests' of github.com:donbright/openscad into visitortests
Conflicts: tests/system-gl.cc
-rw-r--r--tests/OffscreenContext.cc20
-rw-r--r--tests/fbo.cc8
-rw-r--r--tests/system-gl.cc24
3 files changed, 26 insertions, 26 deletions
diff --git a/tests/OffscreenContext.cc b/tests/OffscreenContext.cc
index 7a3637c..e4045af 100644
--- a/tests/OffscreenContext.cc
+++ b/tests/OffscreenContext.cc
@@ -46,10 +46,10 @@ void offscreen_context_init(OffscreenContext &ctx, int width, int height)
static XErrorHandler original_xlib_handler = (XErrorHandler) NULL;
static bool XCreateWindow_failed = false;
-static int XCreateWindow_error(Display *dpy, XErrorEvent *event)
+static int XCreateWindow_error(Display *dpy, XErrorEvent *event)
{
- cerr << "XCreateWindow failed: XID: " << event->resourceid
- << " request: " << (int)event->request_code
+ cerr << "XCreateWindow failed: XID: " << event->resourceid
+ << " request: " << (int)event->request_code
<< " minor: " << (int)event->minor_code << "\n";
char description[1024];
XGetErrorText( dpy, event->error_code, description, 1023 );
@@ -58,7 +58,7 @@ static int XCreateWindow_error(Display *dpy, XErrorEvent *event)
return 0;
}
-bool create_glx_dummy_window(OffscreenContext &ctx)
+bool create_glx_dummy_window(OffscreenContext &ctx)
{
/*
create a dummy X window without showing it. (without 'mapping' it)
@@ -108,7 +108,7 @@ bool create_glx_dummy_window(OffscreenContext &ctx)
XSetErrorHandler( original_xlib_handler );
// Most programs would call XMapWindow here. But we don't, to keep the window hidden
- XMapWindow( dpy, xWin );
+ // XMapWindow( dpy, xWin );
GLXContext context = glXCreateNewContext( dpy, fbconfigs[0], GLX_RGBA_TYPE, NULL, True );
if ( context == NULL ) {
@@ -119,10 +119,10 @@ bool create_glx_dummy_window(OffscreenContext &ctx)
return false;
}
- GLXWindow glxWin = glXCreateWindow( dpy, fbconfigs[0], xWin, NULL );
+ //GLXWindow glxWin = glXCreateWindow( dpy, fbconfigs[0], xWin, NULL );
- //if (!glXMakeContextCurrent( dpy, xWin, xWin, context )) {
- if (!glXMakeContextCurrent( dpy, glxWin, glxWin, context )) {
+ if (!glXMakeContextCurrent( dpy, xWin, xWin, context )) {
+ //if (!glXMakeContextCurrent( dpy, glxWin, glxWin, context )) {
cerr << "glXMakeContextCurrent failed\n";
glXDestroyContext( dpy, context );
XDestroyWindow( dpy, xWin );
@@ -188,11 +188,11 @@ OffscreenContext *create_offscreen_context(int w, int h)
cerr << "Unable to init GLEW: " << glewGetErrorString(err) << endl;
return NULL;
}
+ glew_dump();
ctx->fbo = fbo_new();
if (!fbo_init(ctx->fbo, w, h)) {
- cerr << "Framebuffer init failed; dumping GLEW info" << endl;
- glew_dump();
+ cerr << "GL Framebuffer Object init failed; dumping GLEW info" << endl;
return NULL;
}
diff --git a/tests/fbo.cc b/tests/fbo.cc
index 42dacaa..2978e59 100644
--- a/tests/fbo.cc
+++ b/tests/fbo.cc
@@ -81,20 +81,20 @@ bool fbo_ext_init(fbo_t *fbo, size_t width, size_t height)
// Attach render and depth buffers
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, fbo->renderbuf_id);
- if (report_glerror("specifying color render buffer")) return false;
+ if (report_glerror("specifying color render buffer EXT")) return false;
if (!check_fbo_status()) {
- cerr << "Problem with OpenGL framebuffer after specifying color render buffer.\n";
+ cerr << "Problem with OpenGL EXT framebuffer after specifying color render buffer.\n";
return false;
}
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, fbo->depthbuf_id);
- if (report_glerror("specifying depth render buffer")) return false;
+ if (report_glerror("specifying depth render buffer EXT")) return false;
if (!check_fbo_status()) {
- cerr << "Problem with OpenGL framebuffer after specifying depth render buffer.\n";
+ cerr << "Problem with OpenGL EXT framebuffer after specifying depth render buffer.\n";
return false;
}
diff --git a/tests/system-gl.cc b/tests/system-gl.cc
index 750237d..00108cd 100644
--- a/tests/system-gl.cc
+++ b/tests/system-gl.cc
@@ -14,16 +14,16 @@ void glew_dump() {
<< "Vendor: " << (const char *)glGetString(GL_VENDOR) << endl
<< "OpenGL version: " << (const char *)glGetString(GL_VERSION) << endl;
- string extensions((const char *)glGetString(GL_EXTENSIONS));
- replace_all( extensions, " ", "\n " );
- cerr << "Extensions: " << endl << " " << extensions << endl
- << "Framebuffer and Stencil support:" << endl
- << " GLEW_ARB_framebuffer_object: " << (bool)GLEW_ARB_framebuffer_object << endl
- << " GLEW_EXT_framebuffer_object: " << (bool)GLEW_EXT_framebuffer_object << endl
- << " GLEW_EXT_packed_depth_stencil: " << (bool)GLEW_EXT_packed_depth_stencil << endl
- << " glewIsSupported(\"GL_ARB_framebuffer_object\"): " << (bool)glewIsSupported("GL_ARB_framebuffer_object") << endl
- << " glewIsSupported(\"GL_EXT_framebuffer_object\"): " << (bool)glewIsSupported("GL_EXT_framebuffer_object") << endl
- << " glewIsSupported(\"GL_EXT_packed_depth_stencil\"): " << (bool)glewIsSupported("GL_EXT_packed_depth_stencil") << endl;
+ bool dumpall = false;
+ if (dumpall) {
+ string extensions((const char *)glGetString(GL_EXTENSIONS));
+ replace_all( extensions, " ", "\n " );
+ cerr << "Extensions: " << endl << " " << extensions << endl;
+ }
+
+ cerr << " GLEW_ARB_framebuffer_object: " << ((GLEW_ARB_framebuffer_object==1) ? "yes" : "no" ) << endl
+ << " GLEW_EXT_framebuffer_object: " << ((GLEW_EXT_framebuffer_object==1) ? "yes" : "no") << endl
+ << " GLEW_EXT_packed_depth_stencil: " << ((GLEW_EXT_packed_depth_stencil==1) ? "yes" : "no") << endl;
};
const char * gl_errors[] = {
@@ -33,7 +33,7 @@ const char * gl_errors[] = {
"GL_OUT_OF_MEMORY" // 0x0503
};
-bool report_glerror(const char * task)
+bool report_glerror(const char * function)
{
GLenum tGLErr = glGetError();
if (tGLErr != GL_NO_ERROR) {
@@ -41,7 +41,7 @@ bool report_glerror(const char * task)
cerr << "OpenGL error " << hex << tGLErr << "(" <<
<< gl_errors[tGLErr-0x500] << ") while " << task << endl;
else
- cerr << "OpenGL error " << hex << tGLErr << " while " << task << endl;
+ cerr << "OpenGL error 0x" << hex << tGLErr << " after " << function << endl;
return true;
}
return false;
contact: Jan Huwald // Impressum