Commit 8bbdb3a0 authored by Scott Wittenburg's avatar Scott Wittenburg
Browse files

XRInterface: fix plugin to build on linux

Make sure that glew.h is included before gl.h or else some translation
units will not compile.  Add missing include guards, and ensure that
system libraries defining some symbols are not included before Qt
headers that define the same names.
parent cc9fabc0
# Support OpenXR on Linux
The OpenVR Plugin now supports sending to OpenXR on Linux, and has been tested
with a recent version of the Monado OpenXR runtime.
......@@ -20,6 +20,9 @@
* can be used. Instantiated by the pqXRInterfaceDockPanel.
*/
#ifndef pqXRInterfaceControls_h
#define pqXRInterfaceControls_h
#include <QWidget>
class pqPipelineSource;
......@@ -70,3 +73,5 @@ private:
pqVCRController* Controller;
};
#endif
......@@ -20,6 +20,16 @@
#ifndef vtkPVXRInterfaceCollaborationClient_h
#define vtkPVXRInterfaceCollaborationClient_h
#if defined(VTK_USE_X)
// There are compile errors in vtkPVXRInterfaceCollaborationClient.cxx if Qt, X, and glew
// are not included here and in just this order. We have to prevent clang-format from
// "fixing" this for us or compilation will fail.
// clang-format off
#include "vtk_glew.h"
#include "QVTKOpenGLWindow.h"
// clang-format on
#endif
#include "vtkEventData.h"
#include "vtkLogger.h" // for Verbosity enum
#include "vtkObject.h"
......
......@@ -23,6 +23,20 @@
#ifndef vtkPVXRInterfaceHelper_h
#define vtkPVXRInterfaceHelper_h
#include "vtkRenderingOpenGLConfigure.h"
#if defined(VTK_USE_X)
// There are compile errors in vtkPVXRInterfaceHelper.cxx if Qt, X, and glew
// are not included here and in just this order. We have to prevent
// clang-format from "fixing" this for us or compilation will fail.
// clang-format off
#include "vtk_glew.h"
#include "QVTKOpenGLWindow.h"
#include <qdir.h>
#include <qurl.h>
// clang-format on
#endif
#include "vtkNew.h" // for ivars
#include "vtkObject.h"
#include "vtkVRCamera.h" // for visibility of inner "Pose" class
......
......@@ -16,6 +16,9 @@
* @brief Stores ands returns runtime location of a plugin
*
*/
#ifndef vtkPVXRInterfacePluginLocation_h
#define vtkPVXRInterfacePluginLocation_h
#include <string>
class vtkPVXRInterfacePluginLocation
......@@ -36,3 +39,5 @@ public:
protected:
static std::string PluginLocation;
};
#endif
Supports Markdown
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