got rid of var casts because opengl was fixed