local graphics = {} local component = require("component") graphics.gpu = component.gpu graphics.w, graphics.h = graphics.gpu.getResolution() local gpu = graphics.gpu function graphics.clearScreen() gpu.setBackground(0x000000) gpu.fill(1,1,graphics.w,graphics.h," ") end function graphics.setGPU(gpu_proxy) graphics.gpu = gpu_proxy gpu = graphics.gpu graphics.w, graphics.h = graphics.gpu.getResolution() end function graphics.bind_to_screen(screen_addr) graphics.gpu.bind(screen_addr) end function graphics.getGPU() return graphics.gpu end function graphics.setResolution(x,y) graphics.gpu.setResolution(x,y) graphics.w, graphics.h = graphics.gpu.getResolution() end return graphics