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:
GL11.BlindTexture
GL11.glTexParameteri
GL11.GL_TEXTURE_MIN_FILTER
GL11.GL_TEXTURE_MAG_FILTER
GL11.GL_TEXTURE_WRAP_S
GL11.GL_TEXTURE_WRAP_T
Sorry I can't give you more code lines because the forum won't.


Comments

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: http://www.opentk.com/doc/graphics/textures/loading

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.