Skip to content

Commit

Permalink
Deploying to gh-pages from @ d8ea37a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Nov 20, 2024
1 parent 05f4b93 commit 52690ef
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
6 changes: 6 additions & 0 deletions vtkext/private/module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ if(WIN32)
list(APPEND classes vtkF3DWin32OutputWindow vtkF3DWGLRenderWindow)
endif()

# In theory the test should be `if (VTK_USE_X)` but this variable is
# only exported starting from VTK 9.4
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
list(APPEND classes vtkF3DGLXRenderWindow)
endif()

if(ANDROID)
list(APPEND classes vtkF3DAndroidLogOutputWindow)
endif()
Expand Down
38 changes: 38 additions & 0 deletions vtkext/private/module/vtkF3DGLXRenderWindow.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <vtkObjectFactory.h>
#include <vtkVersion.h>

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 3, 20240914)
#include <vtk_glad.h>
#include <vtkglad/include/glad/glx.h>
#else
#include <vtk_glew.h>
#endif

#include "vtkF3DGLXRenderWindow.h"

#include <X11/Xlib.h>

//------------------------------------------------------------------------------
vtkF3DGLXRenderWindow::vtkF3DGLXRenderWindow() = default;

//------------------------------------------------------------------------------
vtkF3DGLXRenderWindow::~vtkF3DGLXRenderWindow() = default;

//------------------------------------------------------------------------------
vtkF3DGLXRenderWindow* vtkF3DGLXRenderWindow::New()
{
// Check if the X display is available
Display* dpy = XOpenDisplay(nullptr);
if (dpy == nullptr)
{
return nullptr;
}
XCloseDisplay(dpy);

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 3, 20240914)
// Load core glx functions
gladLoaderLoadGLX(nullptr, 0);
#endif

VTK_STANDARD_NEW_BODY(vtkF3DGLXRenderWindow);
}
25 changes: 25 additions & 0 deletions vtkext/private/module/vtkF3DGLXRenderWindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @class vtkF3DGLXRenderWindow
* @brief GLX context render window
*/

#ifndef vtkF3DGLXRenderWindow_h
#define vtkF3DGLXRenderWindow_h

#include "vtkXOpenGLRenderWindow.h"

class vtkF3DGLXRenderWindow : public vtkXOpenGLRenderWindow
{
public:
static vtkF3DGLXRenderWindow* New();
vtkTypeMacro(vtkF3DGLXRenderWindow, vtkXOpenGLRenderWindow);

protected:
vtkF3DGLXRenderWindow();
~vtkF3DGLXRenderWindow() override;

private:
vtkF3DGLXRenderWindow(const vtkF3DGLXRenderWindow&) = delete;
void operator=(const vtkF3DGLXRenderWindow&) = delete;
};
#endif // vtkF3DGLXRenderWindow_h
2 changes: 1 addition & 1 deletion web/f3d.js

Large diffs are not rendered by default.

Binary file modified web/f3d.wasm
Binary file not shown.

0 comments on commit 52690ef

Please sign in to comment.