betafy's picture

Repeat textures

In my previous project I was using the Tao framework and for repeating textures all I had to do was do this:
Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_S, Gl.GL_REPEAT);
Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_T, Gl.GL_REPEAT);

I can do this with OpenTK up until the Gl.GL_REPEAT parameter because there is no enumeration containing something like GL_REPEAT (at least that I have found). All of the overloads I've seen require some kind of int or float for the final parameter. Does anyone know what I need to put here?


Comments

Comment viewing options

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

Yes, it's a bit strange, but this should work:

GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, Convert.ToInt32(TextureWrapMode.Repeat));
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, Convert.ToInt32(TextureWrapMode.Repeat));