CSFML - C binding of the Simple and Fast Multimedia Library

CSFML
RenderTexture.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2015 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_RENDERTEXTURE_H
26 #define SFML_RENDERTEXTURE_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/System/Vector2.h>
39 #include <stddef.h>
40
41
52 CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
53
60 CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture* renderTexture);
61
70 CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture);
71
81 CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active);
82
89 CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture* renderTexture);
90
98 CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color);
99
107 CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view);
108
117 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture);
118
127 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture);
128
138 CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
139
165 CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
166
191 CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
192
201 CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
202 CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
203 CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states);
204 CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
205 CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
206 CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
207 CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
208
219 CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
220 const sfVertex* vertices, size_t vertexCount,
221 sfPrimitiveType type, const sfRenderStates* states);
222
244 CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture);
245
255 CSFML_GRAPHICS_API void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture);
256
269 CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture);
270
279 CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
280
288 CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth);
289
298 CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
299
307 CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated);
308
317 CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
318
333 CSFML_GRAPHICS_API sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
334
335
336 #endif // SFML_RENDERTEXTURE_H
sfRenderTexture_generateMipmap
CSFML_GRAPHICS_API sfBool sfRenderTexture_generateMipmap(sfRenderTexture *renderTexture)
Generate a mipmap using the current texture data.
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition: Graphics/Export.h:43
sfRenderTexture_destroy
CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture *renderTexture)
Destroy an existing render texture.
sfPrimitiveType
sfPrimitiveType
Types of primitives that a sf::VertexArray can render.
Definition: PrimitiveType.h:42
sfIntRect
Definition: Rect.h:46
sfRenderTexture
struct sfRenderTexture sfRenderTexture
Definition: Graphics/Types.h:35
sfRenderTexture_drawSprite
CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture *renderTexture, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
sfRenderTexture_display
CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture *renderTexture)
Update the contents of the target texture.
sfConvexShape
struct sfConvexShape sfConvexShape
Definition: Graphics/Types.h:30
sfVertexArray
struct sfVertexArray sfVertexArray
Definition: Graphics/Types.h:42
sfRenderTexture_drawRectangleShape
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture *renderTexture, const sfRectangleShape *object, const sfRenderStates *states)
sfRenderTexture_clear
CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture *renderTexture, sfColor color)
Clear the rendertexture with the given color.
Export.h
sfRenderTexture_setView
CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture *renderTexture, const sfView *view)
Change the current active view of a render texture.
Vertex.h
sfRenderTexture_mapCoordsToPixel
CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture *renderTexture, sfVector2f point, const sfView *view)
Convert a point from world coordinates to texture coordinates.
sfRenderTexture_create
CSFML_GRAPHICS_API sfRenderTexture * sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer)
Construct a new render texture.
sfRenderTexture_setActive
CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture *renderTexture, sfBool active)
Activate or deactivate a render texture as the current target for rendering.
sfRenderTexture_drawText
CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture *renderTexture, const sfText *object, const sfRenderStates *states)
sfRenderTexture_getSize
CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture *renderTexture)
Get the size of the rendering region of a render texture.
PrimitiveType.h
sfRenderTexture_mapPixelToCoords
CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture *renderTexture, sfVector2i point, const sfView *view)
Convert a point from texture coordinates to world coordinates.
sfRenderTexture_getTexture
CSFML_GRAPHICS_API const sfTexture * sfRenderTexture_getTexture(const sfRenderTexture *renderTexture)
Get the target texture of a render texture.
sfRenderTexture_setRepeated
CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture *renderTexture, sfBool repeated)
Enable or disable texture repeating.
sfRenderTexture_getView
CSFML_GRAPHICS_API const sfView * sfRenderTexture_getView(const sfRenderTexture *renderTexture)
Get the current active view of a render texture.
sfBool
int sfBool
Definition: Config.h:153
sfVector2i
2-component vector of integers
Definition: Vector2.h:38
sfVector2u
2-component vector of unsigned integers
Definition: Vector2.h:49
sfRenderTexture_getDefaultView
CSFML_GRAPHICS_API const sfView * sfRenderTexture_getDefaultView(const sfRenderTexture *renderTexture)
Get the default view of a render texture.
sfColor
Utility class for manpulating RGBA colors.
Definition: Color.h:38
Vector2.h
sfRenderTexture_isSmooth
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture *renderTexture)
Tell whether the smooth filter is enabled or not for a render texture.
sfSprite
struct sfSprite sfSprite
Definition: Graphics/Types.h:38
sfRenderStates
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:41
sfView
struct sfView sfView
Definition: Graphics/Types.h:43
sfRectangleShape
struct sfRectangleShape sfRectangleShape
Definition: Graphics/Types.h:34
sfRenderTexture_popGLStates
CSFML_GRAPHICS_API void sfRenderTexture_popGLStates(sfRenderTexture *renderTexture)
Restore the previously saved OpenGL render states and matrices.
sfRenderTexture_setSmooth
CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture *renderTexture, sfBool smooth)
Enable or disable the smooth filter on a render texture.
sfCircleShape
struct sfCircleShape sfCircleShape
Definition: Graphics/Types.h:29
sfText
struct sfText sfText
Definition: Graphics/Types.h:39
sfRenderTexture_drawShape
CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture *renderTexture, const sfShape *object, const sfRenderStates *states)
Types.h
sfRenderTexture_pushGLStates
CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates(sfRenderTexture *renderTexture)
Save the current OpenGL render states and matrices.
Color.h
sfRenderTexture_isRepeated
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture *renderTexture)
Tell whether the texture is repeated or not.
sfRenderTexture_drawConvexShape
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture *renderTexture, const sfConvexShape *object, const sfRenderStates *states)
sfRenderTexture_drawPrimitives
CSFML_GRAPHICS_API 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.
sfVector2f
2-component vector of floats
Definition: Vector2.h:60
RenderStates.h
sfShape
struct sfShape sfShape
Definition: Graphics/Types.h:37
sfRenderTexture_drawVertexArray
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture *renderTexture, const sfVertexArray *object, const sfRenderStates *states)
sfRenderTexture_getViewport
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture *renderTexture, const sfView *view)
Get the viewport of a view applied to this target.
Rect.h
sfRenderTexture_resetGLStates
CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture *renderTexture)
Reset the internal OpenGL states so that the target is ready for drawing.
sfTexture
struct sfTexture sfTexture
Definition: Graphics/Types.h:40
sfRenderTexture_drawCircleShape
CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture *renderTexture, const sfCircleShape *object, const sfRenderStates *states)
sfVertex
Define a point with color and texture coordinates.
Definition: Vertex.h:39