I am trying to make a game where an enemy object spawns every 3 seconds and tries to chase your player, but I don't know how I will make a generator that creates an enemy object every 3 seconds.
I already tried this by creating a thread that runs every 3 seconds, but it gives me an error that says
No OpenGL context found in the current thread.
I'm using OpenGL to program displays and textures.