SFML.Net
RenderWindow Methods |
The RenderWindow type exposes the following members.

Name | Description | |
---|---|---|
![]() |
Capture |
Capture the current contents of the window into an image
|
![]() |
Clear |
Clear the entire window with black color
|
![]() |
Clear(Color) |
Clear the entire window with a single color
|
![]() |
Close |
Close (destroy) the window.
The Window instance remains valid and you can call
Create to recreate the window
(Overrides WindowClose.) |
![]() |
Destroy |
Handle the destruction of the object
(Overrides WindowDestroy(Boolean).) |
![]() |
DispatchEvents |
Call the event handlers for each pending event
(Inherited from Window.) |
![]() |
Display |
Display the window on screen
(Overrides WindowDisplay.) |
![]() |
Dispose |
Explicitely dispose the object
(Inherited from ObjectBase.) |
![]() |
Draw(Drawable) |
Draw a drawable object to the render-target, with default render states
|
![]() |
Draw(Drawable, RenderStates) |
Draw a drawable object to the render-target
|
![]() |
Draw(Vertex, PrimitiveType) |
Draw primitives defined by an array of vertices, with default render states
|
![]() |
Draw(Vertex, PrimitiveType, RenderStates) |
Draw primitives defined by an array of vertices
|
![]() |
Draw(Vertex, UInt32, UInt32, PrimitiveType) |
Draw primitives defined by a sub-array of vertices, with default render states
|
![]() |
Draw(Vertex, UInt32, UInt32, PrimitiveType, RenderStates) |
Draw primitives defined by a sub-array of vertices
|
![]() |
Equals |
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.) |
![]() |
Finalize |
Dispose the object
(Inherited from ObjectBase.) |
![]() |
GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
![]() |
GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
![]() |
GetView |
Return the current active view
|
![]() |
GetViewport |
Get the viewport of a view applied to this target
|
![]() |
HasFocus |
Check whether the window has the input focus
(Overrides WindowHasFocus.) |
![]() |
InternalGetMousePosition |
Internal function to get the mouse position relative to the window.
This function is public because it is called by another class,
it is not meant to be called by users.
(Overrides WindowInternalGetMousePosition.) |
![]() |
InternalGetTouchPosition |
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.
(Overrides WindowInternalGetTouchPosition(UInt32).) |
![]() |
InternalSetMousePosition |
Internal function to set the mouse position relative to the window.
This function is public because it is called by another class,
it is not meant to be called by users.
(Overrides WindowInternalSetMousePosition(Vector2i).) |
![]() |
MapCoordsToPixel(Vector2f) |
Convert a point from world coordinates to target
coordinates, using the current view
This function is an overload of the mapCoordsToPixel
function that implicitely uses the current view.
It is equivalent to:
target.MapCoordsToPixel(point, target.GetView());
|
![]() |
MapCoordsToPixel(Vector2f, View) |
Convert a point from world coordinates to target coordinates
This function finds the pixel of the render-target that matches
the given 2D point. In other words, it goes through the same process
as the graphics card, to compute the final position of a rendered point.
Initially, both coordinate systems (world units and target pixels)
match perfectly. But if you define a custom view or resize your
render-target, this assertion is not true anymore, ie. a point
located at (150, 75) in your 2D world may map to the pixel
(10, 50) of your render-target -- if the view is translated by (140, 25).
This version uses a custom view for calculations, see the other
overload of the function if you want to use the current view of the
render-target.
|
![]() |
MapPixelToCoords(Vector2i) |
Convert a point from target coordinates to world
coordinates, using the current view
This function is an overload of the MapPixelToCoords
function that implicitely uses the current view.
It is equivalent to:
target.MapPixelToCoords(point, target.GetView());
|
![]() |
MapPixelToCoords(Vector2i, View) |
Convert a point from target coordinates to world coordinates
This function finds the 2D position that matches the
given pixel of the render-target. In other words, it does
the inverse of what the graphics card does, to find the
initial position of a rendered pixel.
Initially, both coordinate systems (world units and target pixels)
match perfectly. But if you define a custom view or resize your
render-target, this assertion is not true anymore, ie. a point
located at (10, 50) in your render-target may map to the point
(150, 75) in your 2D world -- if the view is translated by (140, 25).
For render-windows, this function is typically used to find
which point (or object) is located below the mouse cursor.
This version uses a custom view for calculations, see the other
overload of the function if you want to use the current view of the
render-target.
|
![]() |
MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
![]() |
PollEvent |
Internal function to get the next event
(Overrides WindowPollEvent(Event).) |
![]() |
PopGLStates |
Restore the previously saved OpenGL render states and matrices.
See the description of PushGLStates to get a detailed
description of these functions.
|
![]() |
PushGLStates |
Save the current OpenGL render states and matrices.
This function can be used when you mix SFML drawing
and direct OpenGL rendering. Combined with PopGLStates,
it ensures that:
\li SFML's internal states are not messed up by your OpenGL code
\li your OpenGL states are not modified by a call to a SFML function
More specifically, it must be used around code that
calls Draw functions. Example:
// OpenGL code here...
window.PushGLStates();
window.Draw(...);
window.Draw(...);
window.PopGLStates();
// OpenGL code here...
Note that this function is quite expensive: it saves all the
possible OpenGL states and matrices, even the ones you
don't care about. Therefore it should be used wisely.
It is provided for convenience, but the best results will
be achieved if you handle OpenGL states yourself (because
you know which states have really changed, and need to be
saved and restored). Take a look at the ResetGLStates
function if you do so.
|
![]() |
RequestFocus |
Request the current window to be made the active
foreground window
(Overrides WindowRequestFocus.) |
![]() |
ResetGLStates |
Reset the internal OpenGL states so that the target is ready for drawing.
This function can be used when you mix SFML drawing
and direct OpenGL rendering, if you choose not to use
PushGLStates/PopGLStates. It makes sure that all OpenGL
states needed by SFML are set, so that subsequent Draw()
calls will work as expected.
Example:
// OpenGL code here...
glPushAttrib(...);
window.ResetGLStates();
window.Draw(...);
window.Draw(...);
glPopAttrib(...);
// OpenGL code here...
|
![]() |
SetActive |
Activate the window as the current target
for rendering
(Inherited from Window.) |
![]() |
SetActive(Boolean) |
Activate of deactivate the window as the current target
for rendering
(Overrides WindowSetActive(Boolean).) |
![]() |
SetFramerateLimit |
Limit the framerate to a maximum fixed frequency
(Overrides WindowSetFramerateLimit(UInt32).) |
![]() |
SetIcon |
Change the window's icon
(Overrides WindowSetIcon(UInt32, UInt32, Byte).) |
![]() |
SetJoystickThreshold |
Change the joystick threshold, ie. the value below which
no move event will be generated
(Overrides WindowSetJoystickThreshold(Single).) |
![]() |
SetKeyRepeatEnabled |
Enable or disable automatic key-repeat.
Automatic key-repeat is enabled by default
(Overrides WindowSetKeyRepeatEnabled(Boolean).) |
![]() |
SetMouseCursorVisible |
Show or hide the mouse cursor
(Overrides WindowSetMouseCursorVisible(Boolean).) |
![]() |
SetTitle |
Change the title of the window
(Overrides WindowSetTitle(String).) |
![]() |
SetVerticalSyncEnabled |
Enable / disable vertical synchronization
(Overrides WindowSetVerticalSyncEnabled(Boolean).) |
![]() |
SetView |
Change the current active view
|
![]() |
SetVisible |
Show or hide the window
(Overrides WindowSetVisible(Boolean).) |
![]() |
ToString |
Provide a string describing the object
(Overrides WindowToString.) |
![]() |
WaitAndDispatchEvents |
Wait for a new event and dispatch it to the corresponding
event handler
(Inherited from Window.) |
![]() |
WaitEvent |
Internal function to get the next event (blocking)
(Overrides WindowWaitEvent(Event).) |
