VTK  9.4.20250509
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
15#ifndef vtkWebAssemblyWebGPURenderWindow_h
16#define vtkWebAssemblyWebGPURenderWindow_h
17
18#if !defined(__EMSCRIPTEN__)
19#error "vtkWebAssemblyWebGPURenderWindow cannot be built without emscripten!"
20#endif
21
23
24#include "vtkRenderingWebGPUModule.h" // For export macro
25
26VTK_ABI_NAMESPACE_BEGIN
27class VTKRENDERINGWEBGPU_EXPORT vtkWebAssemblyWebGPURenderWindow : public vtkWebGPURenderWindow
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
40 bool WindowSetup() override;
41
47 void Finalize() override;
48
52 void SetFullScreen(vtkTypeBool) override;
53
55
58 void SetSize(int, int) override;
59 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
61
65 int* GetScreenSize() VTK_SIZEHINT(2) override;
66
70 int* GetPosition() VTK_SIZEHINT(2) override;
71
72 void* GetGenericWindowId() override { return (void*)this->WindowId; }
73 void* GetGenericDrawable() override { return (void*)this->WindowId; }
74
75 void MakeCurrent() override {}
76
77 void ReleaseCurrent() override {}
78
82 bool IsCurrent() override { return false; }
83
87 void Clean();
88
93 void Frame() override;
94
99 int GetColorBufferSizes(int* rgba) override;
100
102
106 void HideCursor() override;
107 void ShowCursor() override;
109
113 vtkGetStringMacro(CanvasSelector);
114 vtkSetStringMacro(CanvasSelector);
115
120 void SetUseOffScreenBuffers(bool) override {}
121
126 void SetShowWindow(bool) override {}
127
128protected:
131
132 void* WindowId = nullptr;
133 char* CanvasSelector = nullptr;
134
135 std::string MakeDefaultWindowNameWithBackend() override;
137 void CreateAWindow() override;
138 void DestroyWindow() override;
139
140private:
142 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
143};
144
145VTK_ABI_NAMESPACE_END
146#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(...)