VTK  9.5.2
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
11
12#ifndef vtkWebAssemblyWebGPURenderWindow_h
13#define vtkWebAssemblyWebGPURenderWindow_h
14
15#if !defined(__EMSCRIPTEN__)
16#error "vtkWebAssemblyWebGPURenderWindow cannot be built without emscripten!"
17#endif
18
20
21#include "vtkRenderingWebGPUModule.h" // For export macro
22
23VTK_ABI_NAMESPACE_BEGIN
24class VTKRENDERINGWEBGPU_EXPORT vtkWebAssemblyWebGPURenderWindow : public vtkWebGPURenderWindow
25{
26public:
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
37 bool WindowSetup() override;
38
44 void Finalize() override;
45
49 void SetFullScreen(vtkTypeBool) override;
50
52
55 void SetSize(int, int) override;
56 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
58
62 int* GetScreenSize() VTK_SIZEHINT(2) override;
63
67 int* GetPosition() VTK_SIZEHINT(2) override;
68
69 void* GetGenericWindowId() override { return (void*)this->WindowId; }
70 void* GetGenericDrawable() override { return (void*)this->WindowId; }
71
72 void MakeCurrent() override {}
73
74 void ReleaseCurrent() override {}
75
79 bool IsCurrent() override { return false; }
80
84 void Clean();
85
90 void Frame() override;
91
96 int GetColorBufferSizes(int* rgba) override;
97
99
103 void HideCursor() override;
104 void ShowCursor() override;
106
110 vtkGetStringMacro(CanvasSelector);
111 vtkSetStringMacro(CanvasSelector);
112
117 void SetUseOffScreenBuffers(bool) override {}
118
123 void SetShowWindow(bool) override {}
124
125protected:
128
129 void* WindowId = nullptr;
130 char* CanvasSelector = nullptr;
131
132 std::string MakeDefaultWindowNameWithBackend() override;
134 void CreateAWindow() override;
135 void DestroyWindow() override;
136
137private:
139 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
140};
141
142VTK_ABI_NAMESPACE_END
143#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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.
int * GetPosition() override
Get the position in screen coordinates of the window.
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 * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
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.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)