CSFML 2.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
RenderWindow.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org)
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#include <stddef.h>
44
45
55 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
56
66 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
67
75 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
76
83 CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
84
91 CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow);
92
99 CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
100
109 CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
110
120 CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
121
131 CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
132
141 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow);
142
152 CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position);
153
162 CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow);
163
172 CSFML_GRAPHICS_API sfBool sfRenderWindow_isSrgb(const sfRenderWindow* renderWindow);
173
181 CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size);
182
190 CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
191
199 CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title);
200
210 CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
211
219 CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
220
228 CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
229
237 CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
238
252 CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed);
253
271 CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursor(sfRenderWindow* window, const sfCursor* cursor);
272
282 CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
283
291 CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
292
300 CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
301
311 CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
312
325 CSFML_GRAPHICS_API void sfRenderWindow_requestFocus(sfRenderWindow* renderWindow);
326
337 CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow);
338
345 CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
346
355 CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow);
356
364 CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color);
365
373 CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view);
374
383 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow);
384
393 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow);
394
404 CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
405
434 CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
435
460 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
461
470 CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
471 CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
472 CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
473 CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
474 CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
475 CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
476 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
477 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states);
478
489 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow,
490 const sfVertexBuffer* object, size_t firstVertex,
491 size_t vertexCount, const sfRenderStates* states);
492
503 CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
504 const sfVertex* vertices, size_t vertexCount,
505 sfPrimitiveType type, const sfRenderStates* states);
506
528 CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow);
529
539 CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow);
540
553 CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
554
580 CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
581
593 CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo);
594
605 CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo);
606
619 CSFML_GRAPHICS_API sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow* relativeTo);
620
632 CSFML_GRAPHICS_API sfBool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
633
634
635#endif // SFML_RENDERWINDOW_H
Color.h
sfUint32
unsigned int sfUint32
Definition Config.h:176
sfBool
int sfBool
Definition Config.h:153
sfUint8
unsigned char sfUint8
Definition Config.h:168
CSFML_DEPRECATED
#define CSFML_DEPRECATED
Definition Config.h:146
Event.h
Export.h
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition Graphics/Export.h:43
Types.h
sfRenderWindow
struct sfRenderWindow sfRenderWindow
Definition Graphics/Types.h:36
sfCircleShape
struct sfCircleShape sfCircleShape
Definition Graphics/Types.h:29
sfImage
struct sfImage sfImage
Definition Graphics/Types.h:32
sfVertexBuffer
struct sfVertexBuffer sfVertexBuffer
Definition Graphics/Types.h:43
sfShape
struct sfShape sfShape
Definition Graphics/Types.h:37
sfVertexArray
struct sfVertexArray sfVertexArray
Definition Graphics/Types.h:42
sfSprite
struct sfSprite sfSprite
Definition Graphics/Types.h:38
sfRectangleShape
struct sfRectangleShape sfRectangleShape
Definition Graphics/Types.h:34
sfText
struct sfText sfText
Definition Graphics/Types.h:39
sfConvexShape
struct sfConvexShape sfConvexShape
Definition Graphics/Types.h:30
sfView
struct sfView sfView
Definition Graphics/Types.h:44
PrimitiveType.h
sfPrimitiveType
sfPrimitiveType
Types of primitives that a sf::VertexArray can render.
Definition PrimitiveType.h:43
Rect.h
RenderStates.h
sfRenderWindow_pollEvent
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_resetGLStates
void sfRenderWindow_resetGLStates(sfRenderWindow *renderWindow)
Reset the internal OpenGL states so that the target is ready for drawing.
sfRenderWindow_getSettings
sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow *renderWindow)
Get the creation settings of a render window.
sfRenderWindow_isSrgb
sfBool sfRenderWindow_isSrgb(const sfRenderWindow *renderWindow)
Tell if the render window will use sRGB encoding when drawing on it.
sfRenderWindow_setVerticalSyncEnabled
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow *renderWindow, sfBool enabled)
Enable / disable vertical synchronization on a render window.
sfRenderWindow_setActive
sfBool sfRenderWindow_setActive(sfRenderWindow *renderWindow, sfBool active)
Activate or deactivate a render window as the current target for rendering.
sfRenderWindow_getDefaultView
const sfView * sfRenderWindow_getDefaultView(const sfRenderWindow *renderWindow)
Get the default view of a render window.
sfRenderWindow_setFramerateLimit
void sfRenderWindow_setFramerateLimit(sfRenderWindow *renderWindow, unsigned int limit)
Limit the framerate to a maximum fixed frequency for a render window.
sfRenderWindow_setVisible
void sfRenderWindow_setVisible(sfRenderWindow *renderWindow, sfBool visible)
Show or hide a render window.
sfRenderWindow_drawVertexBuffer
void sfRenderWindow_drawVertexBuffer(sfRenderWindow *renderWindow, const sfVertexBuffer *object, const sfRenderStates *states)
sfRenderWindow_setMouseCursorVisible
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow *renderWindow, sfBool show)
Show or hide the mouse cursor on a render window.
sfRenderWindow_setSize
void sfRenderWindow_setSize(sfRenderWindow *renderWindow, sfVector2u size)
Change the size of the rendering region of a render window.
sfRenderWindow_capture
sfImage * sfRenderWindow_capture(const sfRenderWindow *renderWindow)
Copy the current contents of the window to an image.
sfRenderWindow_setJoystickThreshold
void sfRenderWindow_setJoystickThreshold(sfRenderWindow *renderWindow, float threshold)
Change the joystick threshold, ie.
sfRenderWindow_display
void sfRenderWindow_display(sfRenderWindow *renderWindow)
Display a render window on screen.
sfRenderWindow_waitEvent
sfBool sfRenderWindow_waitEvent(sfRenderWindow *renderWindow, sfEvent *event)
Wait for an event and return it.
sfRenderWindow_getViewport
sfIntRect sfRenderWindow_getViewport(const sfRenderWindow *renderWindow, const sfView *view)
Get the viewport of a view applied to this target.
sfRenderWindow_getView
const sfView * sfRenderWindow_getView(const sfRenderWindow *renderWindow)
Get the current active view of a render window.
sfTouch_getPositionRenderWindow
sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow *relativeTo)
Get the current position of a touch in window coordinates.
sfMouse_getPositionRenderWindow
sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow *relativeTo)
Get the current position of the mouse relative to a render-window.
sfRenderWindow_clear
void sfRenderWindow_clear(sfRenderWindow *renderWindow, sfColor color)
Clear a render window with the given color.
sfRenderWindow_getSystemHandle
sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow *renderWindow)
Retrieve the OS-specific handle of a render window.
sfRenderWindow_setMouseCursor
void sfRenderWindow_setMouseCursor(sfRenderWindow *window, const sfCursor *cursor)
Set the displayed cursor to a native system cursor.
sfRenderWindow_drawVertexArray
void sfRenderWindow_drawVertexArray(sfRenderWindow *renderWindow, const sfVertexArray *object, const sfRenderStates *states)
sfRenderWindow_pushGLStates
void sfRenderWindow_pushGLStates(sfRenderWindow *renderWindow)
Save the current OpenGL render states and matrices.
sfRenderWindow_drawShape
void sfRenderWindow_drawShape(sfRenderWindow *renderWindow, const sfShape *object, const sfRenderStates *states)
sfRenderWindow_mapCoordsToPixel
sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow *renderWindow, sfVector2f point, const sfView *view)
Convert a point from world coordinates to window coordinates.
sfRenderWindow_setKeyRepeatEnabled
void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow *renderWindow, sfBool enabled)
Enable or disable automatic key-repeat for keydown events.
sfRenderWindow_createFromHandle
sfRenderWindow * sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings *settings)
Construct a render window from an existing control.
sfRenderWindow_drawSprite
void sfRenderWindow_drawSprite(sfRenderWindow *renderWindow, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
sfRenderWindow_drawCircleShape
void sfRenderWindow_drawCircleShape(sfRenderWindow *renderWindow, const sfCircleShape *object, const sfRenderStates *states)
sfRenderWindow_setUnicodeTitle
void sfRenderWindow_setUnicodeTitle(sfRenderWindow *renderWindow, const sfUint32 *title)
Change the title of a render window (with a UTF-32 string)
sfRenderWindow_isOpen
sfBool sfRenderWindow_isOpen(const sfRenderWindow *renderWindow)
Tell whether or not a render window is opened.
sfRenderWindow_setView
void sfRenderWindow_setView(sfRenderWindow *renderWindow, const sfView *view)
Change the current active view of a render window.
sfRenderWindow_setTitle
void sfRenderWindow_setTitle(sfRenderWindow *renderWindow, const char *title)
Change the title of a render window.
sfRenderWindow_requestFocus
void sfRenderWindow_requestFocus(sfRenderWindow *renderWindow)
Request the current render window to be made the active foreground window.
sfRenderWindow_drawConvexShape
void sfRenderWindow_drawConvexShape(sfRenderWindow *renderWindow, const sfConvexShape *object, const sfRenderStates *states)
sfMouse_setPositionRenderWindow
void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow *relativeTo)
Set the current position of the mouse relative to a render window.
sfRenderWindow_drawText
void sfRenderWindow_drawText(sfRenderWindow *renderWindow, const sfText *object, const sfRenderStates *states)
sfRenderWindow_setPosition
void sfRenderWindow_setPosition(sfRenderWindow *renderWindow, sfVector2i position)
Change the position of a render window on screen.
sfRenderWindow_hasFocus
sfBool sfRenderWindow_hasFocus(const sfRenderWindow *renderWindow)
Check whether the render window has the input focus.
sfRenderWindow_drawPrimitives
void sfRenderWindow_drawPrimitives(sfRenderWindow *renderWindow, const sfVertex *vertices, size_t vertexCount, sfPrimitiveType type, const sfRenderStates *states)
Draw primitives defined by an array of vertices to a render window.
sfRenderWindow_close
void sfRenderWindow_close(sfRenderWindow *renderWindow)
Close a render window (but doesn't destroy the internal data)
sfRenderWindow_drawVertexBufferRange
void sfRenderWindow_drawVertexBufferRange(sfRenderWindow *renderWindow, const sfVertexBuffer *object, size_t firstVertex, size_t vertexCount, const sfRenderStates *states)
Draw primitives defined by a vertex buffer.
sfRenderWindow_mapPixelToCoords
sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow *renderWindow, sfVector2i point, const sfView *view)
Convert a point from window coordinates to world coordinates.
sfRenderWindow_drawRectangleShape
void sfRenderWindow_drawRectangleShape(sfRenderWindow *renderWindow, const sfRectangleShape *object, const sfRenderStates *states)
sfRenderWindow_popGLStates
void sfRenderWindow_popGLStates(sfRenderWindow *renderWindow)
Restore the previously saved OpenGL render states and matrices.
sfRenderWindow_createUnicode
sfRenderWindow * sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32 *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window (with a UTF-32 title)
sfRenderWindow_setMouseCursorGrabbed
void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow *renderWindow, sfBool grabbed)
Grab or release the mouse cursor.
sfRenderWindow_create
sfRenderWindow * sfRenderWindow_create(sfVideoMode mode, const char *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window.
sfRenderWindow_getPosition
sfVector2i sfRenderWindow_getPosition(const sfRenderWindow *renderWindow)
Get the position of a render window.
sfRenderWindow_setIcon
void sfRenderWindow_setIcon(sfRenderWindow *renderWindow, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a render window's icon.
sfRenderWindow_destroy
void sfRenderWindow_destroy(sfRenderWindow *renderWindow)
Destroy an existing render window.
sfRenderWindow_getSize
sfVector2u sfRenderWindow_getSize(const sfRenderWindow *renderWindow)
Get the size of the rendering region of a render window.
sfRenderWindow_createVulkanSurface
sfBool sfRenderWindow_createVulkanSurface(sfRenderWindow *renderWindow, const VkInstance *instance, VkSurfaceKHR *surface, const VkAllocationCallbacks *allocator)
Create a Vulkan rendering surface.
Vector2.h
Vertex.h
VideoMode.h
VkInstance
struct VkInstance_T * VkInstance
Definition Vulkan.h:32
VkAllocationCallbacks
struct VkAllocationCallbacks VkAllocationCallbacks
Definition Vulkan.h:44
VkSurfaceKHR
sfUint64 VkSurfaceKHR
Definition Vulkan.h:40
WindowHandle.h
sfCursor
struct sfCursor sfCursor
Definition Window/Types.h:30
Window.h
sfColor
Utility class for manpulating RGBA colors.
Definition Color.h:39
sfContextSettings
Structure defining the window's creation settings.
Definition Window/Window.h:57
sfIntRect
Definition Rect.h:49
sfRenderStates
Define the states used for drawing to a RenderTarget.
Definition RenderStates.h:42
sfVector2f
2-component vector of floats
Definition Vector2.h:61
sfVector2i
2-component vector of integers
Definition Vector2.h:39
sfVector2u
2-component vector of unsigned integers
Definition Vector2.h:50
sfVertex
Define a point with color and texture coordinates.
Definition Vertex.h:40
sfVideoMode
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition VideoMode.h:42
sfEvent
sfEvent defines a system event and its parameters
Definition Event.h:222