Texture.h
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2018 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
49CSFML_GRAPHICS_API sfTexture* sfTexture_create(unsigned int width, unsigned int height);
50
60CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area);
61
72CSFML_GRAPHICS_API sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area);
73
83CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area);
84
94CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area);
95
104CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
105
112CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture);
113
122CSFML_GRAPHICS_API sfVector2u sfTexture_getSize(const sfTexture* texture);
123
132CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
133
145CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
146
163CSFML_GRAPHICS_API void sfTexture_updateFromTexture(sfTexture* destination, const sfTexture* source, unsigned int x, unsigned int y);
164
174CSFML_GRAPHICS_API void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
175
185CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
186
196CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
197
205CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
206
215CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
216
240CSFML_GRAPHICS_API void sfTexture_setSrgb(sfTexture* texture, sfBool sRgb);
241
250CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
251
273CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
274
283CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
284
308CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture);
309
317CSFML_GRAPHICS_API void sfTexture_swap(sfTexture* left, sfTexture* right);
318
331CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture* texture);
332
354CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
355
362CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize();
363
364
365#endif // SFML_TEXTURE_H
Set of callbacks that allow users to define custom file streams.
Definition: InputStream.h:45
Definition: Rect.h:47
2-component vector of unsigned integers
Definition: Vector2.h:50