Subject: | Depth buffer setting (GLX_DEPTH_SIZE) missing in light example script |
The example script "light" is missing a setting for GLX_DEPTH_SIZE in
the call shown below:
glpOpenWindow(width=>300,height=>300,
attributes=> [GLX_DOUBLEBUFFER,GLX_RGBA,GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE,1]);
This causes the object to appear mangled; depth testing is not working
so rear facets cover front facets.
This fixes the problem:
glpOpenWindow(width=>300,height=>300,
attributes=> [GLX_DOUBLEBUFFER,GLX_RGBA,
GLX_DEPTH_SIZE, 16,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE,1]);
I've seen 16 used for GLX_DEPTH_SIZE in other sample code; I believe
this is saying "allow 64k overlapping windows", which sounds like enough.