The API for attaching lights and textures is not only obscure, but has essentially no error conditions: the stupidest mistakes are technically "legal", so you can never figure out what went wrong except by staring at the code for days until enlightenment comes. Which is what I'm doing now. That and getting increasingly frustrated, and trying to remember why I thought this would be a "fun" thing to hack on.
After having been hacking OpenGL for years, and even having written Lightlab to help me figure it out, I think I understand the OpenGL lighting model -- but I still feel like I just have no idea how to do lights in GL. I understand how ambient, diffuse, and specular coloration are computed, but when it comes to actually making the dozen glLightfv() and glMaterialfv() calls, everything goes totally nonlinear, and I end up spending days just trying random things until I find something that almost doesn't look totally like ass.