Class SimpleSDLWindow
A very basic SDL wrapper to handle creating a window and processing SDL events.
Assembly: ImGuiScene.dll
View Source
public class SimpleSDLWindow : IDisposable
Derived:
ImGuiScene.SDLWindowGL
Implements:
System.IDisposable
Properties
Window
The SDL_Window pointer for this window.
View Source
public IntPtr Window { get; }
WantsClose
Whether an event has closed this window.
View Source
public bool WantsClose { get; set; }
OnSDLEvent
Delegate for providing user event handler methods that want to respond to SDL_Events.
View Source
public SimpleSDLWindow.ProcessEventDelegate OnSDLEvent { get; set; }
Fields
Gl
View Source
protected static readonly GL Gl
Methods
CreateColorKey(float, float, float)
Creates a color key for use as a mask for ImGuiScene.SimpleSDLWindow.MakeTransparent(uint)
View Source
public static uint CreateColorKey(float r, float g, float b)
Returns
System.UInt32
Parameters
Type | Name | Description |
---|---|---|
System.Single | r | The red component of the mask color (0-1) |
System.Single | g | The green component of the mask color (0-1) |
System.Single | b | The blue component of the mask color (0-1) |
InitForRenderer(IRenderer)
View Source
protected virtual void InitForRenderer(IRenderer renderer)
Parameters
Type | Name |
---|---|
ImGuiScene.IRenderer | renderer |
WindowCreationFlags(WindowCreateInfo)
Return the set of window flags necessary to create a window matching what is requested in <code class="paramref">createInfo</code>
View Source
protected virtual SDL.SDL_WindowFlags WindowCreationFlags(WindowCreateInfo createInfo)
Returns
SDL2.SDL.SDL_WindowFlags
: The full set of SDL_WindowFlags to use when creating this window.
Parameters
Type | Name | Description |
---|---|---|
ImGuiScene.WindowCreateInfo | createInfo | The requested creation parameters for the window. |
GetHWnd()
Gets the HWND of this window for interop with Windows methods.
View Source
public IntPtr GetHWnd()
Returns
System.IntPtr
: This window's HWND### MakeTransparent(uint)
Converts this to a layered window and makes any region that matches <code class="paramref">transparentColorKey</code> fully transparent.
Transparent regions behave as if they are not present, and can be clicked through etc.
View Source
protected void MakeTransparent(uint transparentColorKey)
Parameters
Type | Name |
---|---|
System.UInt32 | transparentColorKey |
ProcessEvents()
Basic SDL event loop to consume all events and handle window closure. User handlers from ImGuiScene.SimpleSDLWindow.OnSDLEvent are invoked for every event.
View Source
public void ProcessEvents()
Dispose(bool)
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
~SimpleSDLWindow()
View Source
protected ~SimpleSDLWindow()
Dispose()
View Source
public void Dispose()
Implements
System.IDisposable