split up sources
now working when converted to opengl