VTK  9.4.20241112
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
57 void SetShowWindow(bool val) override;
58
60
63 void SetSize(int, int) override;
64 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
66
70 int* GetScreenSize() VTK_SIZEHINT(2) override;
71
75 int* GetPosition() VTK_SIZEHINT(2) override;
76
77 void* GetGenericWindowId() override { return (void*)this->WindowId; }
78 void* GetGenericDrawable() override { return (void*)this->WindowId; }
79
80 void MakeCurrent() override {}
81
82 void ReleaseCurrent() override {}
83
87 bool IsCurrent() override { return false; }
88
92 void Clean();
93
98 void Frame() override;
99
104 int GetColorBufferSizes(int* rgba) override;
105
107
111 void HideCursor() override;
112 void ShowCursor() override;
114
118 vtkGetStringMacro(CanvasSelector);
119 vtkSetStringMacro(CanvasSelector);
120
121protected:
124
125 void* WindowId = nullptr;
126 char* CanvasSelector = nullptr;
127
128 std::string MakeDefaultWindowNameWithBackend() override;
130 void CreateAWindow() override;
131 void DestroyWindow() override;
132
133private:
135 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
136};
137
138VTK_ABI_NAMESPACE_END
139#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 PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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...
void SetShowWindow(bool val) override
Show or not Show the window.
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(...)