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-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>
40#include <CSFML/Window/Window.h>
41
42#include <stddef.h>
43
44
55
63
73
83
94
102
111
123
136 sfColor color,
137 sfStencilValue stencilValue);
138
147
157
167
178
194
221 sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
222
248 sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
249
259 const sfSprite* object,
260 const sfRenderStates* states);
262 const sfText* object,
263 const sfRenderStates* states);
265 const sfShape* object,
266 const sfRenderStates* states);
268 const sfCircleShape* object,
269 const sfRenderStates* states);
271 const sfConvexShape* object,
272 const sfRenderStates* states);
274 const sfRectangleShape* object,
275 const sfRenderStates* states);
277 const sfVertexArray* object,
278 const sfRenderStates* states);
280 const sfVertexBuffer* object,
281 const sfRenderStates* states);
282
294 sfRenderTexture* renderTexture,
295 const sfVertexBuffer* object,
296 size_t firstVertex,
297 size_t vertexCount,
298 const sfRenderStates* states);
299
311 sfRenderTexture* renderTexture,
312 const sfVertex* vertices,
313 size_t vertexCount,
314 sfPrimitiveType type,
315 const sfRenderStates* states);
316
339
350
364
374
375
383
392
402
411
421
#define CSFML_GRAPHICS_API
struct sfRenderTexture sfRenderTexture
struct sfCircleShape sfCircleShape
struct sfVertexBuffer sfVertexBuffer
struct sfTexture sfTexture
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 sfRenderTexture_destroy(const sfRenderTexture *renderTexture)
Destroy an existing render texture.
bool sfRenderTexture_generateMipmap(sfRenderTexture *renderTexture)
Generate a mipmap using the current texture data.
void sfRenderTexture_setSmooth(sfRenderTexture *renderTexture, bool smooth)
Enable or disable the smooth filter on a render texture.
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 * sfRenderTexture_create(sfVector2u size, const sfContextSettings *settings)
Construct a new render texture.
sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture *renderTexture, sfVector2i point, const sfView *view)
Convert a point from texture coordinates to world coordinates.
unsigned int sfRenderTexture_getMaximumAntiAliasingLevel(void)
Get the maximum anti-aliasing level supported by the system.
void sfRenderTexture_drawVertexArray(sfRenderTexture *renderTexture, const sfVertexArray *object, const sfRenderStates *states)
void sfRenderTexture_setView(sfRenderTexture *renderTexture, const sfView *view)
Change the current active view of a render texture.
void sfRenderTexture_drawRectangleShape(sfRenderTexture *renderTexture, const sfRectangleShape *object, const sfRenderStates *states)
void sfRenderTexture_drawShape(sfRenderTexture *renderTexture, const sfShape *object, const sfRenderStates *states)
const sfView * sfRenderTexture_getView(const sfRenderTexture *renderTexture)
Get the current active view of a render texture.
void sfRenderTexture_drawCircleShape(sfRenderTexture *renderTexture, const sfCircleShape *object, const sfRenderStates *states)
void sfRenderTexture_drawVertexBuffer(sfRenderTexture *renderTexture, const sfVertexBuffer *object, const sfRenderStates *states)
void sfRenderTexture_clearColorAndStencil(sfRenderTexture *renderTexture, sfColor color, sfStencilValue stencilValue)
Clear the entire target with a single color and stencil value.
bool sfRenderTexture_isRepeated(const sfRenderTexture *renderTexture)
Tell whether the texture is repeated or not.
void sfRenderTexture_drawConvexShape(sfRenderTexture *renderTexture, const sfConvexShape *object, const sfRenderStates *states)
void sfRenderTexture_drawText(sfRenderTexture *renderTexture, const sfText *object, const sfRenderStates *states)
void sfRenderTexture_display(sfRenderTexture *renderTexture)
Update the contents of the target texture.
void sfRenderTexture_clear(sfRenderTexture *renderTexture, sfColor color)
Clear the rendertexture with the given color.
void sfRenderTexture_resetGLStates(sfRenderTexture *renderTexture)
Reset the internal OpenGL states so that the target is ready for drawing.
void sfRenderTexture_drawVertexBufferRange(sfRenderTexture *renderTexture, const sfVertexBuffer *object, size_t firstVertex, size_t vertexCount, const sfRenderStates *states)
Draw primitives defined by a vertex buffer.
sfVector2u sfRenderTexture_getSize(const sfRenderTexture *renderTexture)
Get the size of the rendering region of a render texture.
void sfRenderTexture_setRepeated(sfRenderTexture *renderTexture, bool repeated)
Enable or disable texture repeating.
void sfRenderTexture_drawSprite(sfRenderTexture *renderTexture, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture *renderTexture, sfVector2f point, const sfView *view)
Convert a point from world coordinates to texture coordinates.
bool sfRenderTexture_isSrgb(const sfRenderTexture *renderTexture)
Tell if the render texture will use sRGB encoding when drawing on it.
void sfRenderTexture_clearStencil(sfRenderTexture *renderTexture, sfStencilValue stencilValue)
Clear the stencil buffer to a specific value.
const sfView * sfRenderTexture_getDefaultView(const sfRenderTexture *renderTexture)
Get the default view of a render texture.
const sfTexture * sfRenderTexture_getTexture(const sfRenderTexture *renderTexture)
Get the target texture of a render texture.
sfIntRect sfRenderTexture_getViewport(const sfRenderTexture *renderTexture, const sfView *view)
Get the viewport of a view applied to this target.
bool sfRenderTexture_isSmooth(const sfRenderTexture *renderTexture)
Tell whether the smooth filter is enabled or not for a render texture.
void sfRenderTexture_popGLStates(sfRenderTexture *renderTexture)
Restore the previously saved OpenGL render states and matrices.
void sfRenderTexture_pushGLStates(sfRenderTexture *renderTexture)
Save the current OpenGL render states and matrices.
bool sfRenderTexture_setActive(sfRenderTexture *renderTexture, bool active)
Activate or deactivate a render texture as the current target for rendering.
sfIntRect sfRenderTexture_getScissor(const sfRenderTexture *renderTexture, const sfView *view)
Get the scissor rectangle of a view, applied to this render target.
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
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