VTK: Rendering/WebGPU/vtkSDL2WebGPURenderWindow.h Source File

| VTK 9.3.1

vtkSDL2WebGPURenderWindow.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkSDL2WebGPURenderWindow_h
13 #define vtkSDL2WebGPURenderWindow_h
14
15 #include "vtkWebGPURenderWindow.h"
16
17 #include "vtkRenderingWebGPUModule.h" // For export macro
18
19 VTK_ABI_NAMESPACE_BEGIN
20 class VTKRENDERINGWEBGPU_EXPORT vtkSDL2WebGPURenderWindow : public vtkWebGPURenderWindow
21 {
22 public:
23 static vtkSDL2WebGPURenderWindow* New();
24 vtkTypeMacro(vtkSDL2WebGPURenderWindow, vtkWebGPURenderWindow);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
33 bool Initialize() override;
34
40 void Finalize() override;
41
45 void SetFullScreen(vtkTypeBool) override;
46
50 void SetShowWindow(bool val) override;
51
53
56 void SetSize(int, int) override;
57 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
59
63 int* GetSize() VTK_SIZEHINT(2) override;
64
66
69 void SetPosition(int, int) override;
70 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
72
76 int* GetScreenSize() VTK_SIZEHINT(2) override;
77
81 int* GetPosition() VTK_SIZEHINT(2) override;
82
87 void SetWindowName(const char*) override;
88
89 void* GetGenericWindowId() override { return (void*)this->WindowId; }
90 void* GetGenericDrawable() override { return (void*)this->WindowId; }
91
92 void MakeCurrent() override {}
93
94 void ReleaseCurrent() override {}
95
99 bool IsCurrent() override { return false; }
100
104 void Clean();
105
110 void Frame() override;
111
116 int GetColorBufferSizes(int* rgba) override;
117
119
123 void HideCursor() override;
124 void ShowCursor() override;
126
127 protected:
128 vtkSDL2WebGPURenderWindow();
129 ~vtkSDL2WebGPURenderWindow() override;
130
131 void* WindowId = nullptr;
132 static const std::string DEFAULT_BASE_WINDOW_NAME;
133
134 void CleanUpRenderers();
135 void CreateAWindow() override;
136 void DestroyWindow() override;
137
138 private:
139 vtkSDL2WebGPURenderWindow(const vtkSDL2WebGPURenderWindow&) = delete;
140 void operator=(const vtkSDL2WebGPURenderWindow&) = delete;
141 };
142
143 VTK_ABI_NAMESPACE_END
144 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkSDL2WebGPURenderWindow
OpenGL rendering window.
Definition: vtkSDL2WebGPURenderWindow.h:21
vtkSDL2WebGPURenderWindow::GetScreenSize
int * GetScreenSize() override
Get the current size of the screen in pixels.
vtkSDL2WebGPURenderWindow::GetColorBufferSizes
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
vtkSDL2WebGPURenderWindow::CleanUpRenderers
void CleanUpRenderers()
vtkSDL2WebGPURenderWindow::New
static vtkSDL2WebGPURenderWindow * New()
vtkSDL2WebGPURenderWindow::DEFAULT_BASE_WINDOW_NAME
static const std::string DEFAULT_BASE_WINDOW_NAME
Definition: vtkSDL2WebGPURenderWindow.h:132
vtkSDL2WebGPURenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
Definition: vtkSDL2WebGPURenderWindow.h:90
vtkSDL2WebGPURenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSDL2WebGPURenderWindow::SetPosition
void SetPosition(int a[2]) override
Set the position of the window.
Definition: vtkSDL2WebGPURenderWindow.h:70
vtkSDL2WebGPURenderWindow::Initialize
bool Initialize() override
Initialize the rendering window.
vtkSDL2WebGPURenderWindow::vtkSDL2WebGPURenderWindow
vtkSDL2WebGPURenderWindow()
vtkSDL2WebGPURenderWindow::IsCurrent
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
Definition: vtkSDL2WebGPURenderWindow.h:99
vtkSDL2WebGPURenderWindow::HideCursor
void HideCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
vtkSDL2WebGPURenderWindow::SetShowWindow
void SetShowWindow(bool val) override
Show or not Show the window.
vtkSDL2WebGPURenderWindow::Clean
void Clean()
Clean up device contexts, rendering contexts, etc.
vtkSDL2WebGPURenderWindow::SetSize
void SetSize(int a[2]) override
Set the size of the window in pixels.
Definition: vtkSDL2WebGPURenderWindow.h:57
vtkSDL2WebGPURenderWindow::CreateAWindow
void CreateAWindow() override
Create a not-off-screen window.
vtkSDL2WebGPURenderWindow::~vtkSDL2WebGPURenderWindow
~vtkSDL2WebGPURenderWindow() override
vtkSDL2WebGPURenderWindow::SetSize
void SetSize(int, int) override
Set the size of the window in pixels.
vtkSDL2WebGPURenderWindow::ShowCursor
void ShowCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
vtkSDL2WebGPURenderWindow::Finalize
void Finalize() override
Finalize the rendering window.
vtkSDL2WebGPURenderWindow::Frame
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkSDL2WebGPURenderWindow::SetFullScreen
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
vtkSDL2WebGPURenderWindow::MakeCurrent
void MakeCurrent() override
Make the window current.
Definition: vtkSDL2WebGPURenderWindow.h:92
vtkSDL2WebGPURenderWindow::GetSize
int * GetSize() override
Get the current size of the window in pixels.
vtkSDL2WebGPURenderWindow::DestroyWindow
void DestroyWindow() override
Destroy a not-off-screen window.
vtkSDL2WebGPURenderWindow::ReleaseCurrent
void ReleaseCurrent() override
Release the current context.
Definition: vtkSDL2WebGPURenderWindow.h:94
vtkWebGPURenderWindow
Definition: vtkWebGPURenderWindow.h:15
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkWebGPURenderWindow.h
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36