Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture parameter TEXTURE_MAX_ANISOTROPY is missing #1270

Closed
Rabbid76 opened this issue Apr 17, 2021 · 1 comment
Closed

Texture parameter TEXTURE_MAX_ANISOTROPY is missing #1270

Rabbid76 opened this issue Apr 17, 2021 · 1 comment

Comments

@Rabbid76
Copy link

Rabbid76 commented Apr 17, 2021

Anisotropic filtering (ARB_texture_filter_anisotropic) is part of the OpenGL 4.6 standard. See OpenGL 4.6 API Core Profile Specification - 8.10 Texture Parameters

However, the texture parameter TEXTURE_MAX_ANISOTROPY (0x84FE, 34046) is missing in enum TextureParameterName (namespace OpenTK.Graphics.OpenGL4). As well, the parameter MAX_TEXTURE_MAX_ANISOTROPY (0x84FF, 34047) is missing in enum GetPName.

A workaround is to cast an integer value to the enumerator type:

float maxTextureMaxAnisotropy = GL.GetFloat((GetPName)0x84FF);
GL.TexParameter(target, (TextureParameterName)0x84FE, maxTextureMaxAnisotropy);

respectively

float maxTextureMaxAnisotropy = GL.GetFloat((GetPName)0x84FF);
GL.TextureParameter(textureObject, (TextureParameterName)0x84FE, maxTextureMaxAnisotropy);
@NogginBops
Copy link
Member

NogginBops commented Apr 17, 2021

This issue comes from the fact that be bindings generator uses an old gl.xml that doesn't have these enums placed in their correct enum groups. Because of lacking knowledge of the current bindings and because the workaround isn't a lot of work I don't think it's worth fixing for OpenTK 4. With the new bindings generator being written for OpenTK 5 this is already fixed.

A better workaround that doesn't use magic numbers is to use the All enum as such:

float maxTextureMaxAnisotropy = GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy);
GL.TexParameter(target, (TextureParameterName)All.TextureMaxAnisotropy, maxTextureMaxAnisotropy);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants