Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

GL.TexParameterI mixed in with GL.TexParameter

Open tilkinsc opened this issue 3 years ago • 1 comments

Summary of feature

When I was going through code trying to specify base level for mipmapping, I found that GL.TexParameter would allow ints themselves to be passed as @params, making GL.TexParameterI very uselss. Conversely, GL.TexParameterI doesn't even allow you to pass just an int, just pointers and in variables.

Comments

While breaking changes aren't going to happen right now, it would be a minor version compatible change to add just the plain int to GL.TexParameterI

void GL.TexParameterI(TextureTarget target, TextureParameterName pname, int @params)

Does this have a proposal?

No

tilkinsc avatar Jul 10 '22 04:07 tilkinsc

Changing the generator in this way will be an absolute nightmare, so I strongly doubt this will happen.

Perksey avatar Jul 10 '22 08:07 Perksey

I also want to add that there is no overload for GLEnum. So you have to manually cast

gl.TextureParameter(_tid, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear);
gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear);

tilkinsc avatar Jan 10 '23 05:01 tilkinsc

I think I'm going to mark this as "we'll take it if someone in the community contributes it".

Perksey avatar Jan 10 '23 16:01 Perksey

Upon re-evaluation the signatures proposed in the issue do not make sense from a specification point of view:

  • TexParameterI explicitly takes a pointer for its last parameter. As such, it does not feel sensible to overload this to a non-pointer type.
  • TexParameter has no specification information to indicate to the generator that the last parameter can be a GLEnum. We are not adding function-specific generated overloads at this time, and are trying to lower our footprint of manual overloads (as these are a maintenance smell)

These functions are generated as expected by the contents of gl.xml.

Perksey avatar Jan 22 '23 18:01 Perksey

Thats unfortnuate.

tilkinsc avatar Jan 24 '23 21:01 tilkinsc