VTK  9.3.20240712
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#if !defined(__EMSCRIPTEN__)
16#error "vtkSDL2WebGPURenderWindow cannot be built without emscripten!"
17#endif
18
20
21#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_4_0
22#include "vtkRenderingWebGPUModule.h" // For export macro
23
24VTK_ABI_NAMESPACE_BEGIN
26 "Please use one of the dedicated platform render window or "
27 "vtkWebAssemblyWebGPURenderWindow if your application targets WebAssembly.")
28 VTKRENDERINGWEBGPU_EXPORT vtkSDL2WebGPURenderWindow : public vtkWebGPURenderWindow
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
41 bool Initialize() override;
42
48 void Finalize() override;
49
53 void SetFullScreen(vtkTypeBool) override;
54
58 void SetShowWindow(bool val) override;
59
61
64 void SetSize(int, int) override;
65 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
67
71 int* GetSize() VTK_SIZEHINT(2) override;
72
74
77 void SetPosition(int, int) override;
78 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
80
84 int* GetScreenSize() VTK_SIZEHINT(2) override;
85
89 int* GetPosition() VTK_SIZEHINT(2) override;
90
95 void SetWindowName(const char*) override;
96
97 void* GetGenericWindowId() override { return (void*)this->WindowId; }
98 void* GetGenericDrawable() override { return (void*)this->WindowId; }
99
100 void MakeCurrent() override {}
101
102 void ReleaseCurrent() override {}
103
107 bool IsCurrent() override { return false; }
108
112 void Clean();
113
118 void Frame() override;
119
124 int GetColorBufferSizes(int* rgba) override;
125
127
131 void HideCursor() override;
132 void ShowCursor() override;
134
135protected:
138
139 void* WindowId = nullptr;
140
141 std::string MakeDefaultWindowNameWithBackend() override;
143 void CreateAWindow() override;
144 void DestroyWindow() override;
145
146private:
148 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
149};
150
151VTK_ABI_NAMESPACE_END
152#endif
a simple class to control print indentation
Definition vtkIndent.h:108
int * GetSize() override
Get the current size of the window in pixels.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
~vtkWebAssemblyWebGPURenderWindow() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPosition(int a[2]) override
Set the position of the window.
bool Initialize() override
Initialize the rendering window.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
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...
void SetShowWindow(bool val) override
Show or not Show the window.
static vtkSDL2WebGPURenderWindow * New()
void Clean()
Clean up device contexts, rendering contexts, etc.
void SetSize(int a[2]) override
Set the size of the window in pixels.
void CreateAWindow() override
Create a not-off-screen window.
std::string MakeDefaultWindowNameWithBackend() override
Construct the window title as "Visualization Toolkit - <WindowSystem> <GraphicsBackend>" Ex: "Visuali...
void SetSize(int, int) override
Set the size of the window in pixels.
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...
void Finalize() override
Finalize the rendering window.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
void MakeCurrent() override
Make the window current.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void DestroyWindow() override
Destroy a not-off-screen window.
void ReleaseCurrent() override
Release the current context.
int * GetScreenSize() override
Get the current size of the screen in pixels.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_4_0(reason)
#define VTK_SIZEHINT(...)