Commit 7afc4cd1 authored by loring's avatar loring
Browse files

report some rendering capabilities in the debug log


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27512 18c085ea-50e0-402c-830e-de6fd14e8384
parent 3f0b8017
......@@ -41,11 +41,14 @@
// ************************************************************************* //
#include <VisWinRenderingWithWindow.h>
#include <DebugStream.h>
#include <vtkQtRenderWindow.h>
#include <vtkRenderWindow.h>
#include <vtkRubberBandMapper2D.h>
#include <vtkDashedXorGridMapper2D.h>
#include <vtkOpenGLRenderWindow.h>
#include <vtkOpenGLExtensionManager.h>
#if defined(Q_WS_X11) || defined(Q_OS_LINUX)
// We only need WindowMetrics here if we're on X11.
......@@ -132,6 +135,9 @@ VisWinRenderingWithWindow::~VisWinRenderingWithWindow()
// Force render on all platforms to make sure background is cleared at
// startup.
//
// Burlen Loring, Thu Oct 8 12:44:58 PDT 2015
// Report some capabilities in the debug log.
//
// ****************************************************************************
void
......@@ -149,6 +155,13 @@ VisWinRenderingWithWindow::RealizeRenderWindow(void)
renWin->GetRenderWindow()->Render();
debug2 << "render window is a vtkQtRenderWindow" << endl;
vtkOpenGLRenderWindow *glrw = dynamic_cast<vtkOpenGLRenderWindow*>(renWin->GetRenderWindow());
if (!glrw) return;
vtkOpenGLExtensionManager *em = glrw->GetExtensionManager();
debug2 << "GLVendor = " << em->GetDriverGLVendor() << endl
<< "GLVersion = " << em->GetDriverGLVersion() << endl
<< "GLRenderer = " << em->GetDriverGLRenderer() << endl;
}
// ****************************************************************************
......
......@@ -45,10 +45,13 @@
#include <Environment.h>
#include <avtCallback.h>
#include <visit-config.h>
#include <DebugStream.h>
#include <vtkMapper.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkOpenGLRenderWindow.h>
#include <vtkOpenGLExtensionManager.h>
#define DS_NOT_CHECKED 0
#define DS_NOT_AVAILABLE 1
......@@ -87,6 +90,7 @@ VisWinRenderingWithoutWindow::VisWinRenderingWithoutWindow(
// Mesa that we are getting, but we don't care.
//
renWin = vtkRenderWindow::New();
renWin->OffScreenRenderingOn();
InitializeRenderWindow(renWin);
......@@ -215,35 +219,46 @@ VisWinRenderingWithoutWindow::RenderRenderWindow(void)
// Brad Whitlock, Wed Mar 13 16:07:35 PDT 2013
// Don't directly call Render.
//
// Burlen Loring, Thu Oct 8 13:41:39 PDT 2015
// log vtk/open gl capabilities, fix indentation
//
// ****************************************************************************
void
VisWinRenderingWithoutWindow::RealizeRenderWindow(void)
{
// We'd like to do something lighter weight, but this seems to be the only
// way to *force* VTK to initialize in all cases. The good news is that this
// method is typically called before we've got data in the RW, so it
// shouldn't be as heavy as it looks at first glance.
// We'd like to do something lighter weight, but this seems to be the only
// way to *force* VTK to initialize in all cases. The good news is that this
// method is typically called before we've got data in the RW, so it
// shouldn't be as heavy as it looks at first glance.
//
// SetSize doesn't work as expected with vtkCocoaRenderWindow in
// an offscreen setting.
// B/c of this we are forced to create a large window, the size of
// which bounds our offscreen rendering.
//
if(std::string(renWin->GetClassName()) == "vtkCocoaRenderWindow")
{
//TODO: we may want to query to find the largest valid size
// OSX limits windows to 10Kx10K, however OpenGL contexts
// are limited further.
renWin->SetSize(4096,4096);
renWin->SetPosition(-10000,-10000);
}
else
{
renWin->SetSize(300,300);
}
RenderRenderWindow();
//
// SetSize doesn't work as expected with vtkCocoaRenderWindow in
// an offscreen setting.
// B/c of this we are forced to create a large window, the size of
// which bounds our offscreen rendering.
//
if(std::string(renWin->GetClassName()) == "vtkCocoaRenderWindow")
{
//TODO: we may want to query to find the largest valid size
// OSX limits windows to 10Kx10K, however OpenGL contexts
// are limited further.
renWin->SetSize(4096,4096);
renWin->SetPosition(-10000,-10000);
}
else
{
renWin->SetSize(300,300);
}
RenderRenderWindow();
debug2 << "render window is a " << renWin->GetClassName() << endl;
vtkOpenGLRenderWindow *glrw = dynamic_cast<vtkOpenGLRenderWindow*>(renWin);
if (!glrw) return;
vtkOpenGLExtensionManager *em = glrw->GetExtensionManager();
debug2 << "GLVendor = " << em->GetDriverGLVendor() << endl
<< "GLVersion = " << em->GetDriverGLVersion() << endl
<< "GLRenderer = " << em->GetDriverGLRenderer() << endl;
}
// ****************************************************************************
......
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