Window.h File Reference

#include <SFML/Config.h>
#include <SFML/Window/Event.h>
#include <SFML/Window/Input.h>
#include <SFML/Window/VideoMode.h>
#include <SFML/Window/WindowHandle.h>

Go to the source code of this file.


Typedefs

typedef sfWindow sfWindow
 sfWindow is a rendering window ; it can create a new window or connect to an existing one

Enumerations

enum  {
  sfNoStyle = 0,
  sfResize = 1 << 0,
  sfClose = 1 << 1,
  sfFullscreen = 1 << 2
}
 Enumeration of window creation styles. More...

Functions

CSFML_API sfWindowsfWindow_Create (sfVideoMode Mode, const char *Title, unsigned long Style, int AntialiasingLevel)
 Construct a new window.
CSFML_API sfWindowsfWindow_CreateFromHandle (sfWindowHandle Handle, int AntialiasingLevel)
 Construct a window from an existing control.
CSFML_API void sfWindow_Destroy (sfWindow *Window)
 Destroy an existing window.
CSFML_API unsigned int sfWindow_GetWidth (sfWindow *Window)
 Get the width of the rendering region of a window.
CSFML_API unsigned int sfWindow_GetHeight (sfWindow *Window)
 Get the height of the rendering region of a window.
CSFML_API unsigned int sfWindow_GetDepthBits (sfWindow *Window)
 Get the depth buffer bits of a window.
CSFML_API unsigned int sfWindow_GetStencilBits (sfWindow *Window)
 Get the stencil buffer bits of a window.
CSFML_API sfBool sfWindow_GetEvent (sfWindow *Window, sfEvent *Event)
 Get the event on top of events stack of a window, if any, and pop it.
CSFML_API void sfWindow_UseVerticalSync (sfWindow *Window, sfBool Enabled)
 Enable / disable vertical synchronization on a window.
CSFML_API void sfWindow_ShowMouseCursor (sfWindow *Window, sfBool Show)
 Show or hide the mouse cursor on a window.
CSFML_API void sfWindow_SetCursorPosition (sfWindow *Window, unsigned int Left, unsigned int Top)
 Change the position of the mouse cursor on a window.
CSFML_API void sfWindow_SetPosition (sfWindow *Window, int Left, int Top)
 Change the position of a window on screen.
CSFML_API void sfWindow_Show (sfWindow *Window, sfBool State)
 Show or hide a window.
CSFML_API sfBool sfWindow_SetCurrent (sfWindow *Window)
 Set a window as the current target for rendering.
CSFML_API void sfWindow_Display (sfWindow *Window)
 Display a window on screen.
CSFML_API sfInputsfWindow_GetInput (sfWindow *Window)
 Get the input manager of a window.
CSFML_API void sfWindow_SetFramerateLimit (sfWindow *Window, unsigned int Limit)
 Limit the framerate to a maximum fixed frequency for a window.
CSFML_API float sfWindow_GetFrameTime (sfWindow *Window)
 Get time elapsed since last frame of a window.
CSFML_API void sfWindow_SetJoystickThreshold (sfWindow *Window, float Threshold)
 Change the joystick threshold, ie.

Typedef Documentation

typedef struct sfWindow sfWindow

sfWindow is a rendering window ; it can create a new window or connect to an existing one

Definition at line 42 of file Window/Window.h.


Enumeration Type Documentation

anonymous enum

Enumeration of window creation styles.

Enumerator:
sfNoStyle  No style (this flag and all others are mutually exclusive).
sfResize  Window can be resized.
sfClose  Window can be closed.
sfFullscreen  Fullscreen mode (this flag and all others are mutually exclusive).

Definition at line 49 of file Window/Window.h.


Function Documentation

CSFML_API sfWindow* sfWindow_Create ( sfVideoMode  Mode,
const char *  Title,
unsigned long  Style,
int  AntialiasingLevel 
)

Construct a new window.

Parameters:
Mode : Video mode to use
Title : Title of the window
Style : Window style
AntialiasingLevel : Level of antialiasing

