VTK  9.5.20250718
vtkWebAssemblyWebGPURenderWindow.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
17#ifndef vtkWebAssemblyWebGPURenderWindow_h
18#define vtkWebAssemblyWebGPURenderWindow_h
19
20#if !defined(__EMSCRIPTEN__)
21#error "vtkWebAssemblyWebGPURenderWindow cannot be built without emscripten!"
22#endif
23
25
26#include "vtkRenderingWebGPUModule.h" // For export macro
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28
29VTK_ABI_NAMESPACE_BEGIN
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
44 bool WindowSetup() override;
45
51 void Finalize() override;
52
56 void SetFullScreen(vtkTypeBool) override;
57
59
62 void SetSize(int, int) override;
63 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
65
69 int* GetScreenSize() VTK_SIZEHINT(2) override;
70
74 int* GetPosition() VTK_SIZEHINT(2) override;
75
76 void* GetGenericWindowId() override { return (void*)this->WindowId; }
77 void* GetGenericDrawable() override { return (void*)this->WindowId; }
78
79 void MakeCurrent() override {}
80
81 void ReleaseCurrent() override {}
82
86 bool IsCurrent() override { return false; }
87
91 void Clean();
92
97 void Frame() override;
98
103 int GetColorBufferSizes(int* rgba) override;
104
106
110 void HideCursor() override;
111 void ShowCursor() override;
113
117 vtkGetStringMacro(CanvasSelector);
118 vtkSetStringMacro(CanvasSelector);
119
124 void SetUseOffScreenBuffers(bool) override {}
125
130 void SetShowWindow(bool) override {}
131
132protected:
135
136 void* WindowId = nullptr;
137 char* CanvasSelector = nullptr;
138
139 std::string MakeDefaultWindowNameWithBackend() override;
141 void CreateAWindow() override;
142 void DestroyWindow() override;
143
144private:
146 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
147};
148
149VTK_ABI_NAMESPACE_END
150#endif
a simple class to control print indentation
Definition vtkIndent.h:108
void CreateAWindow() override
Create a not-off-screen window.
bool WindowSetup() override
Initialize the rendering window.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
void SetSize(int, int) override
Set the size of the window in pixels.
void SetShowWindow(bool) override
Make the setter for ShowWindow no-op.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetUseOffScreenBuffers(bool) override
Make the setter for UseOffscreenBuffers no-op.
void DestroyWindow() override
Destroy a not-off-screen window.
void Clean()
Clean up device contexts, rendering contexts, etc.
void ReleaseCurrent() override
Release the current context.
static vtkWebAssemblyWebGPURenderWindow * New()
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
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 * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void Finalize() override
Finalize the rendering window.
void MakeCurrent() override
Make the window current.
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
void SetSize(int a[2]) override
Set the size of the window in pixels.
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...
std::string MakeDefaultWindowNameWithBackend() override
Construct the window title as "Visualization Toolkit - <WindowSystem> <GraphicsBackend>" Ex: "Visuali...
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
int * GetScreenSize() override
Get the current size of the screen in pixels.
WebGPU rendering window.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO