Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated Texture.Bind and Shader.Bind

  • Loading branch information...
commit 268567b73419e586dceebbd69a4095394cd1558d 1 parent 9c320fd
@LaurentGomila LaurentGomila authored
View
BIN  extlibs/x64/csfml-audio-2.dll
Binary file not shown
View
BIN  extlibs/x64/csfml-graphics-2.dll
Binary file not shown
View
BIN  extlibs/x64/csfml-window-2.dll
Binary file not shown
View
BIN  extlibs/x86/csfml-audio-2.dll
Binary file not shown
View
BIN  extlibs/x86/csfml-graphics-2.dll
Binary file not shown
View
BIN  extlibs/x86/csfml-window-2.dll
Binary file not shown
View
11 src/Graphics/Shader.cs
@@ -275,16 +275,13 @@ public void SetParameter(string name, CurrentTextureType current)
////////////////////////////////////////////////////////////
/// <summary>
- /// Bind the shader for rendering (activate it)
- ///
- /// This function is normally for internal use only, unless
- /// you want to use the shader with a custom OpenGL rendering
- /// instead of a SFML drawable.
+ /// Bind a shader for rendering
/// </summary>
+ /// <param name="shader">Shader to bind (can be null to use no shader)</param>
////////////////////////////////////////////////////////////
- public void Bind()
+ public static void Bind(Shader shader)
{
- sfShader_bind(CPointer);
+ sfShader_bind(shader != null ? shader.CPointer : IntPtr.Zero);
}
////////////////////////////////////////////////////////////
View
21 src/Graphics/Texture.cs
@@ -246,16 +246,6 @@ public void Update(RenderWindow window, uint x, uint y)
////////////////////////////////////////////////////////////
/// <summary>
- /// Bind the texture for rendering
- /// </summary>
- ////////////////////////////////////////////////////////////
- public void Bind()
- {
- sfTexture_bind(CPointer);
- }
-
- ////////////////////////////////////////////////////////////
- /// <summary>
/// Control the smooth filter
/// </summary>
////////////////////////////////////////////////////////////
@@ -288,6 +278,17 @@ public Vector2u Size
////////////////////////////////////////////////////////////
/// <summary>
+ /// Bind a texture for rendering
+ /// </summary>
+ /// <param name="texture">Shader to bind (can be null to use no texture)</param>
+ ////////////////////////////////////////////////////////////
+ public static void Bind(Texture texture)
+ {
+ sfTexture_bind(texture != null ? texture.CPointer : IntPtr.Zero);
+ }
+
+ ////////////////////////////////////////////////////////////
+ /// <summary>
/// Maximum texture size allowed
/// </summary>
////////////////////////////////////////////////////////////
Please sign in to comment.
Something went wrong with that request. Please try again.