Permalink
Browse files

Updated Texture.Bind and Shader.Bind

  • Loading branch information...
1 parent 9c320fd commit 268567b73419e586dceebbd69a4095394cd1558d @LaurentGomila LaurentGomila committed Jan 8, 2013
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -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
@@ -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>
////////////////////////////////////////////////////////////

0 comments on commit 268567b

Please sign in to comment.