-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Implement min/mag texture filtering #76
Conversation
These changes allow users to call SetTextureMinFilter and SetTextureMagFilter on the MasterWindow to change how textures are filtered for rendering. This allows pixel-perfect rendering via giu.TextureFilterNearest.
@kettek I think those two functions should be added to renderer interface only. Because they are kind of rarely be used, which could remain the simplicity of MainWindow structure. func main() {
wnd := g.NewMasterWindow(...)
g.Context.GetRenderer(). SetTextureMinFilter(...)
g.Context.GetRenderer(). SetTextureMagFilter(...)
...
} Do you think this is doable? |
That would certainly be simpler and would be functionally equivalent -- I'll make adjustments. |
Now adjusted to remove MasterWindow methods. |
@kettek Thanks! Can you add a demo about how to use those two functions? |
I've created an example in I left commented out in the code additional buttons for setting some other mipmap modes -- I have disabled them since their use causes non-image imgui draw calls to not be rendered. |
To note, I think this freeze is related to #30 |
I tried to solve this once, and I did fix it with giu, but unfortunately the upstream lib GLFW also has same problem. I need to create a PR to GLFW when I got time. |
These changes allow users to call SetTextureMinFilter and SetTextureMagFilter on the MasterWindow to change how textures are
filtered for rendering. This allows pixel-perfect rendering via giu.TextureFilterNearest.