nuklear
nuklear copied to clipboard
How draw on main window in SDL2 OpenGl3
I download a demo/sdl_opengl3, it working.
How draw a line on main window? Where i can put my code? i put it after /* draw */ but not working
/* Draw exist in demo */
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);
/* my code */
glLineWidth(2);
glColor3f(0.80, 0.0, 0.0);
glBegin(GL_LINES);
glVertex2i(10,10);
glVertex2i(200,320);
glEnd();
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_POINTS);
glVertex2i(50, 50);
glEnd();
glFlush();
this same file https://gist.github.com/sp00ck/b96cd160b12443ae23365cf4d759de63
Is possible using SDL function draw line etc? Where are stored renderer?
I joining canvas and normal example but dont work
https://gist.github.com/letarg0/56dd1aa3beb01bf74b420745a49dc0b3
How change background content not only color. How draw primitives on background?
it is nk_sdl_render() function that draws on screen, maybe your lines and points are being overwritten by it?
@irtusb
it is nk_sdl_render() function that draws on screen, maybe your lines and points are being overwritten by it?
This function draw everything. How draw Line?
Simple, tell how draw line in demo file. Draw a simple rectangle. Show diff etc.
Do You know?
@irtusb ok, how draw before nk_sdl_render() ? can You tell me where put SLD_ draw line (0,0,400,400)
you are using openGL, SDL_drawline and similar won't work. you need glLine or whatever it is called
@irtusb Can You explain how do this? My code using glLineWidth(2); etc. But not working. Can You show answer?
I only do plain sdl, sorry but I cannot help you more in that regard
El sáb., 9 mar. 2019 7:18, Łukasz Marek [email protected] escribió:
@irtusb https://github.com/irtusb Can You explain how do this? My code using glLineWidth(2); etc. But not working. Can You show answer?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vurtun/nuklear/issues/799#issuecomment-471164549, or mute the thread https://github.com/notifications/unsubscribe-auth/AASVp8liNf1imEen-9Kr8MRoANvyMZCnks5vU4pogaJpZM4a0DXd .