Rendering to a framebuffer instead of OpenGL
I was looking through the code because I'm wanting to use Nuklear but I don't want to use OpenGL, this is for a graphics system I'm developing. So I just need to be able to render to a framebuffer and it seems possible to render without OpenGL. Can I please get some help with rendering to a framebuffer if it's possible.
Sure, that's one of the main goals of Nuklear - to have extremely easily pluggable backends. Just look at the demo/ folder where you'll find all currently functional backends (there might be some also in pull requests to this repository). If you need more help, don't hesitate and ask :wink:.
Ok, it looks pretty straight forward. I'll leave the issue open if I need help.
opticsgs/libopnuk on master [!?] took 38m 28s
[I] ➜ ../build/demos/opnuk/demo-opnuk
** Message: 10:27:38.505: Using /run/user/1000/slatewm.sock for IPC path
demo-opnuk: /home/ross/RonixOS/opticsgs/libopnuk/nuklear/nuklear.h:16325: nk_begin_titled: Assertion `win->seq != ctx->seq' failed.
Got this error creating just doing this:
if (nk_begin(&ctx.nkctx, "Overview", nk_rect(10, 10, 400, 600), NK_WINDOW_BORDER)) {
}
nk_end(&ctx.nkctx);
I took the rawfb header from the X11 RawFB example and integrated it, I only see a white box.
Got this error creating just doing this: ...
This is weird. Please post the full source code somewhere (pastebin, your github repo, ...) so that we can take a look.
I took the rawfb header from the X11 RawFB example and integrated it, I only see a white box.
Same as above - post the full source and I'll try to find some time to dig through it during the next two or three weeks.
https://github.com/ronixos/opticsgs is the repository I'm doing this all in, libopnuk is doing the Nuklear rendering stuff and demos/opnuk/src/main.c is where libopnuk is being used.
The code of the opnuk demo I'm working on.
libopticsgs_win_t* win;
if ((r = libopticsgs_window_create(&win, 0, 0, 0, 640, 480, 0)) != LIBOPTICSGS_ERROR_NONE) {
g_error("Failed to create window: %s", libopticsgs_strerror(r));
return EXIT_FAILURE;
}
opnuk_context_t ctx;
if ((r = opnuk_init(win, OPNUK_RENDER_GL2, &ctx)) < OPNUK_ERROR_NONE) {
libopticsgs_window_destroy(win);
g_error("Failed to initialize opnuk: %d", r);
return EXIT_FAILURE;
}
while (1) {
struct nk_context* nk = opnuk_getnk(&ctx);
if (nk_begin(nk, "Overview", nk_rect(0, 0, win->width, win->height), NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_TITLE)) {
nk_layout_row_dynamic(nk, 20, 1);
if (nk_button_label(nk, "button")) {}
}
nk_end(nk);
if (ctx.renderer == OPNUK_RENDER_GL2) {
glViewport(0, 0, win->width, win->height);
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.10f, 0.18f, 0.24f, 1.0f);
}
opnuk_render(ctx);
}
The green border is the window frame in the screenshots bellow.
Rendering with rawfb:
In this, it is rendering outside of the space its supposed to in the bottom and right.
Rendering with OpenGL 2.0:
In this, nothing is rendering
https://github.com/ronixos/opticsgs error 404??
I stopped developing that since it wouldnt work
I stopped developing that since it wouldnt work
oka, nad closes this thread if it is no longer necessary.