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

How draw on a background? #897

Open
sp00ck opened this issue Sep 7, 2019 · 4 comments
Open

How draw on a background? #897

sp00ck opened this issue Sep 7, 2019 · 4 comments

Comments

@sp00ck
Copy link

sp00ck commented Sep 7, 2019

What I made wrong? Is possible draw a line directly on background?

       /* ------- /nuklear/demo/sdl_opengl3 but must working on every backend ------ */

        /* Draw */
        SDL_GetWindowSize(win, &win_width, &win_height);
        glViewport(0, 0, win_width, win_height);
        glClear(GL_COLOR_BUFFER_BIT);
        glClearColor(bg.r, bg.g, bg.b, bg.a);


        nk_stroke_line( (struct nk_command_buffer *)&((ctx->current)->buffer), 0, 0, 1280, 800, 2, nk_rgb(255,0,0));



        nk_sdl_render(NK_ANTI_ALIASING_ON, MAX_VERTEX_MEMORY, MAX_ELEMENT_MEMORY);
        SDL_GL_SwapWindow(win);
    }

cleanup:
    nk_sdl_shutdown();
    SDL_GL_DeleteContext(glContext);
    SDL_DestroyWindow(win);

meybe
nk_stroke_line( (struct nk_command_buffer *)&((ctx->current)->buffer), ...
this are wrong? Anybody can tell me how correct it?

@dumblob
Copy link
Contributor

dumblob commented Sep 7, 2019

Assuming you're trying to modify the demo/sdl_opengl3/main.c, you have to write everything between nk_begin() and nk_end(), otherwise it won't work.

@xor256
Copy link

xor256 commented Oct 17, 2019

Can You show any example?

@hbiblia
Copy link

hbiblia commented Nov 15, 2019

¿Puedes mostrar algún ejemplo?
@xor256 @sp00ck
https://github.com/vurtun/nuklear/blob/master/example/canvas.c

@fab1an2
Copy link

fab1an2 commented Nov 20, 2019

@hbiblia Your link are not answer because this can draw on background and DONT draw menu , windows etc.
Problem are how using both
menu and draw on background

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

No branches or pull requests

5 participants