First, let me say this code ran perfectly well a few months ago at around 49 FPS. since then, one major thing that has changed is that I "Upgraded" from Windows 7 to 10.
I do have a pretty good system:
- i7-3770K processor (a little dated, but still good)
- 32GB RAM
- GTX 970 4GB video card
- Several SSDs
I have researched this issue for hours and came up with a couple fixes people have tried. Interestingly most centered around late Jan - early Feb '17.
- Uprading to latest NVIDIA drivers (or downgrading)
- Making sure the "Main" is pointing to the correct class
- Verifying all environment variables are set correctly
- Verify all libraries needed are imported corectly
None of these fixed my issue.
Some details about my code and code style. This project is part of a massive undertaking I have been working on for years to create a complete 3D engine through Java and OpenGL using the LWJGL 2.9.3 libraries. The way my code is structured is that I have organized each concept into separate libraries which I then import into any project I am working on.
For example, I have a library called "Foundations" that handles opening the OpenGL window itself, loading settings from external files, and tracking the timing delta and FPS. Another example library is "Text2D" which handles displaying text to the screen.
This way, I can track down bugs more efficiently. Each library has its own testing and diagnostic classes to verify the library is working as intended. Often many different libraries have dependencies to certain specific others and so this testing can be further independently verified.
Problem:
The one I am having trouble with is called "Entity" which handles placing a 3D object into the world. As I said before, I have had this code working before, and can't figure what went wrong.
The code is broken up into setup and testing sections. The setup code generates a grid of objects for me to look around in and move through along with basics like a sunlight source. The testing code simply adds a small spin to each object so they spin in place.
Now, as my test code runs, I see the generated objects in the display window just fine, populating new objects and textures as they load. I get on average 2-4 seconds per frame. (yes, seconds/frame)
After anywhere from 43 seconds to 92 seconds, generating around 12-15 frames, it fails and gives me the following error message:
C:\Users\Zaanzabar\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: -1073740791
BUILD FAILED (total time: 43 seconds)
By inserting mass output messages and figuring out which lines come right after certain messages, I have tracked down the specific lines of code that are causing the slowdown.
While I'm loading textures into the program, everything runs smoothly and swiftly until it reaches the line:
glGenerateMipmap(GL_TEXTURE_2D);
And these are not large textures mind you, biggest one I think is 512x512 in PNG format. I use SlickUtil to load them into OpenGL.
Once I am done loading the textures, it then pauses for about the same amount of time at the line:
Display.update();
And then eventually crashes. Both of these lines of code are openGL features, and no part of my code, so I have run into a wall about where to look from here.
Does anyone know how to fix this issue?