I’ve been staring at this code for too long… it’s the usual problem that the screen is all black. The model loaded is a square with x,y,z,u,v (ply: http://sprunge.us/KHbZ). For now I don’t use the uv coordinates and not the
texture either: just drawing red (trying to).
Here’s the relevant code: https://bpaste.net/show/274aea06d970 and the main loop: https://bpaste.net/show/3ac88afda6f0
The camera is 3 units away from origin, looking at origin (radius = 3).
setFormat and createShaderProgram should work fine, so forget about them.
Here’s a record of what my PLY-reading code adds to the VBO and EBO: https://bpaste.net/show/5b7e706c8351
It’s all black no matter what I do. I tried disabling culling and depth buffer. I tried not uploading texture and removing the UV and UV_f attributes and the tex uniform, using this instead of setFormat as I needed to set stride to 5 floats:
GLint attrib = glGetAttribLocation(square_prg, "XYZ");
assert(attrib != -1);
glEnableVertexAttribArray(attrib);
glVertexAttribPointer(attrib, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void*)((intptr_t)(0)));
I’ve often had the problem that the screen is black at first, but it’s usually not this hard to find the error - I really cannot see what I’m doing wrong.
Thanks in advance.