I am using TGUI compiled with GLFW, it works well for common widgets like buttons and message boxes.
How can I render an OpenGL scene on tgui::CanvasOpenGl3 widget?
My code looks like below::
`#include <gl/glew.h>
auto canvas = tgui::CanvasOpenGL3::create({200,200});
canvas->setPosition(300, 200);
gui.add(canvas); canvas->bindFramebuffer();
'
`auto canvas_size_button = tgui::Button::create("Get canvas size");
gui.add(canvas_size_button);
// few other widgets added here
while (!glfwWindowShouldClose(window)){
glUseProgram(shaderProgram);
gui.draw();
glDrawArrays(GL_LINES, 0, 2);
}`
I am using GLEW with this.
but it does not work. It only show other widgets placed into `gui` and they work well.
Appreciate if an example show how to render a simple triangle on Canvas along side with few simple widgets like buttons. or point to the correct way.
Thanks
How can I render an OpenGL scene on tgui::CanvasOpenGl3 widget?
My code looks like below::
`#include <gl/glew.h>
auto canvas = tgui::CanvasOpenGL3::create({200,200});
canvas->setPosition(300, 200);
gui.add(canvas); canvas->bindFramebuffer();
'
`auto canvas_size_button = tgui::Button::create("Get canvas size");
gui.add(canvas_size_button);
// few other widgets added here
while (!glfwWindowShouldClose(window)){
glUseProgram(shaderProgram);
gui.draw();
glDrawArrays(GL_LINES, 0, 2);
}`
I am using GLEW with this.
but it does not work. It only show other widgets placed into `gui` and they work well.
Appreciate if an example show how to render a simple triangle on Canvas along side with few simple widgets like buttons. or point to the correct way.
Thanks