mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 13:06:13 +01:00
Modified sfShader_createFromFile, sfShader_createFromMemory and sfShader_createFromStream functions to allow loading of all three vertex + geometry + fragment shaders
This commit is contained in:
1 parent
da9cce8350
commit
bf46c5386a
2 files changed
+80
-50
No files matched your search
@@ -40,59 +40,62 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from files
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function can load the vertex, the geometry and the fragment
|
||||
/// shaders, or only one or two of them: pass NULL if you don't want to load
|
||||
/// the vertex shader, the geometry shader or the fragment shader.
|
||||
/// The sources must be text files containing valid shaders
|
||||
/// in GLSL language. GLSL is a C-like language dedicated to
|
||||
/// OpenGL shaders; you'll probably need to read a good documentation
|
||||
/// for it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderFilename Path of the vertex shader file to load, or NULL to skip this shader
|
||||
/// \param geometryShaderFilename Path of the geometry shader file to load, or NULL to skip this shader
|
||||
/// \param fragmentShaderFilename Path of the fragment shader file to load, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from source codes in memory
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function can load the vertex, the geometry and the fragment
|
||||
/// shaders, or only one or two of them: pass NULL if you don't want to load
|
||||
/// the vertex shader, the geometry shader or the fragment shader.
|
||||
/// The sources must be valid shaders in GLSL language. GLSL is
|
||||
/// a C-like language dedicated to OpenGL shaders; you'll
|
||||
/// probably need to read a good documentation for it before
|
||||
/// writing your own shaders.
|
||||
///
|
||||
/// \param vertexShader String containing the source code of the vertex shader, or NULL to skip this shader
|
||||
/// \param geometryShader String containing the source code of the geometry shader, or NULL to skip this shader
|
||||
/// \param fragmentShader String containing the source code of the fragment shader, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from custom streams
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function can load the vertex, the geometry and the fragment
|
||||
/// shaders, or only one or two of them: pass NULL if you don't want to load
|
||||
/// the vertex shader, the geometry shader or the fragment shader.
|
||||
/// The source codes must be valid shaders in GLSL language.
|
||||
/// GLSL is a C-like language dedicated to OpenGL shaders;
|
||||
/// you'll probably need to read a good documentation for
|
||||
/// it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderStream Source stream to read the vertex shader from, or NULL to skip this shader
|
||||
/// \param geometryShaderStream Source stream to read the geometry shader from, or NULL to skip this shader
|
||||
/// \param fragmentShaderStream Source stream to read the fragment shader from, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shader
|
||||
|
||||
Reference in new issue
Block a user