CSFML_API sfWindow* sfWindow_CreateFromHandle ( sfWindowHandle  Handle,
int  AntialiasingLevel 
)

Construct a window from an existing control.

Parameters:
Handle : Platform-specific handle of the control
AntialiasingLevel : Level of antialiasing

CSFML_API void sfWindow_Destroy ( sfWindow Window  ) 

Destroy an existing window.

Parameters:
Window : Window to destroy

CSFML_API void sfWindow_Display ( sfWindow Window  ) 

Display a window on screen.

Parameters:
Window : Window object

CSFML_API unsigned int sfWindow_GetDepthBits ( sfWindow Window  ) 

Get the depth buffer bits of a window.

Parameters:
Window : Window object
Returns:
Depth bits (can be 0 if there is no depth buffer)

CSFML_API sfBool sfWindow_GetEvent ( sfWindow Window,
sfEvent Event 
)

Get the event on top of events stack of a window, if any, and pop it.

Parameters:
Window : Window object
Event : Event to fill, if any
Returns:
sfTrue if an event was returned, sfFalse if events stack was empty

CSFML_API float sfWindow_GetFrameTime ( sfWindow Window  ) 

Get time elapsed since last frame of a window.

Parameters:
Window : Window object
Returns:
Time elapsed, in seconds

CSFML_API unsigned int sfWindow_GetHeight ( sfWindow Window  ) 

Get the height of the rendering region of a window.

Parameters:
Window : Window object
Returns:
Height in pixels

CSFML_API sfInput* sfWindow_GetInput ( sfWindow Window  ) 

Get the input manager of a window.

Parameters:
Window : Window object
Returns:
Reference to the input

CSFML_API unsigned int sfWindow_GetStencilBits ( sfWindow Window  ) 

Get the stencil buffer bits of a window.

Parameters:
Window : Window object
Returns:
Stencil bits (can be 0 if there is no stencil buffer)

CSFML_API unsigned int sfWindow_GetWidth ( sfWindow Window  ) 

Get the width of the rendering region of a window.

Parameters:
Window : Window object
Returns:
Width in pixels

CSFML_API sfBool sfWindow_SetCurrent ( sfWindow Window  ) 

Set a window as the current target for rendering.

Parameters:
Window : Window object
Returns:
True if operation was successful, false otherwise

CSFML_API void sfWindow_SetCursorPosition ( sfWindow Window,
unsigned int  Left,
unsigned int  Top 
)

Change the position of the mouse cursor on a window.

Parameters:
Window : Window object
Left : Left coordinate of the cursor, relative to the window
Top : Top coordinate of the cursor, relative to the window

CSFML_API void sfWindow_SetFramerateLimit ( sfWindow Window,
unsigned int  Limit 
)

Limit the framerate to a maximum fixed frequency for a window.

Parameters:
Window : Window object
Limit : Framerate limit, in frames per seconds (use 0 to disable limit)

CSFML_API void sfWindow_SetJoystickThreshold ( sfWindow Window,
float  Threshold 
)

Change the joystick threshold, ie.

the value below which no move event will be generated

Parameters:
Window : Window object
Threshold : New threshold, in range [0, 100]

CSFML_API void sfWindow_SetPosition ( sfWindow Window,
int  Left,
int  Top 
)

Change the position of a window on screen.

Only works for top-level windows

Parameters:
Window : Window object
Left : Left position
Top : Top position

CSFML_API void sfWindow_Show ( sfWindow Window,
sfBool  State 
)

Show or hide a window.

Parameters:
Window : Window object
State : sfTrue to show, sfFalse to hide

CSFML_API void sfWindow_ShowMouseCursor ( sfWindow Window,
sfBool  Show 
)

Show or hide the mouse cursor on a window.

Parameters:
Window : Window object
Show : sfTrue to show, sfFalse to hide

CSFML_API void sfWindow_UseVerticalSync ( sfWindow Window,
sfBool  Enabled 
)

Enable / disable vertical synchronization on a window.

Parameters:
Window : Window object
Enabled : sfTrue to enable v-sync, sfFalse to deactivate