Closed 4ndyc closed 10 months ago
Interesting, and this is quite old code!
Indeed, from glext.h:
GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer);
the arguments are incorrect
Does rendering look OK with stride=0? It is defined as "specifies the byte offset between consecutive fog coordinates" and I see mesa fog demo program uses default too so this looks like acceptable fix: https://gitlab.freedesktop.org/mesa/demos/-/blob/main/src/demos/fogcoord.c#L397
I've only tested a couple of games so far but they seem to be fine. Apparently stride=0 indicates the array is tightly packed so I think it's either 0 or sizeof(GLfloat) in this instance.
Testing with dosbox-x and qemu-3dfx, EnableVertexArrayEXT=1 causes the program to crash. The cause appears to be the arguments to p_glFogCoordPointerEXT in RenderUpdateArrays are incorrect. The following seems to solve the problem:
p_glFogCoordPointerEXT( GL_FLOAT, 0, &OGLRender.TFog[0] );