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

requestFloatBuffer option #89

Merged
merged 1 commit into from
Jan 14, 2024
Merged

requestFloatBuffer option #89

merged 1 commit into from
Jan 14, 2024

Conversation

wkjarosz
Copy link
Contributor

This PR addresses #78.

Some notes on my proposed solution:

In user code, I personally prefer to minimize the need for #if defined directives to choose between various options. So, I removed the MetalOptions struct, and instead created a shared bool option to request a float buffer. Since even on Metal this may not always be supported (or you may not always want to create a float buffer), I also created a function to check if the system supports Edr floating point framebuffers. This returns false on all systems, except on Metal it checks the underlying system for support. If this returns true, you can set requestFloatBuffer to true to get an EDR-compatible framebuffer. If in the future we figure out how to do this in Vulkan, DirectX or OpenGL, we can reimplement this functon for those backends and reuse this bool option.

I made a small chance to the docking demo to do this to verify it works.

I tried to incorporate comments where I could, but beyond doxygen, I don't know the syntax of your particular documentation generation tool, so you may need to adjust.

@pthom pthom merged commit 514bb5d into pthom:edr Jan 14, 2024
33 checks passed
@pthom
Copy link
Owner

pthom commented Jan 14, 2024

Thanks a lot.

I merged your PR, into the master and edr branch. I do agree with your remark " I personally prefer to minimize the need for #if defined directives".

I will probably soon delete the edr branch, unless you want to add something in it.

I added a specific demo for EDR:
image
(this screenshot probably cannot render EDR colors, so this is an approximation)

See its code: [hello_edr.mm]((https://github.com/pthom/hello_imgui/blob/master/src/hello_imgui_demos/hello_edr/hello_edr.mm)

I tried to incorporate comments where I could, but beyond doxygen, I don't know the syntax of your particular documentation generation tool, so you may need to adjust.

The documentation format was weird. Now, you just add standard C++ documentation
between @@md markers, and it is then automatically included in the doc

@wkjarosz
Copy link
Contributor Author

Thanks. I'll give it a try and let you know if I run into any problems.

@wkjarosz
Copy link
Contributor Author

I've confirmed the merged master branch works for me, so feel free to delete this edr branch.

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

Successfully merging this pull request may close these issues.

2 participants