glippozzo's picture

Java LWJGL to C# OpenTK

Hello everybody i'm trying to translate this code from Java, but I've some problems converting those:
Sorry I can't give you more code lines because the forum won't.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

See here:

GL.BindTexture(TextureTarget.Texture2D, id);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)All.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMaxFilter, (int)All.Linear);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)All.ClampToEdge);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)All.Repeat);

If you are using an IDE such as Visual Studio or Xamarin Studio / MonoDevelop, then you should get suggestions for each parameter, as well as a documentation tooltip listing allowed values.

Some methods, such as GL.TexParameter, are polymorphic (i.e. the type of the last parameter of GL.TexParameter depends on the second parameter.) In this case, you can use the "All" enum, which is equivalent to the untyped constants in LWJGL.