partial conversion to OpenGL
fix compilation errors