d-gamedev-team / dimgui

dimgui is a D port of the imgui OpenGL GUI library.
zlib License
48 stars 13 forks source link

Unicode support #2

Closed kiith-sa closed 10 years ago

kiith-sa commented 10 years ago

I added (limited) Unicode support (need to support diacritics in my project).

Changes:

ghost commented 10 years ago

Hmm.. Forcing to use string means the user has to either allocate on each render or do an unsafe cast (char[] to string for example) if they want to render some frequently updated piece of text.

Since imgui is an immediate mode GUI lib it makes sense that it takes non-immutable data methinks.

ghost commented 10 years ago

IIRC imgui did have some unicode support somewhere, or maybe imgui is based on some fork which used to have unicode support. Maybe I'm remembering it wrong though. Anyway this looks like great work so far, thank you!

kiith-sa commented 10 years ago

The main reason I used string is that in D it's 'obvious'/self-documenting that string is UTF-8. But makes sense, const(char)[] is compatible both with string and char[], we just need to specify in the docs that it's UTF-8, not ASCII.

kiith-sa commented 10 years ago

Update:

kiith-sa commented 10 years ago

(ping)

ghost commented 10 years ago

Woops! Sorry, I was busy with the whole "adjust to living in another country" period. :P

I'll get to your pull in a few days, promise!

ghost commented 10 years ago

Thanks for this work. If you want I could add you as a maintainer if you want to do further work on the project.

kiith-sa commented 10 years ago

It's likely I'll have more additions in the future but it'll be solely on a I-need-this-feature-now/it's-too-slow basis (the latter is pretty much certain), so I'm not sure if I'm the right person to be a maintainer.