– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so found components: OpenGL GLX
– Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
– OpenGL found:
– Version:
– Include Path: /usr/include
– Libraries: /usr/lib/x86_64-linux-gnu/libOpenGL.so;/usr/lib/x86_64-linux-gnu/libGLX.so;/usr/lib/x86_64-linux-gnu/libGLU.so
2023-12-04 21:30:34.664 ( 0.597s) [ 7FF583434500]vtkXOpenGLRenderWindow.:256 ERR| vtkXOpenGLRenderWindow (0x55f79f54b640): Could not find a decent config
2023-12-04 21:30:34.664 ( 0.597s) [ 7FF583434500]vtkXOpenGLRenderWindow.:476 ERR| vtkXOpenGLRenderWindow (0x55f79f54b640): Could not find a decent visual
code:
#include <vtkPolyData.h>
#include <vtkNamedColors.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkSmartPointer.h>
#include <vtkObject.h>
#include <vtkImageActor.h>
#include <vtkNamedColors.h>
#include <vtkInteractorStyleImage.h>
//#include <vtkImporterType.h>
#include <vtkProperty.h>
#include <vtkPolyDataNormals.h>
// OPENGL TEST
#include <vtkConeSource.h>
void OpenGLTest()
{
// Create a cone using VTK
vtkSmartPointer coneSource = vtkSmartPointer::New();
// Create a mapper
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(coneSource->GetOutputPort());
// Create an actor
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
// Create a renderer
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
renderer->AddActor(actor);
// Create a render window
vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
// Create an interactor
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
// Initialize rendering and start the event loop
renderWindow->Render();
renderWindowInteractor->Start();
}
CMakeLists.txt (4.2 KB)