SFML community forums

Bindings - other languages => DotNet => Topic started by: Brendon on May 10, 2013, 01:59:45 am

Title: OpenGL Bind() deprecated?
Post by: Brendon on May 10, 2013, 01:59:45 am
I'm trying out dotnet SFML2, and am running into an OpenGL issue. Do Textures no longer have a "bind()" call? I'm attempting to call "myTexture.bind();", but "bind()" seems to no longer exist.

Is this a change in the API, or is the dotnet binding perhaps missing this call?
Title: Re: OpenGL Bind() deprecated?
Post by: FRex on May 10, 2013, 02:22:21 am
Yes, there was a change:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Texture.php#ae9a4274e7b95ebf7244d09c7445833b0
DotNet has something similar now because there was release of 2.0 recently.
There's a static method that takes null or texture:
public static void Bind(Texture texture)
{
        sfTexture_bind(texture != null ? texture.CPointer : IntPtr.Zero);
}
Title: Re: OpenGL Bind() deprecated?
Post by: Brendon on May 10, 2013, 03:38:02 am
Thanks for the help, FRex. It works great now.

Here's how the code ended up looking:
Texture.Bind(myTexture);