Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Use Nuklear for web - through canvas #79

Closed
dumblob opened this issue Apr 19, 2016 · 4 comments
Closed

Use Nuklear for web - through canvas #79

dumblob opened this issue Apr 19, 2016 · 4 comments

Comments

@dumblob
Copy link
Contributor

dumblob commented Apr 19, 2016

Nowadays, web sites are not any more documents, but rather pretty complex UI applications. On the other hand, it's extremely difficult to get it working on all screen sizes and DPIs. With Nuklear it would be piece of cake.

I was thinking about compiling Nuklear to JS using Emscripten and drawing everything immediately to HTML5 canvas. The only question is performance. But I'm pretty certain, it'll be sufficient and we'll finally have a proper tool for building UIs on the screwed web. Also for future, it'll be (significantly?) more performant thanks to WebAssembly, which allows highly optimized compilation from C.

Anyone has any hands-on experience?

@mmozeiko
Copy link
Contributor

I haven't tried, but dear imgui has pull request with example for Emscripten (using SDL2): ocornut/imgui#336
You could try porting source to work with nuklear.

@glegris
Copy link

glegris commented May 2, 2016

I got the SDL1.2 demo (SDL + SDL_gfx) work with Emscripten with very few modifications. Essentially I replaced the main function by emscripten_set_main_loop to avoid to block the browser thread. I didn't try with SDL/OpenGL yet.

If @vurtun is ok, I could do a pull request to add this in the demo directory.

@dumblob
Copy link
Contributor Author

dumblob commented May 10, 2016

@glegris could you please make a separate gist first? I'll have time first in 3 weeks, but I would very much like to take a look at it.

@dumblob
Copy link
Contributor Author

dumblob commented Jun 20, 2016

First fully functional prototype using WebGL and offering an online demo: #164 .

Now only a pure canvas solution (without WebGL and without glfw3) is missing.

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

No branches or pull requests

4 participants