C# Class SFML.Window.Window

Window is a rendering window ; it can create a new window or connect to an existing one
Inheritance: SFML.System.ObjectBase
Exibir arquivo Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Close (destroy) the window. The Window instance remains valid and you can call Create to recreate the window

DispatchEvents ( ) : void

Call the event handlers for each pending event

Display ( ) : void

Display the window on screen

HasFocus ( ) : bool

Check whether the window has the input focus

RequestFocus ( ) : void

Request the current window to be made the active foreground window

SetActive ( ) : bool

Activate the window as the current target for rendering

SetActive ( bool active ) : bool

Activate of deactivate the window as the current target for rendering

SetFramerateLimit ( uint limit ) : void

Limit the framerate to a maximum fixed frequency

SetIcon ( uint width, uint height, byte pixels ) : void

Change the window's icon

SetJoystickThreshold ( float threshold ) : void

Change the joystick threshold, ie. the value below which no move event will be generated

SetKeyRepeatEnabled ( bool enable ) : void

Enable or disable automatic key-repeat. Automatic key-repeat is enabled by default

SetMouseCursorGrabbed ( bool grabbed ) : void

Grab or release the mouse cursor

If set, grabs the mouse cursor inside this window's client area so it may no longer be moved outside its bounds. Note that grabbing is only active while the window has focus and calling this function for fullscreen windows won't have any effect (fullscreen windows always grab the cursor).

SetMouseCursorVisible ( bool show ) : void

Show or hide the mouse cursor

SetTitle ( string title ) : void

Change the title of the window

SetVerticalSyncEnabled ( bool enable ) : void

Enable / disable vertical synchronization

SetVisible ( bool visible ) : void

Show or hide the window

ToString ( ) : string

Provide a string describing the object

WaitAndDispatchEvents ( ) : void

Wait for a new event and dispatch it to the corresponding event handler

Window ( IntPtr handle ) : System

Create the window from an existing control with default creation settings

Window ( IntPtr Handle, ContextSettings settings ) : System

Create the window from an existing control

Window ( VideoMode mode, string title ) : System

Create the window with default style and creation settings

Window ( VideoMode mode, string title, Styles style ) : System

Create the window with default creation settings

Window ( VideoMode mode, string title, Styles style, ContextSettings settings ) : System

Create the window

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

InternalGetMousePosition ( ) : Vector2i

Internal function to get the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

InternalGetTouchPosition ( uint Finger ) : Vector2i

Internal function to get the touch position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

InternalSetMousePosition ( Vector2i position ) : void

Internal function to set the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.

PollEvent ( Event &eventToFill ) : bool

Internal function to get the next event (non-blocking)

WaitEvent ( Event &eventToFill ) : bool

Internal function to get the next event (blocking)

Window ( IntPtr cPointer, int dummy ) : System

Constructor for derived classes

Private Methods

Method Description
CallEventHandler ( Event e ) : void

Call the event handler for the given event

sfMouse_getPosition ( IntPtr CPointer ) : Vector2i
sfMouse_setPosition ( Vector2i position, IntPtr CPointer ) : void
sfTouch_getPosition ( uint Finger, IntPtr RelativeTo ) : Vector2i
sfWindow_close ( IntPtr CPointer ) : void
sfWindow_create ( VideoMode Mode, string Title, Styles Style, ContextSettings &Params ) : IntPtr
sfWindow_createFromHandle ( IntPtr Handle, ContextSettings &Params ) : IntPtr
sfWindow_createUnicode ( VideoMode Mode, IntPtr Title, Styles Style, ContextSettings &Params ) : IntPtr
sfWindow_destroy ( IntPtr CPointer ) : void
sfWindow_display ( IntPtr CPointer ) : void
sfWindow_getFrameTime ( IntPtr CPointer ) : uint
sfWindow_getPosition ( IntPtr CPointer ) : Vector2i
sfWindow_getSettings ( IntPtr CPointer ) : ContextSettings
sfWindow_getSize ( IntPtr CPointer ) : Vector2u
sfWindow_getSystemHandle ( IntPtr CPointer ) : IntPtr
sfWindow_hasFocus ( IntPtr CPointer ) : bool
sfWindow_isOpen ( IntPtr CPointer ) : bool
sfWindow_pollEvent ( IntPtr CPointer, Event &Evt ) : bool
sfWindow_requestFocus ( IntPtr CPointer ) : void
sfWindow_setActive ( IntPtr CPointer, bool Active ) : bool
sfWindow_setFramerateLimit ( IntPtr CPointer, uint Limit ) : void
sfWindow_setIcon ( IntPtr CPointer, uint Width, uint Height, byte Pixels ) : void
sfWindow_setJoystickThreshold ( IntPtr CPointer, float Threshold ) : void
sfWindow_setKeyRepeatEnabled ( IntPtr CPointer, bool Enable ) : void
sfWindow_setMouseCursorGrabbed ( IntPtr CPointer, bool grabbed ) : void
sfWindow_setMouseCursorVisible ( IntPtr CPointer, bool Show ) : void
sfWindow_setPosition ( IntPtr CPointer, Vector2i position ) : void
sfWindow_setSize ( IntPtr CPointer, Vector2u size ) : void
sfWindow_setTitle ( IntPtr CPointer, string title ) : void
sfWindow_setUnicodeTitle ( IntPtr CPointer, IntPtr title ) : void
sfWindow_setVerticalSyncEnabled ( IntPtr CPointer, bool Enable ) : void
sfWindow_setVisible ( IntPtr CPointer, bool visible ) : void
sfWindow_waitEvent ( IntPtr CPointer, Event &Evt ) : bool

