Commit df44c5c9 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'better_opengl_debug'

dd41d036 fix reportcapabilities in Cocoa
07b2c761 add some opengl debugging info when a test fails
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !817
parents ecb720a6 dd41d036
......@@ -13,6 +13,8 @@ PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtk_glew.h"
#include "vtkOpenGLRenderWindow.h"
#import <Cocoa/Cocoa.h>
#import "vtkCocoaMacOSXSDKCompatibility.h" // Needed to support old SDKs
......@@ -26,6 +28,7 @@ PURPOSE. See the above copyright notice for more information.
#import "vtkRendererCollection.h"
#import "vtkCocoaGLView.h"
#import <sstream>
vtkStandardNewMacro(vtkCocoaRenderWindow);
......@@ -414,13 +417,20 @@ const char* vtkCocoaRenderWindow::ReportCapabilities()
const char* glVendor = (const char*) glGetString(GL_VENDOR);
const char* glRenderer = (const char*) glGetString(GL_RENDERER);
const char* glVersion = (const char*) glGetString(GL_VERSION);
const char* glExtensions = (const char*) glGetString(GL_EXTENSIONS);
std::ostringstream strm;
strm << "OpenGL vendor string: " << glVendor
<< "\nOpenGL renderer string: " << glRenderer
<< "\nOpenGL version string: " << glVersion
<< "\nOpenGL extensions: " << glExtensions << endl;
<< "\nOpenGL version string: " << glVersion << endl;
strm << "OpenGL extensions: " << endl;
GLint n, i;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
for (i = 0; i < n; i++)
{
const char *ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
strm << " " << ext << endl;
}
// Obtain the OpenGL context in order to keep track of the current screen.
NSOpenGLContext* context = (NSOpenGLContext*)this->GetContextId();
......
......@@ -416,6 +416,12 @@ int vtkTesting::RegressionTest(double thresh, ostream &os)
}
else
{
// we failed both back and front buffers so
// to help us debug, write out renderwindow capabilities
if (this->RenderWindow)
{
os << this->RenderWindow->ReportCapabilities();
}
rtW2if->ReadFrontBufferOff();
rtW2if->Update();
return this->RegressionTest(rtW2if.Get(), thresh, os);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment