void WINAPI glReadPixels(
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid *pixels
);
GLAPI void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
Referring to the table of typedef's in gl.h, I converted the GL datatypes into the standard APL #WCALL datatypes. So in the [Call] section of my APLW.INI file, I added this entry:
glReadPixels=(I x, I y, I width, I height, U format, U type, *C pixels) LIB Opengl32
In APL, I execute (displayed using ]apl2ascii):
pPix {<-} #WCALL 'GlobalAlloc' 'GMEM_FIXED' 1000000
#WCALL 'glReadPixels' 100 100 200 200 0x1907 0x1404 pPix
@ 100=x coordinate, 100=y coordinate, 200=width, 200=height,
@ 0x1907 is GL_RGB, 0x1404 is GL_INT, pPix is pointer to pixel array.
#WCALL 'GetLastError'
126
pix {<-} #WCALL 'W_Mem' (pPix 323 250000)
Unfortunately, GetLastError shows error 126 occurred, which is "The specified module could not be found." And of course <pix> remains all 0's.
I don't understand why this should be. Opengl32.dll exists in c:\windows\system32 as well as c:\windows\syswow64. So I assume there's something wrong with how I've entered the function prototype. Or there's something fundamental that I don't understand about OpenGL.
Does anyone have any ideas? Thanks.