VTK  9.3.1
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:
129  ~vtkSDL2WebGPURenderWindow() override;
130 
131  void* WindowId = nullptr;
133 
134  void CleanUpRenderers();
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
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
virtual void HideCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
void ReleaseCurrent() override
Release the current context.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
virtual void Finalize()
Finalize the rendering process.
virtual void SetShowWindow(bool)
Show or not Show the window.
virtual void CreateAWindow()=0
Create a not-off-screen window.
int vtkTypeBool
Definition: vtkABI.h:64
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ShowCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:94
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
virtual bool Initialize()=0
Concrete render windows must create a platform window and initialize this->WindowId.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
#define VTK_SIZEHINT(...)
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels)...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static const std::string DEFAULT_BASE_WINDOW_NAME
void SetSize(int a[2]) override
Set the size of the window in pixels.
void MakeCurrent() override
Make the window current.
void SetPosition(int a[2]) override
Set the position of the window.
OpenGL rendering window.