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

Use sensible defaults for depth/stencil #1991

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Conversation

Perksey
Copy link
Member

@Perksey Perksey commented Mar 20, 2024

Closes #1863

@ThomasMiz
Copy link
Contributor

Should we update the SDL backend too? The current relevant code looks like this:

            Sdl.GLSetAttribute(GLattr.DepthSize,
                    opts.PreferredDepthBufferBits is null || opts.PreferredDepthBufferBits == -1
                        ? 24 : opts.PreferredDepthBufferBits.Value);

            Sdl.GLSetAttribute(GLattr.StencilSize,
                    opts.PreferredStencilBufferBits is null || opts.PreferredStencilBufferBits == -1
                        ? 8 : opts.PreferredStencilBufferBits.Value);

So the only difference is that if one of these options is set to null, it uses 24/8 instead of the system default.

Everything looks good though

@Perksey
Copy link
Member Author

Perksey commented Mar 21, 2024

Yeah I agree, but I’m not sure that SDL has “system default” functionality. This PR was mostly to align it with SDL for the common case. I’ll double check to make sure.

@Perksey
Copy link
Member Author

Perksey commented Mar 21, 2024

Couldn’t find anything equivalent to GLFW’s don’t care… maybe not setting the attributes does that. I’ll give that a go.

@Perksey
Copy link
Member Author

Perksey commented Apr 15, 2024

@ThomasMiz Slightly adjusted the SDL logic, PTAL

@Perksey Perksey merged commit 0f4cce8 into main Apr 18, 2024
27 of 31 checks passed
@Perksey Perksey deleted the hotfix/sensible-defaults branch April 18, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

"Tutorial 2.2 - Camera" don't work on macos
2 participants