Commit 4810b281 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'add_opengl_system_probe'

9eba3269

 add an executable to do opengl detection
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3634
parents 666d6f94 9eba3269
......@@ -356,6 +356,9 @@ if (APPLE_IOS)
vtk_module_link_libraries(${vtk-module} LINK_PUBLIC "-framework UIKit")
endif()
VTK_ADD_EXECUTABLE(vtkProbeOpenGLVersion vtkProbeOpenGLVersion.cxx)
target_link_libraries(vtkProbeOpenGLVersion ${vtk-module})
if (WIN32 AND ( NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR) )
VTK_ADD_EXECUTABLE(vtkTestOpenGLVersion vtkTestOpenGLVersion.cxx)
set_target_properties(vtkTestOpenGLVersion
......
/*=========================================================================
Program: Visualization Toolkit
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkAutoInit.h"
VTK_MODULE_INIT(vtkRenderingOpenGL2);
#include "vtkNew.h"
#include "vtkRenderer.h"
#include "vtkOpenGLRenderWindow.h"
#include "vtkOutputWindow.h"
#include <sstream>
int main(int , char* /* argv */[])
{
int result = 0;
vtkNew<vtkRenderer> renderer;
vtkNew<vtkRenderWindow> renderWindow;
renderWindow->AddRenderer(renderer);
std::ostringstream toString;
toString << "Class: " << renderWindow->GetClassName();
if (!renderWindow->SupportsOpenGL())
{
toString << " failed to find a working OpenGL\n\n";
toString << vtkOpenGLRenderWindow::SafeDownCast(renderWindow)->GetOpenGLSupportMessage();
result = 1;
}
else
{
toString << " succeeded in finding a working OpenGL\n\n";
}
renderWindow->Render();
toString << renderWindow->ReportCapabilities();
vtkOutputWindow::GetInstance()->PromptUserOn();
vtkOutputWindow::GetInstance()->DisplayText(toString.str().c_str());
return result;
}
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