CSFML 3.0.0
Loading...
Searching...
No Matches
RenderTexture.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2026 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
30#include <CSFML/Graphics/Export.h>
31
32#include <CSFML/Graphics/Color.h>
33#include <CSFML/Graphics/PrimitiveType.h>
34#include <CSFML/Graphics/Rect.h>
35#include <CSFML/Graphics/RenderStates.h>
36#include <CSFML/Graphics/StencilMode.h>
37#include <CSFML/Graphics/Types.h>
38#include <CSFML/Graphics/Vertex.h>
39#include <CSFML/System/Vector2.h>
40#include <CSFML/Window/Window.h>
41
42#include <stddef.h>
43
44
54 CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(sfVector2u size, const sfContextSettings* settings);
55
62 CSFML_GRAPHICS_API void sfRenderTexture_destroy(const sfRenderTexture* renderTexture);
63
72 CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture);
73
82 CSFML_GRAPHICS_API bool sfRenderTexture_isSrgb(const sfRenderTexture* renderTexture);
83
93 CSFML_GRAPHICS_API bool sfRenderTexture_setActive(sfRenderTexture* renderTexture, bool active);
94
101 CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture* renderTexture);
102
110 CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color);
111
122 CSFML_GRAPHICS_API void sfRenderTexture_clearStencil(sfRenderTexture* renderTexture, sfStencilValue stencilValue);
123
135 CSFML_GRAPHICS_API void sfRenderTexture_clearColorAndStencil(sfRenderTexture* renderTexture,
136 sfColor color,
137 sfStencilValue stencilValue);
138
146 CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view);
147
156 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture);
157
166 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture);
167
177 CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
178
193 CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getScissor(const sfRenderTexture* renderTexture, const sfView* view);
194
220 CSFML_GRAPHICS_API sfVector2f
221 sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
222
247 CSFML_GRAPHICS_API sfVector2i
248 sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
249
258 CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture,
259 const sfSprite* object,
260 const sfRenderStates* states);
261 CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture,
262 const sfText* object,
263 const sfRenderStates* states);
264 CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture,
265 const sfShape* object,
266 const sfRenderStates* states);
267 CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture,
268 const sfCircleShape* object,
269 const sfRenderStates* states);
270 CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture,
271 const sfConvexShape* object,
272 const sfRenderStates* states);
273 CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture,
274 const sfRectangleShape* object,
275 const sfRenderStates* states);
276 CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture,
277 const sfVertexArray* object,
278 const sfRenderStates* states);
279 CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture,
280 const sfVertexBuffer* object,
281 const sfRenderStates* states);
282
293 CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(
294 sfRenderTexture* renderTexture,
295 const sfVertexBuffer* object,
296 size_t firstVertex,
297 size_t vertexCount,
298 const sfRenderStates* states);
299
310 CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(
311 sfRenderTexture* renderTexture,
312 const sfVertex* vertices,
313 size_t vertexCount,
314 sfPrimitiveType type,
315 const sfRenderStates* states);
316
338 CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture);
339
349 CSFML_GRAPHICS_API void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture);
350
363 CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture);
364
373 CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
374
375
382 CSFML_GRAPHICS_API unsigned int sfRenderTexture_getMaximumAntiAliasingLevel(void);
383
391 CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, bool smooth);
392
401 CSFML_GRAPHICS_API bool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
402
410 CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, bool repeated);
411
420 CSFML_GRAPHICS_API bool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
421
436 CSFML_GRAPHICS_API bool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
Color.h
Export.h
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition Graphics/Export.h:42
Types.h
sfRenderTexture
struct sfRenderTexture sfRenderTexture
Definition Graphics/Types.h:34
sfCircleShape
struct sfCircleShape sfCircleShape
Definition Graphics/Types.h:28
sfVertexBuffer
struct sfVertexBuffer sfVertexBuffer
Definition Graphics/Types.h:42
sfTexture
struct sfTexture sfTexture
Definition Graphics/Types.h:39
sfShape
struct sfShape sfShape
Definition Graphics/Types.h:36
sfVertexArray
struct sfVertexArray sfVertexArray
Definition Graphics/Types.h:41
sfSprite
struct sfSprite sfSprite
Definition Graphics/Types.h:37
sfRectangleShape
struct sfRectangleShape sfRectangleShape
Definition Graphics/Types.h:33
sfText
struct sfText sfText
Definition Graphics/Types.h:38
sfConvexShape
struct sfConvexShape sfConvexShape
Definition Graphics/Types.h:29
sfView
struct sfView sfView
Definition Graphics/Types.h:43
PrimitiveType.h
sfPrimitiveType
sfPrimitiveType
Types of primitives that an sfVertexArray can render.
Definition PrimitiveType.h:42
Rect.h
RenderStates.h
sfRenderTexture_destroy
void sfRenderTexture_destroy(const sfRenderTexture *renderTexture)
Destroy an existing render texture.
sfRenderTexture_generateMipmap
bool sfRenderTexture_generateMipmap(sfRenderTexture *renderTexture)
Generate a mipmap using the current texture data.
sfRenderTexture_setSmooth
void sfRenderTexture_setSmooth(sfRenderTexture *renderTexture, bool smooth)
Enable or disable the smooth filter on a render texture.
sfRenderTexture_drawPrimitives
void sfRenderTexture_drawPrimitives(sfRenderTexture *renderTexture, const sfVertex *vertices, size_t vertexCount, sfPrimitiveType type, const sfRenderStates *states)
Draw primitives defined by an array of vertices to a render texture.
sfRenderTexture_create
sfRenderTexture * sfRenderTexture_create(sfVector2u size, const sfContextSettings *settings)
Construct a new render texture.
sfRenderTexture_mapPixelToCoords
sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture *renderTexture, sfVector2i point, const sfView *view)
Convert a point from texture coordinates to world coordinates.
sfRenderTexture_getMaximumAntiAliasingLevel
unsigned int sfRenderTexture_getMaximumAntiAliasingLevel(void)
Get the maximum anti-aliasing level supported by the system.
sfRenderTexture_drawVertexArray
void sfRenderTexture_drawVertexArray(sfRenderTexture *renderTexture, const sfVertexArray *object, const sfRenderStates *states)
sfRenderTexture_setView
void sfRenderTexture_setView(sfRenderTexture *renderTexture, const sfView *view)
Change the current active view of a render texture.
sfRenderTexture_drawRectangleShape
void sfRenderTexture_drawRectangleShape(sfRenderTexture *renderTexture, const sfRectangleShape *object, const sfRenderStates *states)
sfRenderTexture_drawShape
void sfRenderTexture_drawShape(sfRenderTexture *renderTexture, const sfShape *object, const sfRenderStates *states)
sfRenderTexture_getView
const sfView * sfRenderTexture_getView(const sfRenderTexture *renderTexture)
Get the current active view of a render texture.
sfRenderTexture_drawCircleShape
void sfRenderTexture_drawCircleShape(sfRenderTexture *renderTexture, const sfCircleShape *object, const sfRenderStates *states)
sfRenderTexture_drawVertexBuffer
void sfRenderTexture_drawVertexBuffer(sfRenderTexture *renderTexture, const sfVertexBuffer *object, const sfRenderStates *states)
sfRenderTexture_clearColorAndStencil
void sfRenderTexture_clearColorAndStencil(sfRenderTexture *renderTexture, sfColor color, sfStencilValue stencilValue)
Clear the entire target with a single color and stencil value.
sfRenderTexture_isRepeated
bool sfRenderTexture_isRepeated(const sfRenderTexture *renderTexture)
Tell whether the texture is repeated or not.
sfRenderTexture_drawConvexShape
void sfRenderTexture_drawConvexShape(sfRenderTexture *renderTexture, const sfConvexShape *object, const sfRenderStates *states)
sfRenderTexture_drawText
void sfRenderTexture_drawText(sfRenderTexture *renderTexture, const sfText *object, const sfRenderStates *states)
sfRenderTexture_display
void sfRenderTexture_display(sfRenderTexture *renderTexture)
Update the contents of the target texture.
sfRenderTexture_clear
void sfRenderTexture_clear(sfRenderTexture *renderTexture, sfColor color)
Clear the rendertexture with the given color.
sfRenderTexture_resetGLStates
void sfRenderTexture_resetGLStates(sfRenderTexture *renderTexture)
Reset the internal OpenGL states so that the target is ready for drawing.
sfRenderTexture_drawVertexBufferRange
void sfRenderTexture_drawVertexBufferRange(sfRenderTexture *renderTexture, const sfVertexBuffer *object, size_t firstVertex, size_t vertexCount, const sfRenderStates *states)
Draw primitives defined by a vertex buffer.
sfRenderTexture_getSize
sfVector2u sfRenderTexture_getSize(const sfRenderTexture *renderTexture)
Get the size of the rendering region of a render texture.
sfRenderTexture_setRepeated
void sfRenderTexture_setRepeated(sfRenderTexture *renderTexture, bool repeated)
Enable or disable texture repeating.
sfRenderTexture_drawSprite
void sfRenderTexture_drawSprite(sfRenderTexture *renderTexture, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
sfRenderTexture_mapCoordsToPixel
sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture *renderTexture, sfVector2f point, const sfView *view)
Convert a point from world coordinates to texture coordinates.
sfRenderTexture_isSrgb
bool sfRenderTexture_isSrgb(const sfRenderTexture *renderTexture)
Tell if the render texture will use sRGB encoding when drawing on it.
sfRenderTexture_clearStencil
void sfRenderTexture_clearStencil(sfRenderTexture *renderTexture, sfStencilValue stencilValue)
Clear the stencil buffer to a specific value.
sfRenderTexture_getDefaultView
const sfView * sfRenderTexture_getDefaultView(const sfRenderTexture *renderTexture)
Get the default view of a render texture.
sfRenderTexture_getTexture
const sfTexture * sfRenderTexture_getTexture(const sfRenderTexture *renderTexture)
Get the target texture of a render texture.
sfRenderTexture_getViewport
sfIntRect sfRenderTexture_getViewport(const sfRenderTexture *renderTexture, const sfView *view)
Get the viewport of a view applied to this target.
sfRenderTexture_isSmooth
bool sfRenderTexture_isSmooth(const sfRenderTexture *renderTexture)
Tell whether the smooth filter is enabled or not for a render texture.
sfRenderTexture_popGLStates
void sfRenderTexture_popGLStates(sfRenderTexture *renderTexture)
Restore the previously saved OpenGL render states and matrices.
sfRenderTexture_pushGLStates
void sfRenderTexture_pushGLStates(sfRenderTexture *renderTexture)
Save the current OpenGL render states and matrices.
sfRenderTexture_setActive
bool sfRenderTexture_setActive(sfRenderTexture *renderTexture, bool active)
Activate or deactivate a render texture as the current target for rendering.
sfRenderTexture_getScissor
sfIntRect sfRenderTexture_getScissor(const sfRenderTexture *renderTexture, const sfView *view)
Get the scissor rectangle of a view, applied to this render target.
StencilMode.h
Vector2.h
Vertex.h
Window.h
sfColor
Utility class for manpulating RGBA colors.
Definition Color.h:38
sfContextSettings
Structure defining the window's creation settings.
Definition Window/Window.h:58
sfIntRect
Definition Rect.h:46
sfRenderStates
Define the states used for drawing to a RenderTarget.
Definition RenderStates.h:44
sfStencilValue
Stencil value type (also used as a mask).
Definition StencilMode.h:74
sfVector2f
2-component vector of floats
Definition Vector2.h:60
sfVector2i
2-component vector of integers
Definition Vector2.h:38
sfVector2u
2-component vector of unsigned integers
Definition Vector2.h:49
sfVertex
Define a point with color and texture coordinates.
Definition Vertex.h:40