I found a crazy mistake in my code.
I had written the following line:
GLfloat* points = new GLfloat(1024);
rather than
GLfloat* points = new GLfloat[1024];
I only just noticed it. My code has compiled and run a few times before I noticed the error. I realize that this is by fluke, but my question is what does the line I originally had do?
I notice that it looks kind of like the creation of a class using a pointer to allocated memory. Does it create a single GLfloat on the heap with the initial value of 1024.0
? If this is true, why is it valid syntax? (GLfloat is not a class, is it?)