I'm currently trying to render a green cube rotating on the spot and I'm having an issue where the cubes vertices are going all over the place. I've opened the program through render doc and everything is perfect except for the VS out section, where the cube is going crazy and every time I run the program the VS output seems to be dramatically different even when I don't change the code. With this in mind I think it's most likely an issue with the way I've written the perspective matrix function. The perspective matrix is in source/math.c.
I've also written all the matrixes using single dimension arrays, so maybe opengl treats them differently to two dimensional arrays, which are what the GLM maths library uses and learn opengl.com uses GLM, so maybe it's something to do with that, but not sure.
I'm a newbie programmer, so it could be something opengl related that I did or didn't do, either way I'm open to suggestions and feel free to ask questions.
source: https://github.com/BobbysAccount/BasicOpenglRenderer/tree/main