VTK  9.6.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
13
14#ifndef vtkWebAssemblyWebGPURenderWindow_h
15#define vtkWebAssemblyWebGPURenderWindow_h
16
17#if !defined(__EMSCRIPTEN__)
18#error "vtkWebAssemblyWebGPURenderWindow cannot be built without emscripten!"
19#endif
20
22
23#include "vtkRenderingWebGPUModule.h" // For export macro
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26VTK_ABI_NAMESPACE_BEGIN
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
41 bool WindowSetup() override;
42
48 void Finalize() override;
49
53 void SetFullScreen(vtkTypeBool) override;
54
56
59 void SetSize(int, int) override;
60 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
62
66 int* GetScreenSize() VTK_SIZEHINT(2) override;
67
71 int* GetPosition() VTK_SIZEHINT(2) override;
72
73 void* GetGenericWindowId() override { return (void*)this->WindowId; }
74 void* GetGenericDrawable() override { return (void*)this->WindowId; }
75
76 void MakeCurrent() override {}
77
78 void ReleaseCurrent() override {}
79
83 bool IsCurrent() override { return false; }
84
88 void Clean();
89
94 void Frame() override;
95
100 int GetColorBufferSizes(int* rgba) override;
101
103
107 void HideCursor() override;
108 void ShowCursor() override;
110
114 vtkGetStringMacro(CanvasSelector);
115 vtkSetStringMacro(CanvasSelector);
116
121 void SetUseOffScreenBuffers(bool) override {}
122
127 void SetShowWindow(bool) override {}
128
129protected:
132
133 void* WindowId = nullptr;
134 char* CanvasSelector = nullptr;
135
136 std::string MakeDefaultWindowNameWithBackend() override;
138 void CreateAWindow() override;
139 void DestroyWindow() override;
140
141private:
143 void operator=(const vtkWebAssemblyWebGPURenderWindow&) = delete;
144};
145
146VTK_ABI_NAMESPACE_END
147#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(...)
#define VTK_MARSHALAUTO