graphichandler: texture creation function