Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a really useful codebase to compare what the code looks like for different APIs and the tooling around each (not so much for directly comparing the graphics, which should go without saying, but a lot of people seem to be missing the point here...)

It would be interesting to add an emscripten version, ie. slight modifications to the original C++/OpenGL code to make it compile with emscripten and run in the browser. After some fooling around I got that to work, however nothing shows up because the shaders need to be rewritten for WebGL. Looks like this was already done for the JS/WebGL version, but the shaders are less fancy and clearly don't map 1-to-1 to those in the C++/OpenGL version, so the code will need to be modified a bit either way.



If you target WebGL2 you can likely do it without hand modifying the shaders. In a small test I did I just patched the emscripten library_gl.js to do a very simple search and replace of the version string of shaders and stuff just worked.

code: https://github.com/greggman/doodles/tree/master/glfw-imgui

demo: https://greggman.github.io/doodles/glfw-imgui/out/glfw-imgui...

You do have to decide if you want to restructure you code to be event based or if you want it leave it as is and set emscripten to generate really slow code for your main loop

https://kripken.github.io/emscripten-site/docs/porting/emter...


very cool to see ImGui used in webgl!


I think ImGui is amazing but just be aware it's non-English hostile (arabic? thai?).

It can display other languages but uses a static font glpyh texture instead of using a font cache (there are too many characters to use a static texture).

It can't take input from an IME so no CJK input or other IME languages.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: