Search code examples
javawindowsopengllwjgl

Java LWJGL new Rendering issue windows


I have been working on a simple LWJGL practice project for a bit and just recently stumbled into a new issue. Now with every project i due i save working backups in multiple places. I was running a Windows 8.1 OS and recently upgraded to Windows 10 and suddenly all of my backups and current program have the rendering error as seen below. I've tried to run my program on a windows 8.1 OS and it works fine there.

Is there some new windows driver update that could be causing this rendering issue?

Or is there some incompatibility with windows 10 and LWJGL i havn't been able to find out about?

enter image description here

enter image description here


Solution

  • Try this: before you render any objects into your world, make sure you are using the inbuilt depth testing, this can be done by using this line of code:

    GL11.glEnable(GL11.GL_DEPTH_TEST);

    This should work for you, as it is forgotten in most cases that this happens!

    -Kore

    EDIT: Also dont forget to clear the buffer aswell!! GL11.glClear(GL11.GL_COLOR_BUFFER_BIT|GL11.GL_DEPTH_BUFFER_BIT);