Method Details

Close() public method

Close (destroy) the window. The Window instance remains valid and you can call Create to recreate the window
public Close ( ) : void
return void

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
return void

DispatchEvents() public method

Call the event handlers for each pending event
public DispatchEvents ( ) : void
return void

Display() public method

Display the window on screen
public Display ( ) : void
return void

HasFocus() public method

Check whether the window has the input focus
public HasFocus ( ) : bool
return bool

InternalGetMousePosition() protected method

Internal function to get the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalGetMousePosition ( ) : Vector2i
return Vector2i

InternalGetTouchPosition() protected method

Internal function to get the touch position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalGetTouchPosition ( uint Finger ) : Vector2i
Finger uint Finger index
return Vector2i

InternalSetMousePosition() protected method

Internal function to set the mouse position relative to the window. This function is protected because it is called by another class of another module, it is not meant to be called by users.
protected InternalSetMousePosition ( Vector2i position ) : void
position Vector2i Relative mouse position
return void

PollEvent() protected method

Internal function to get the next event (non-blocking)
protected PollEvent ( Event &eventToFill ) : bool
eventToFill Event Variable to fill with the raw pointer to the event structure
return bool

RequestFocus() public method

Request the current window to be made the active foreground window
public RequestFocus ( ) : void
return void

SetActive() public method

Activate the window as the current target for rendering
public SetActive ( ) : bool
return bool

SetActive() public method

Activate of deactivate the window as the current target for rendering
public SetActive ( bool active ) : bool
active bool True to activate, false to deactivate (true by default)
return bool

SetFramerateLimit() public method

Limit the framerate to a maximum fixed frequency
public SetFramerateLimit ( uint limit ) : void
limit uint Framerate limit, in frames per seconds (use 0 to disable limit)
return void

SetIcon() public method

Change the window's icon
public SetIcon ( uint width, uint height, byte pixels ) : void
width uint Icon's width, in pixels
height uint Icon's height, in pixels
pixels byte Array of pixels, format must be RGBA 32 bits
return void

SetJoystickThreshold() public method

Change the joystick threshold, ie. the value below which no move event will be generated
public SetJoystickThreshold ( float threshold ) : void
threshold float New threshold, in range [0, 100]
return void

SetKeyRepeatEnabled() public method

Enable or disable automatic key-repeat. Automatic key-repeat is enabled by default
public SetKeyRepeatEnabled ( bool enable ) : void
enable bool True to enable, false to disable
return void

SetMouseCursorGrabbed() public method

Grab or release the mouse cursor
If set, grabs the mouse cursor inside this window's client area so it may no longer be moved outside its bounds. Note that grabbing is only active while the window has focus and calling this function for fullscreen windows won't have any effect (fullscreen windows always grab the cursor).
public SetMouseCursorGrabbed ( bool grabbed ) : void
grabbed bool True to grab, false to release
return void

SetMouseCursorVisible() public method

Show or hide the mouse cursor
public SetMouseCursorVisible ( bool show ) : void
show bool True to show, false to hide
return void

SetTitle() public method

Change the title of the window
public SetTitle ( string title ) : void
title string New title
return void

SetVerticalSyncEnabled() public method

Enable / disable vertical synchronization
public SetVerticalSyncEnabled ( bool enable ) : void
enable bool True to enable v-sync, false to deactivate
return void

SetVisible() public method

Show or hide the window
public SetVisible ( bool visible ) : void
visible bool True to show the window, false to hide it
return void

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string

WaitAndDispatchEvents() public method

Wait for a new event and dispatch it to the corresponding event handler
public WaitAndDispatchEvents ( ) : void
return void

WaitEvent() protected method

Internal function to get the next event (blocking)
protected WaitEvent ( Event &eventToFill ) : bool
eventToFill Event Variable to fill with the raw pointer to the event structure
return bool

Window() public method

Create the window from an existing control with default creation settings
public Window ( IntPtr handle ) : System
handle System.IntPtr Platform-specific handle of the control
return System

Window() public method

Create the window from an existing control
public Window ( IntPtr Handle, ContextSettings settings ) : System
Handle System.IntPtr Platform-specific handle of the control
settings ContextSettings Creation parameters
return System

Window() protected method

Constructor for derived classes
protected Window ( IntPtr cPointer, int dummy ) : System
cPointer System.IntPtr Pointer to the internal object in the C API
dummy int Internal hack :)
return System

Window() public method

Create the window with default style and creation settings
public Window ( VideoMode mode, string title ) : System
mode VideoMode Video mode to use
title string Title of the window
return System

Window() public method

Create the window with default creation settings
public Window ( VideoMode mode, string title, Styles style ) : System
mode VideoMode Video mode to use
title string Title of the window
style Styles Window style (Resize | Close by default)
return System

Window() public method

Create the window
public Window ( VideoMode mode, string title, Styles style, ContextSettings settings ) : System
mode VideoMode Video mode to use
title string Title of the window
style Styles Window style (Resize | Close by default)
settings ContextSettings Creation parameters
return System