Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Sep 30, 2024
1 parent 5a5a940 commit 32afb94
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
3 changes: 2 additions & 1 deletion library/private/window_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class window_impl : public window
* Create the internal vtkRenderWindow using the offscreen param
* and store option ref for later usage
*/
window_impl(const options& options, Type type, bool offscreen, const context::function& getProcAddress);
window_impl(
const options& options, Type type, bool offscreen, const context::function& getProcAddress);
/**
* Default destructor
*/
Expand Down
3 changes: 2 additions & 1 deletion library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class interactor_impl::internals
, Window(window)
, Loader(loader)
{
if (window.getType() == window::Type::GLX || window.getType() == window::Type::WGL || window.getType() == window::Type::COCOA)
if (window.getType() == window::Type::GLX || window.getType() == window::Type::WGL ||
window.getType() == window::Type::COCOA)
{
this->VTKInteractor = vtkRenderWindowInteractor::New();
}
Expand Down
14 changes: 6 additions & 8 deletions library/src/window_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#endif

#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK(9, 3, 20240914)
#include <vtkglad/include/glad/egl.h>
#include <vtkOSOpenGLRenderWindow.h>
#include <vtkglad/include/glad/egl.h>
#endif

#if F3D_MODULE_EXTERNAL_RENDERING
Expand Down Expand Up @@ -173,7 +173,8 @@ class window_impl::internals
};

//----------------------------------------------------------------------------
window_impl::window_impl(const options& options, Type type, bool offscreen, const context::function& getProcAddress)
window_impl::window_impl(
const options& options, Type type, bool offscreen, const context::function& getProcAddress)
: Internals(std::make_unique<window_impl::internals>(options))
{
this->Internals->WindowType = type;
Expand Down Expand Up @@ -239,17 +240,15 @@ window_impl::window_impl(const options& options, Type type, bool offscreen, cons
#ifdef VTK_USE_X
this->Internals->RenWin = vtkSmartPointer<vtkXOpenGLRenderWindow>::New();
#else
throw engine::no_window_exception(
"Window type is GLX but VTK GLX support is not enabled");
throw engine::no_window_exception("Window type is GLX but VTK GLX support is not enabled");
#endif
}
else if (type == Type::WGL)
{
#ifdef _WIN32
this->Internals->RenWin = vtkSmartPointer<vtkWin32OpenGLRenderWindow>::New();
#else
throw engine::no_window_exception(
"Window type is WGL but it is supported on Windows only");
throw engine::no_window_exception("Window type is WGL but it is supported on Windows only");
#endif
this->Internals->RenWin = vtkSmartPointer<vtkRenderWindow>::New();
}
Expand All @@ -258,8 +257,7 @@ window_impl::window_impl(const options& options, Type type, bool offscreen, cons
#ifdef __APPLE__
this->Internals->RenWin = vtkSmartPointer<vtkCocoaRenderWindow>::New();
#else
throw engine::no_window_exception(
"Window type is Cocoa but it is supported on macOS only");
throw engine::no_window_exception("Window type is Cocoa but it is supported on macOS only");
#endif
}
else if (type == Type::AUTO)
Expand Down
4 changes: 3 additions & 1 deletion library/testing/TestSDKExternalWindowQT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class F3DWindow : public QOpenGLWindow
{
this->QOpenGLWindow::initializeGL();

f3d::context::function loadFunc = [this](const char* name) { return this->context()->getProcAddress(name); };
f3d::context::function loadFunc = [this](const char* name) {
return this->context()->getProcAddress(name);
};

mEngine = std::make_unique<f3d::engine>(f3d::engine::createExternal(loadFunc));
f3d::loader& load = mEngine->getLoader();
Expand Down
11 changes: 6 additions & 5 deletions python/F3DPythonBindings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ PYBIND11_MODULE(pyf3d, module)
py::class_<f3d::engine> engine(module, "Engine");

engine //
.def_static(
"create", &f3d::engine::create, "Create an engine with a automatic window")
.def_static("create", &f3d::engine::create, "Create an engine with a automatic window")
.def_static("create_none", &f3d::engine::createNone, "Create an engine with no window")
.def_static("create_egl", &f3d::engine::createEGL,
"Create an engine with an EGL window (Windows/Linux only)")
Expand All @@ -339,9 +338,11 @@ PYBIND11_MODULE(pyf3d, module)
"Create an engine with an OSMesa window (Windows/Linux only)")
.def_static("create_osmesa", &f3d::engine::createOSMesa,
"Create an engine with an OSMesa window (Windows/Linux only)")
.def_static("create_external", [](){ return f3d::engine::createExternal(nullptr); },
.def_static(
"create_external", []() { return f3d::engine::createExternal(nullptr); },
"Create an engine with an existing context (Windows/macOS only)")
.def_static("create_external_glx", [](){ return f3d::engine::createExternal(nullptr); },
.def_static(
"create_external_glx", []() { return f3d::engine::createExternal(nullptr); },
"Create an engine with an existing GLX context (Linux only)")
.def_static("create_external_egl", &f3d::engine::createExternalEGL,
"Create an engine with an existing EGL context (Windows/Linux only)")
Expand All @@ -368,7 +369,7 @@ PYBIND11_MODULE(pyf3d, module)
py::arg("force_std_err") = false)
.def_static("set_use_coloring", &f3d::log::setUseColoring)
.def_static("print",
[](f3d::log::VerboseLevel& level, const std::string& message)
[](f3d::log::VerboseLevel& level, const std::string& message)
{ f3d::log::print(level, message); });

py::enum_<f3d::log::VerboseLevel>(log, "VerboseLevel")
Expand Down

0 comments on commit 32afb94

Please sign in to comment.