CSFML - C binding of the Simple and Fast Multimedia Library

CSFML
Texture.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_TEXTURE_H
26 #define SFML_TEXTURE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Rect.h>
33 #include <SFML/Graphics/Types.h>
34 #include <SFML/Window/Types.h>
35 #include <SFML/System/InputStream.h>
36 #include <SFML/System/Vector2.h>
37 #include <stddef.h>
38
39
49 CSFML_GRAPHICS_API sfTexture* sfTexture_create(unsigned int width, unsigned int height);
50
60 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area);
61
72 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area);
73
83 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area);
84
94 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area);
95
104 CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
105
112 CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture);
113
122 CSFML_GRAPHICS_API sfVector2u sfTexture_getSize(const sfTexture* texture);
123
132 CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
133
145 CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
146
156 CSFML_GRAPHICS_API void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
157
167 CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
168
178 CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
179
187 CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
188
197 CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
198
222 CSFML_GRAPHICS_API void sfTexture_setSrgb(sfTexture* texture, sfBool sRgb);
223
232 CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
233
255 CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
256
265 CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
266
290 CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture);
291
304 CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture* texture);
305
327 CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
328
335 CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize();
336
337
338 #endif // SFML_TEXTURE_H
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition: Graphics/Export.h:43
sfIntRect
Definition: Rect.h:46
sfWindow
struct sfWindow sfWindow
Definition: Window/Types.h:30
sfTexture_isRepeated
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture *texture)
Tell whether a texture is repeated or not.
Export.h
sfTexture_setRepeated
CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture *texture, sfBool repeated)
Enable or disable repeating for a texture.
sfTexture_getMaximumSize
CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize()
Get the maximum texture size allowed.
sfTexture_destroy
CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture *texture)
Destroy an existing texture.
sfInputStream
Set of callbacks that allow users to define custom file streams.
Definition: InputStream.h:44
InputStream.h
sfBool
int sfBool
Definition: Config.h:153
sfTexture_getNativeHandle
CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture *texture)
Get the underlying OpenGL handle of the texture.
sfTexture_updateFromWindow
CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture *texture, const sfWindow *window, unsigned int x, unsigned int y)
Update a texture from the contents of a window.
sfVector2u
2-component vector of unsigned integers
Definition: Vector2.h:49
sfTexture_updateFromImage
CSFML_GRAPHICS_API void sfTexture_updateFromImage(sfTexture *texture, const sfImage *image, unsigned int x, unsigned int y)
Update a texture from an image.
sfTexture_updateFromPixels
CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture *texture, const sfUint8 *pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
Update a texture from an array of pixels.
sfRenderWindow
struct sfRenderWindow sfRenderWindow
Definition: Graphics/Types.h:36
sfTexture_copyToImage
CSFML_GRAPHICS_API sfImage * sfTexture_copyToImage(const sfTexture *texture)
Copy a texture&#39;s pixels to an image.
sfTexture_create
CSFML_GRAPHICS_API sfTexture * sfTexture_create(unsigned int width, unsigned int height)
Create a new texture.
Vector2.h
sfTexture_getSize
CSFML_GRAPHICS_API sfVector2u sfTexture_getSize(const sfTexture *texture)
Return the size of the texture.
sfImage
struct sfImage sfImage
Definition: Graphics/Types.h:32
sfTexture_setSrgb
CSFML_GRAPHICS_API void sfTexture_setSrgb(sfTexture *texture, sfBool sRgb)
Enable or disable conversion from sRGB.
Types.h
sfTexture_createFromImage
CSFML_GRAPHICS_API sfTexture * sfTexture_createFromImage(const sfImage *image, const sfIntRect *area)
Create a new texture from an image.
Types.h
sfTexture_generateMipmap
CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture *texture)
Generate a mipmap using the current texture data.
sfTexture_updateFromRenderWindow
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture *texture, const sfRenderWindow *renderWindow, unsigned int x, unsigned int y)
Update a texture from the contents of a render-window.
sfTexture_bind
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture *texture)
Bind a texture for rendering.
sfTexture_setSmooth
CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture *texture, sfBool smooth)
Enable or disable the smooth filter on a texture.
sfTexture_createFromMemory
CSFML_GRAPHICS_API sfTexture * sfTexture_createFromMemory(const void *data, size_t sizeInBytes, const sfIntRect *area)
Create a new texture from a file in memory.
sfTexture_isSrgb
CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture *texture)
Tell whether the texture source is converted from sRGB or not.
sfTexture_isSmooth
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture *texture)
Tell whether the smooth filter is enabled or not for a texture.
sfUint8
unsigned char sfUint8
Definition: Config.h:168
Rect.h
sfTexture
struct sfTexture sfTexture
Definition: Graphics/Types.h:40
sfTexture_createFromFile
CSFML_GRAPHICS_API sfTexture * sfTexture_createFromFile(const char *filename, const sfIntRect *area)
Create a new texture from a file.
sfTexture_createFromStream
CSFML_GRAPHICS_API sfTexture * sfTexture_createFromStream(sfInputStream *stream, const sfIntRect *area)
Create a new texture from a custom stream.
sfTexture_copy
CSFML_GRAPHICS_API sfTexture * sfTexture_copy(const sfTexture *texture)
Copy an existing texture.