pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
604 stars 91 forks source link

requestFloatBuffer option #89

Closed wkjarosz closed 5 months ago

wkjarosz commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

wkjarosz commented 5 months ago

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