Skip to main content

Class SimpleSDLWindow

A very basic SDL wrapper to handle creating a window and processing SDL events.

Assembly: ImGuiScene.dll
View Source
Declaration
public class SimpleSDLWindow : IDisposable

Derived:
ImGuiScene.SDLWindowGL

Implements:
System.IDisposable

Properties

Window

The SDL_Window pointer for this window.

View Source
Declaration
public IntPtr Window { get; }

WantsClose

Whether an event has closed this window.

View Source
Declaration
public bool WantsClose { get; set; }

OnSDLEvent

Delegate for providing user event handler methods that want to respond to SDL_Events.

View Source
Declaration
public SimpleSDLWindow.ProcessEventDelegate OnSDLEvent { get; set; }

Fields

Gl

View Source
Declaration
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
Declaration
public static uint CreateColorKey(float r, float g, float b)
Returns

System.UInt32

Parameters
TypeNameDescription
System.SinglerThe red component of the mask color (0-1)
System.SinglegThe green component of the mask color (0-1)
System.SinglebThe blue component of the mask color (0-1)

InitForRenderer(IRenderer)

View Source
Declaration
protected virtual void InitForRenderer(IRenderer renderer)
Parameters
TypeName
ImGuiScene.IRendererrenderer

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
Declaration
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
TypeNameDescription
ImGuiScene.WindowCreateInfocreateInfoThe requested creation parameters for the window.

GetHWnd()

Gets the HWND of this window for interop with Windows methods.

View Source
Declaration
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
Declaration
protected void MakeTransparent(uint transparentColorKey)
Parameters
TypeName
System.UInt32transparentColorKey

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
Declaration
public void ProcessEvents()

Dispose(bool)

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

~SimpleSDLWindow()

View Source
Declaration
protected ~SimpleSDLWindow()

Dispose()

View Source
Declaration
public void Dispose()

Implements

  • System.IDisposable