gluperspective causes blackout

Simply put the gluPerspective call creates a black screen. If I comment out gluPerspective, the white triangle persists as predicted.
I've researched this problem, however it seems when people have solved it they don't stick around and document the answer. I've checked it against github however I am not using visual studio ide.

You draw your triangle with z = 0. Look at the third parameter of your glVertex calls.

So your triangle is being discarded by your near clipping plane and OpenGL is just doing what you told it to do.

This isn't a problem, error or bug. This is OpenGL working the way it should and it would be a problem if it didn't.

Calling gluLookat isn't some kind of secret sauce or magic trick. All that does is position a viewpoint, but you're calling it on your projection matrix which is a little weird. This kind of thing is only going to lead you down the route of picking up bad habits without understanding what you're doing or why you're doing it. Better to get rid of that gluLookat nonsense and go back and understand what caused your original problem: You drew your triangle with Z= 0 and it was discarded by your near clipping plane. The fix isn't to parachute in another bunch of code that you don't understand. The fix is to draw it with the correct Z values. Try drawing it with Z = 5 and Z = -5. What happens? Then try it with 10 and -10. Now what happens? Does that help you understand how the Z values in your glVertex calls work?

Calling gluLookat isn't some kind of secret sauce or magic trick. All that does is position a viewpoint, but you're calling it on your projection matrix which is a little weird. This kind of thing is only going to lead you down the route of picking up bad habits without understanding what you're doing or why you're doing it.

Moreover, this is going to cause you problems in the future that will show you why you should be putting the viewing (e.g. gluLookAt) transform on the MODELVIEW stack rather than the PROJECTION stack. Read this: