I made a mini-application in Java LWJGL and made a loop for rendering, but the trouble is: the window just freezes, and if you hover the bear, the bear icon will change to loading. Here is the code:
protected void gameLoop() {
while(!window.windowShouldClose()){
// TODO: UPDATE
Renderer.getInstance().render();
}
}
(Renderer#render())
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glClearColor(43f / 255f, 43f / 255f, 43f / 255f, 0f);
glfwPollEvents();
for (IRenderable render : objects){
render.render();
}
glDisable(GL_TEXTURE_2D);
and yes, if I do not call gameLoop then the window opens and immediately closes