imgui icon indicating copy to clipboard operation
imgui copied to clipboard

Vector Graphics Support

Open HendrixString opened this issue 3 years ago • 6 comments

Hi Omar 👋 @ocornut

This is just a discussion,

Adding Vector Graphics with https://github.com/micro-gl/micro-tess

Will it interest you ?

It is a tiny headers library, that can be embedded, it can tesselate paths and geometries into vertex buffers.

Already used by two other graphics projects.

HendrixString avatar Sep 04 '23 16:09 HendrixString

Hello,

This is already the kind of stuff we do, at a smaller (much more limited) scope and optimized for our needs and exposed through the ImDrawList api. I don't see the value of embedding this in Dear ImGui, but you can perfectly use this with Dear ImGui yourself if you need.

ocornut avatar Sep 04 '23 16:09 ocornut

@ocornut maybe not embedding, But for example, the path tesselation is just a couple of header files. I believe it can bring value with rendering SVGs and things like that.

Anyway, love imGui

HendrixString avatar Sep 04 '23 16:09 HendrixString

I believe it can bring value with rendering SVGs and things like that.

Sure but there's no specific thing for me to do ? If someone wants to use SVG with this neat library they can already do it within the context of Dear ImGui, surely?

Maybe you can provide a little helper to pipe your output straight into ImDrawList ? then it becomes more more obvious for people that they can use the two together ?

ocornut avatar Sep 04 '23 16:09 ocornut

@ocornut Yes, this is a very good comment and direction. I will try to create a demo for you once I can, It will be cool to get some feedback then and see if it makes sense.

Thanks

HendrixString avatar Sep 04 '23 17:09 HendrixString

I'm overwhelmed unfortunately and it'd be saner for me to not venture in new directions, so I can't investigate it and I likely won't be a direct user. But if you think there is an overlap between Dear ImGui users and your stuff you may consider writing this helper "ImDrawList" backend for your stuff, but that's only if your vertex output can fit in ImDrawList's one.

My suggestion would be to show a gallery of demos in the Readme so it's easier for people to perceive the value of the library (but IMHO don't add large graphics files to repo, you can paste images anywhere in github and get a stable link).

Personally speaking, if I had to leave a gut feeling feedback - I wouldn't use a library with this very large amount of high-level abstraction, I know they are problematically slow in Debug mode, slower to compile, confusing to Debug. So this is a personal choice based on my own habits, and some people have the exact opposite view as me. Don't worry about my opinion and follow your intuition and what's useful for you. I'm sure it can be of great use to other people.

ocornut avatar Sep 04 '23 17:09 ocornut

@ocornut I appreciate 🙏 your honest view. Fear not, there are no abstractions. It is templated to produce efficient code without opinions.

The library can tesselate at any precision, From fixed point integers to float and doubles. It is the first of it's kind to achieve it.

Anyway, i feel you about being overwhelmed with responsibilities. Your recommendations are noted, thanks again

HendrixString avatar Sep 04 '23 18:09 HendrixString