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#pragma once
26
28// Headers
31
34#include <CSFML/Graphics/Rect.h>
39#include <CSFML/System/Time.h>
41#include <CSFML/Window/Event.h>
43#include <CSFML/Window/Window.h>
45
46#include <stddef.h>
47
48
60 sfVideoMode mode,
61 const char* title,
62 uint32_t style,
63 sfWindowState state,
64 const sfContextSettings* settings);
65
77 sfVideoMode mode,
78 const sfChar32* title,
79 uint32_t style,
80 sfWindowState state,
81 const sfContextSettings* settings);
82
91
99
107
115
125
142
168
178
189
199
209
218
226CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
227
236
245CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, sfVector2u size, const uint8_t* pixels);
246
255
264
273
289
309
320
329
338
349
363
375
383
393
402
414
427
436
446
456
467
483
513 sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
514
540 sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
541
551 const sfSprite* object,
552 const sfRenderStates* states);
553CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
554CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
556 const sfCircleShape* object,
557 const sfRenderStates* states);
559 const sfConvexShape* object,
560 const sfRenderStates* states);
562 const sfRectangleShape* object,
563 const sfRenderStates* states);
565 const sfVertexArray* object,
566 const sfRenderStates* states);
568 const sfVertexBuffer* object,
569 const sfRenderStates* states);
570
582 sfRenderWindow* renderWindow,
583 const sfVertexBuffer* object,
584 size_t firstVertex,
585 size_t vertexCount,
586 const sfRenderStates* states);
587
599 sfRenderWindow* renderWindow,
600 const sfVertex* vertices,
601 size_t vertexCount,
602 sfPrimitiveType type,
603 const sfRenderStates* states);
604
627
638
652
665
677
691
704 sfRenderWindow* renderWindow,
705 const VkInstance* instance,
706 VkSurfaceKHR* surface,
707 const VkAllocationCallbacks* allocator);
uint32_t sfChar32
Define sfChar32.
Definition Config.h:161
#define CSFML_GRAPHICS_API
struct sfRenderWindow sfRenderWindow
struct sfCircleShape sfCircleShape
struct sfVertexBuffer sfVertexBuffer
struct sfShape sfShape
struct sfVertexArray sfVertexArray
struct sfSprite sfSprite
struct sfRectangleShape sfRectangleShape
struct sfText sfText
struct sfConvexShape sfConvexShape
struct sfView sfView
sfPrimitiveType
Types of primitives that an sfVertexArray can render.
void sfRenderWindow_resetGLStates(sfRenderWindow *renderWindow)
Reset the internal OpenGL states so that the target is ready for drawing.
bool sfRenderWindow_pollEvent(sfRenderWindow *renderWindow, sfEvent *event)
Pop the event on top of event queue, if any, and return it.
sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow *renderWindow)
Get the creation settings of a render window.
bool sfRenderWindow_waitEvent(sfRenderWindow *renderWindow, sfTime timeout, sfEvent *event)
Wait for an event and return it.
const sfView * sfRenderWindow_getDefaultView(const sfRenderWindow *renderWindow)
Get the default view of a render window.
void sfRenderWindow_setFramerateLimit(sfRenderWindow *renderWindow, unsigned int limit)
Limit the framerate to a maximum fixed frequency for a render window.
void sfRenderWindow_drawVertexBuffer(sfRenderWindow *renderWindow, const sfVertexBuffer *object, const sfRenderStates *states)
void sfRenderWindow_setSize(sfRenderWindow *renderWindow, sfVector2u size)
Change the size of the rendering region of a render window.
void sfRenderWindow_setMouseCursor(sfRenderWindow *renderWindow, const sfCursor *cursor)
Set the displayed cursor to a native system cursor.
void sfRenderWindow_clearColorAndStencil(sfRenderWindow *renderWindow, sfColor color, sfStencilValue stencilValue)
Clear the entire target with a single color and stencil value.
void sfRenderWindow_setJoystickThreshold(sfRenderWindow *renderWindow, float threshold)
Change the joystick threshold, ie.
void sfRenderWindow_display(sfRenderWindow *renderWindow)
Display a render window on screen.
sfIntRect sfRenderWindow_getViewport(const sfRenderWindow *renderWindow, const sfView *view)
Get the viewport of a view applied to this target.
bool sfRenderWindow_isOpen(const sfRenderWindow *renderWindow)
Tell whether or not a render window is opened.
const sfView * sfRenderWindow_getView(const sfRenderWindow *renderWindow)
Get the current active view of a render window.
sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWindow *relativeTo)
Get the current position of a touch in window coordinates.
bool sfRenderWindow_hasFocus(const sfRenderWindow *renderWindow)
Check whether the render window has the input focus.
sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow *relativeTo)
Get the current position of the mouse relative to a render-window.
void sfRenderWindow_clear(sfRenderWindow *renderWindow, sfColor color)
Clear a render window with the given color.
bool sfRenderWindow_isSrgb(const sfRenderWindow *renderWindow)
Tell if the render window will use sRGB encoding when drawing on it.
void sfRenderWindow_setMouseCursorVisible(sfRenderWindow *renderWindow, bool show)
Show or hide the mouse cursor on a render window.
void sfRenderWindow_drawVertexArray(sfRenderWindow *renderWindow, const sfVertexArray *object, const sfRenderStates *states)
void sfRenderWindow_pushGLStates(sfRenderWindow *renderWindow)
Save the current OpenGL render states and matrices.
void sfRenderWindow_drawShape(sfRenderWindow *renderWindow, const sfShape *object, const sfRenderStates *states)
sfWindowHandle sfRenderWindow_getNativeHandle(const sfRenderWindow *renderWindow)
Retrieve the OS-specific handle of a render window.
sfRenderWindow * sfRenderWindow_createUnicode(sfVideoMode mode, const sfChar32 *title, uint32_t style, sfWindowState state, const sfContextSettings *settings)
Construct a new render window (with a UTF-32 title)
bool sfRenderWindow_createVulkanSurface(sfRenderWindow *renderWindow, const VkInstance *instance, VkSurfaceKHR *surface, const VkAllocationCallbacks *allocator)
Create a Vulkan rendering surface.
void sfRenderWindow_setUnicodeTitle(sfRenderWindow *renderWindow, const sfChar32 *title)
Change the title of a render window (with a UTF-32 string)
sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow *renderWindow, sfVector2f point, const sfView *view)
Convert a point from world coordinates to window coordinates.
sfIntRect sfRenderWindow_getScissor(const sfRenderWindow *renderWindow, const sfView *view)
Get the scissor rectangle of a view, applied to this render target.
sfRenderWindow * sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings *settings)
Construct a render window from an existing control.
void sfRenderWindow_drawSprite(sfRenderWindow *renderWindow, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
void sfRenderWindow_destroy(const sfRenderWindow *renderWindow)
Destroy an existing render window.
void sfRenderWindow_drawCircleShape(sfRenderWindow *renderWindow, const sfCircleShape *object, const sfRenderStates *states)
sfRenderWindow * sfRenderWindow_create(sfVideoMode mode, const char *title, uint32_t style, sfWindowState state, const sfContextSettings *settings)
Construct a new render window.
void sfRenderWindow_clearStencil(sfRenderWindow *renderWindow, sfStencilValue stencilValue)
Clear the stencil buffer to a specific value.
void sfRenderWindow_setView(sfRenderWindow *renderWindow, const sfView *view)
Change the current active view of a render window.
void sfRenderWindow_setTitle(sfRenderWindow *renderWindow, const char *title)
Change the title of a render window.
void sfRenderWindow_requestFocus(sfRenderWindow *renderWindow)
Request the current render window to be made the active foreground window.
void sfRenderWindow_drawConvexShape(sfRenderWindow *renderWindow, const sfConvexShape *object, const sfRenderStates *states)
void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow *relativeTo)
Set the current position of the mouse relative to a render window.
void sfRenderWindow_drawText(sfRenderWindow *renderWindow, const sfText *object, const sfRenderStates *states)
void sfRenderWindow_setPosition(sfRenderWindow *renderWindow, sfVector2i position)
Change the position of a render window on screen.
void sfRenderWindow_setVisible(sfRenderWindow *renderWindow, bool visible)
Show or hide a render window.
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.
bool sfRenderWindow_setActive(sfRenderWindow *renderWindow, bool active)
Activate or deactivate a render window as the current target for rendering.
void sfRenderWindow_close(sfRenderWindow *renderWindow)
Close a render window (but doesn't destroy the internal data)
void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow *renderWindow, bool enabled)
Enable / disable vertical synchronization on a render window.
void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow *renderWindow, bool grabbed)
Grab or release the mouse cursor.
void sfRenderWindow_drawVertexBufferRange(sfRenderWindow *renderWindow, const sfVertexBuffer *object, size_t firstVertex, size_t vertexCount, const sfRenderStates *states)
Draw primitives defined by a vertex buffer.
sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow *renderWindow, sfVector2i point, const sfView *view)
Convert a point from window coordinates to world coordinates.
void sfRenderWindow_drawRectangleShape(sfRenderWindow *renderWindow, const sfRectangleShape *object, const sfRenderStates *states)
void sfRenderWindow_popGLStates(sfRenderWindow *renderWindow)
Restore the previously saved OpenGL render states and matrices.
void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow *renderWindow, bool enabled)
Enable or disable automatic key-repeat for keydown events.
sfVector2i sfRenderWindow_getPosition(const sfRenderWindow *renderWindow)
Get the position of a render window.
sfVector2u sfRenderWindow_getSize(const sfRenderWindow *renderWindow)
Get the size of the rendering region of a render window.
void sfRenderWindow_setIcon(sfRenderWindow *renderWindow, sfVector2u size, const uint8_t *pixels)
Change a render window's icon.
uint64_t VkSurfaceKHR
Definition Vulkan.h:42
struct VkInstance_T * VkInstance
Definition Vulkan.h:33
struct VkAllocationCallbacks VkAllocationCallbacks
Definition Vulkan.h:46
sfWindowState
Enumeration of the window states.
Definition WindowBase.h:61
struct sfCursor sfCursor
Utility class for manpulating RGBA colors.
Definition Color.h:38
Structure defining the window's creation settings.
Define the states used for drawing to a RenderTarget.
Stencil value type (also used as a mask)
Definition StencilMode.h:74
Represents a time value.
Definition Time.h:38
2-component vector of floats
Definition Vector2.h:60
2-component vector of integers
Definition Vector2.h:38
2-component vector of unsigned integers
Definition Vector2.h:49
Define a point with color and texture coordinates.
Definition Vertex.h:40
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition VideoMode.h:44
sfEvent defines a system event and its parameters
Definition Event.h:210