CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

Shader.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_SHADER_H
26 #define SFML_SHADER_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Transform.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/System/InputStream.h>
36 #include <SFML/System/Vector2.h>
37 #include <SFML/System/Vector3.h>
38
39
57 CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
58
76 CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
77
95 CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
96
103 CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
104
125 CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
126
148 CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
149
172 CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
173
197 CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
198
220 CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
221
243 CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
244
271 CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
272
294 CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
295
327 CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
328
350 CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
351
364 CSFML_GRAPHICS_API unsigned int sfShader_getNativeHandle(const sfShader* shader);
365
387 CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
388
399 CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
400
401
402 #endif // SFML_SHADER_H
sfVector3f
3-component vector of floats
Definition: Vector3.h:38
CSFML_GRAPHICS_API
#define CSFML_GRAPHICS_API
Definition: Graphics/Export.h:43
sfShader_bind
CSFML_GRAPHICS_API void sfShader_bind(const sfShader *shader)
Bind a shader for rendering (activate it)
sfShader_destroy
CSFML_GRAPHICS_API void sfShader_destroy(sfShader *shader)
Destroy an existing shader.
sfShader
struct sfShader sfShader
Definition: Graphics/Types.h:33
sfShader_setFloat4Parameter
CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader *shader, const char *name, float x, float y, float z, float w)
Change a 4-components vector parameter of a shader.
sfShader_setFloat2Parameter
CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader *shader, const char *name, float x, float y)
Change a 2-components vector parameter of a shader.
sfShader_setFloat3Parameter
CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader *shader, const char *name, float x, float y, float z)
Change a 3-components vector parameter of a shader.
Export.h
sfShader_setVector2Parameter
CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader *shader, const char *name, sfVector2f vector)
Change a 2-components vector parameter of a shader.
sfShader_setTransformParameter
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader *shader, const char *name, sfTransform transform)
Change a matrix parameter of a shader.
sfInputStream
Set of callbacks that allow users to define custom file streams.
Definition: InputStream.h:44
sfShader_createFromStream
CSFML_GRAPHICS_API sfShader * sfShader_createFromStream(sfInputStream *vertexShaderStream, sfInputStream *fragmentShaderStream)
Load both the vertex and fragment shaders from custom streams.
Transform.h
InputStream.h
sfBool
int sfBool
Definition: Config.h:117
sfShader_setVector3Parameter
CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader *shader, const char *name, sfVector3f vector)
Change a 3-components vector parameter of a shader.
sfColor
Utility class for manpulating RGBA colors.
Definition: Color.h:38
Vector2.h
Vector3.h
Types.h
Color.h
sfShader_getNativeHandle
CSFML_GRAPHICS_API unsigned int sfShader_getNativeHandle(const sfShader *shader)
Get the underlying OpenGL handle of the shader.
sfShader_isAvailable
CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void)
Tell whether or not the system supports shaders.
sfTransform
Encapsulate a 3x3 transform matrix.
Definition: Transform.h:42
sfVector2f
2-component vector of floats
Definition: Vector2.h:60
sfShader_createFromFile
CSFML_GRAPHICS_API sfShader * sfShader_createFromFile(const char *vertexShaderFilename, const char *fragmentShaderFilename)
Load both the vertex and fragment shaders from files.
sfShader_setColorParameter
CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader *shader, const char *name, sfColor color)
Change a color parameter of a shader.
sfTexture
struct sfTexture sfTexture
Definition: Graphics/Types.h:40
sfShader_setFloatParameter
CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader *shader, const char *name, float x)
Change a float parameter of a shader.
sfShader_setCurrentTextureParameter
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader *shader, const char *name)
Change a texture parameter of a shader.
sfShader_createFromMemory
CSFML_GRAPHICS_API sfShader * sfShader_createFromMemory(const char *vertexShader, const char *fragmentShader)
Load both the vertex and fragment shaders from source codes in memory.
sfShader_setTextureParameter
CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader *shader, const char *name, const sfTexture *texture)
Change a texture parameter of a shader.