CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

RenderWindow.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RENDERWINDOW_H
26 #define SFML_RENDERWINDOW_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/Graphics/PrimitiveType.h>
36 #include <SFML/Graphics/RenderStates.h>
37 #include <SFML/Graphics/Vertex.h>
38 #include <SFML/Window/Event.h>
39 #include <SFML/Window/VideoMode.h>
40 #include <SFML/Window/WindowHandle.h>
41 #include <SFML/Window/Window.h>
42 #include <SFML/System/Vector2.h>
43
44
54 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
55
65 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
66
74 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
75
82 CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
83
90 CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow);
91
98 CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
99
108 CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
109
119 CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
120
130 CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
131
140 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow);
141
151 CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position);
152
161 CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow);
162
170 CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size);
171
179 CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
180
188 CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title);
189
199 CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
200
208 CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
209
217 CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
218
226 CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
227
237 CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
238
248 CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
249
256 CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
257
265 CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
266
274 CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
275
284 CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow);
285
293 CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color);
294
302 CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view);
303
312 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow);
313
322 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow);
323
333 CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
334
363 CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
364
389 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
390
399 CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
400 CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
401 CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
402 CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
403 CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
404 CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
405 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
406
417 CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
418 const sfVertex* vertices, unsigned int vertexCount,
419 sfPrimitiveType type, const sfRenderStates* states);
420
442 CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow);
443
453 CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow);
454
467 CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
468
485 CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
486
498 CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo);
499
510 CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo);
511
512
513 #endif // SFML_RENDERWINDOW_H
sfRenderWindow_popGLStates
CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow *renderWindow)
Restore the previously saved OpenGL render states and matrices.
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition: Graphics/Export.h:43
sfRenderWindow_setActive
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow *renderWindow, sfBool active)
Activate or deactivate a render window as the current target for rendering.
sfPrimitiveType
sfPrimitiveType
Types of primitives that a sf::VertexArray can render.
Definition: PrimitiveType.h:42
sfMouse_setPositionRenderWindow
CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow *relativeTo)
Set the current position of the mouse relatively to a render-window.
sfIntRect
Definition: Rect.h:46
sfRenderWindow_isOpen
CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow *renderWindow)
Tell whether or not a render window is opened.
sfRenderWindow_createFromHandle
CSFML_GRAPHICS_API sfRenderWindow * sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings *settings)
Construct a render window from an existing control.
sfRenderWindow_drawPrimitives
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow *renderWindow, const sfVertex *vertices, unsigned int vertexCount, sfPrimitiveType type, const sfRenderStates *states)
Draw primitives defined by an array of vertices to a render window.
sfConvexShape
struct sfConvexShape sfConvexShape
Definition: Graphics/Types.h:30
sfVertexArray
struct sfVertexArray sfVertexArray
Definition: Graphics/Types.h:42
sfRenderWindow_drawCircleShape
CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow *renderWindow, const sfCircleShape *object, const sfRenderStates *states)
sfRenderWindow_close
CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow *renderWindow)
Close a render window (but doesn't destroy the internal data)
sfRenderWindow_drawText
CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow *renderWindow, const sfText *object, const sfRenderStates *states)
Export.h
Vertex.h
Window.h
sfRenderWindow_create
CSFML_GRAPHICS_API sfRenderWindow * sfRenderWindow_create(sfVideoMode mode, const char *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window.
sfRenderWindow_drawRectangleShape
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow *renderWindow, const sfRectangleShape *object, const sfRenderStates *states)
sfRenderWindow_drawShape
CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow *renderWindow, const sfShape *object, const sfRenderStates *states)
sfRenderWindow_setVisible
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow *renderWindow, sfBool visible)
Show or hide a render window.
sfRenderWindow_setTitle
CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow *renderWindow, const char *title)
Change the title of a render window.
sfRenderWindow_getSize
CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow *renderWindow)
Get the size of the rendering region of a render window.
PrimitiveType.h
sfRenderWindow_setPosition
CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow *renderWindow, sfVector2i position)
Change the position of a render window on screen.
sfRenderWindow_getViewport
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow *renderWindow, const sfView *view)
Get the viewport of a view applied to this target.
sfRenderWindow_mapCoordsToPixel
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow *renderWindow, sfVector2f point, const sfView *view)
Convert a point from world coordinates to window coordinates.
sfRenderWindow_mapPixelToCoords
CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow *renderWindow, sfVector2i point, const sfView *view)
Convert a point from window coordinates to world coordinates.
sfRenderWindow_setJoystickThreshold
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow *renderWindow, float threshold)
Change the joystick threshold, ie.
sfRenderWindow_setFramerateLimit
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow *renderWindow, unsigned int limit)
Limit the framerate to a maximum fixed frequency for a render window.
sfBool
int sfBool
Definition: Config.h:106
sfRenderWindow_setView
CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow *renderWindow, const sfView *view)
Change the current active view of a render window.
sfRenderWindow_destroy
CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow *renderWindow)
Destroy an existing render window.
sfVector2i
2-component vector of integers
Definition: Vector2.h:38
sfEvent
sfEvent defines a system event and its parameters
Definition: Event.h:171
sfVector2u
2-component vector of unsigned integers
Definition: Vector2.h:49
sfRenderWindow
struct sfRenderWindow sfRenderWindow
Definition: Graphics/Types.h:36
sfColor
Utility class for manpulating RGBA colors.
Definition: Color.h:38
Vector2.h
sfRenderWindow_setIcon
CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow *renderWindow, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a render window's icon.
sfSprite
struct sfSprite sfSprite
Definition: Graphics/Types.h:38
sfRenderStates
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:41
sfRenderWindow_getSystemHandle
CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow *renderWindow)
Retrieve the OS-specific handle of a render window.
sfView
struct sfView sfView
Definition: Graphics/Types.h:43
sfImage
struct sfImage sfImage
Definition: Graphics/Types.h:32
sfRectangleShape
struct sfRectangleShape sfRectangleShape
Definition: Graphics/Types.h:34
sfUint32
unsigned int sfUint32
Definition: Config.h:129
sfRenderWindow_display
CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow *renderWindow)
Display a render window on screen.
sfRenderWindow_capture
CSFML_GRAPHICS_API sfImage * sfRenderWindow_capture(const sfRenderWindow *renderWindow)
Copy the current contents of a render window to an image.
WindowHandle.h
sfCircleShape
struct sfCircleShape sfCircleShape
Definition: Graphics/Types.h:29
sfText
struct sfText sfText
Definition: Graphics/Types.h:39
sfRenderWindow_pushGLStates
CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates(sfRenderWindow *renderWindow)
Save the current OpenGL render states and matrices.
sfRenderWindow_setMouseCursorVisible
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow *renderWindow, sfBool show)
Show or hide the mouse cursor on a render window.
Types.h
Color.h
sfRenderWindow_setUnicodeTitle
CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow *renderWindow, const sfUint32 *title)
Change the title of a render window (with a UTF-32 string)
sfRenderWindow_getDefaultView
CSFML_GRAPHICS_API const sfView * sfRenderWindow_getDefaultView(const sfRenderWindow *renderWindow)
Get the default view of a render window.
sfVideoMode
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition: VideoMode.h:40
sfRenderWindow_clear
CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow *renderWindow, sfColor color)
Clear a render window with the given color.
sfRenderWindow_getPosition
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow *renderWindow)
Get the position of a render window.
VideoMode.h
sfRenderWindow_setVerticalSyncEnabled
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow *renderWindow, sfBool enabled)
Enable / disable vertical synchronization on a render window.
sfRenderWindow_drawVertexArray
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow *renderWindow, const sfVertexArray *object, const sfRenderStates *states)
sfRenderWindow_drawConvexShape
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow *renderWindow, const sfConvexShape *object, const sfRenderStates *states)
sfRenderWindow_getSettings
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow *renderWindow)
Get the creation settings of a render window.
sfVector2f
2-component vector of floats
Definition: Vector2.h:60
RenderStates.h
sfShape
struct sfShape sfShape
Definition: Graphics/Types.h:37
sfRenderWindow_resetGLStates
CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow *renderWindow)
Reset the internal OpenGL states so that the target is ready for drawing.
sfRenderWindow_setSize
CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow *renderWindow, sfVector2u size)
Change the size of the rendering region of a render window.
sfUint8
unsigned char sfUint8
Definition: Config.h:121
sfRenderWindow_pollEvent
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow *renderWindow, sfEvent *event)
Get the event on top of event queue of a render window, if any, and pop it.
sfRenderWindow_setKeyRepeatEnabled
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow *renderWindow, sfBool enabled)
Enable or disable automatic key-repeat for keydown events.
Rect.h
sfMouse_getPositionRenderWindow
CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow *relativeTo)
Get the current position of the mouse relatively to a render-window.
Event.h
sfRenderWindow_waitEvent
CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow *renderWindow, sfEvent *event)
Wait for an event and return it.
sfRenderWindow_createUnicode
CSFML_GRAPHICS_API sfRenderWindow * sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32 *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window (with a UTF-32 title)
sfRenderWindow_drawSprite
CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow *renderWindow, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
sfVertex
Define a point with color and texture coordinates.
Definition: Vertex.h:39
sfRenderWindow_getView
CSFML_GRAPHICS_API const sfView * sfRenderWindow_getView(const sfRenderWindow *renderWindow)
Get the current active view of a render window.
sfContextSettings
Structure defining the window's creation settings.
Definition: Window/Window.h:58