VTK  9.3.0
vtkSDL2WebGPURenderWindow.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
12 #ifndef vtkSDL2WebGPURenderWindow_h
13 #define vtkSDL2WebGPURenderWindow_h
14 
15 #include "vtkWebGPURenderWindow.h"
16 
17 #include "vtkRenderingWebGPUModule.h" // For export macro
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 class VTKRENDERINGWEBGPU_EXPORT vtkSDL2WebGPURenderWindow : public vtkWebGPURenderWindow
21 {
22 public:
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
33  bool Initialize() override;
34 
40  void Finalize() override;
41 
45  void SetFullScreen(vtkTypeBool) override;
46 
50  void SetShowWindow(bool val) override;
51 
53 
56  void SetSize(int, int) override;
57  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
59 
63  int* GetSize() VTK_SIZEHINT(2) override;
64 
66 
69  void SetPosition(int, int) override;
70  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
72 
76  int* GetScreenSize() VTK_SIZEHINT(2) override;
77 
81  int* GetPosition() VTK_SIZEHINT(2) override;
82 
87  void SetWindowName(const char*) override;
88 
89  void* GetGenericWindowId() override { return (void*)this->WindowId; }
90  void* GetGenericDrawable() override { return (void*)this->WindowId; }
91 
92  void MakeCurrent() override {}
93 
94  void ReleaseCurrent() override {}
95 
99  bool IsCurrent() override { return false; }
100 
104  void Clean();
105 
110  void Frame() override;
111 
116  int GetColorBufferSizes(int* rgba) override;
117 
119 
123  void HideCursor() override;
124  void ShowCursor() override;
126 
127 protected:
130 
131  void* WindowId = nullptr;
133 
135  void CreateAWindow() override;
136  void DestroyWindow() override;
137 
138 private:
140  void operator=(const vtkSDL2WebGPURenderWindow&) = delete;
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
int * GetScreenSize() override
Get the current size of the screen in pixels.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
static vtkSDL2WebGPURenderWindow * New()
static const std::string DEFAULT_BASE_WINDOW_NAME
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPosition(int a[2]) override
Set the position of the window.
bool Initialize() override
Initialize the rendering window.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
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...
void SetShowWindow(bool val) override
Show or not Show the window.
void Clean()
Clean up device contexts, rendering contexts, etc.
void SetSize(int a[2]) override
Set the size of the window in pixels.
void CreateAWindow() override
Create a not-off-screen window.
~vtkSDL2WebGPURenderWindow() override
void SetSize(int, int) override
Set the size of the window in pixels.
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 Finalize() override
Finalize the rendering window.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
void MakeCurrent() override
Make the window current.
int * GetSize() override
Get the current size of the window in pixels.
void DestroyWindow() override
Destroy a not-off-screen window.
void ReleaseCurrent() override
Release the current context.
@ string
Definition: vtkX3D.h:490
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)