move general rendering stuff to baseclass for gl support