I am beginning to study Nuklear (GitHub - vurtun/nuklear: A single-header ANSI C gui library) to use for my own projects. Now I have an extremely basic code that without the nuklear piece of code displays a texture on the screen, but with the nuklear it look like if it completely disregards the texture drawing. Does someone have any suggestion to solve my problem?
I will copy the render loop here:
do
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/*
// TODO: find out about the problem is happening here when using nuklear
///////////////////
nk_glfw3_new_frame();
if(nk_begin(ctx, "Demo", nk_rect(50, 50, 230, 250),
NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE |
NK_WINDOW_MINIMIZABLE | NK_WINDOW_TITLE))
{
nk_layout_row_static(ctx, 30, 80, 1);
if( nk_button_label(ctx, "test") )
glClearColor(1.0,0,0,1.0);
}
nk_end(ctx);
nk_glfw3_render(NK_ANTI_ALIASING_ON, 512 * 1024, 128 * 1024 );
*/
glUseProgram(programID);
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, this->texID);
glUniform1i(TextureID, 0);
// 1rst attribute buffer : vertices
glEnableVertexAttribArray(0);
glBindBuffer( GL_ARRAY_BUFFER, vertexbuffer );
glVertexAttribPointer(
0,
3,
GL_FLOAT,
GL_FALSE,
0,
(void*) 0
);
// Draw the triangle !
glDrawArrays(GL_TRIANGLES, 0, 6);
glDisableVertexAttribArray(0);
glBindTexture(GL_TEXTURE_2D, 0);
}
glfwSwapBuffers(window);
glfwWaitEvents();
glfwPollEvents();
} // Check if ESC key was pressed or the window was closed
while( glfwGetKey( window, GLFW_KEY_ESCAPE ) != GLFW_PRESS && glfwWindowShouldClose(window) == 0 );