Skip to content

Creating a screen

In this guide, you will create a basic DirectGPU screen, clear it, and draw your first text.

Before starting, make sure you have:

  • CC:Tweaked (preferably newest!) installed
  • DirectGPU (preferably newest!) installed
  • A computer with a DirectGPU peripheral attached

First, get the DirectGPU peripheral:

local gpu = peripheral.find("directgpu")

Then you will be able to use autoDetectAndCreateDisplay to create a display.

local displayId = gpu.autoDetectAndCreateDisplay()

Which will then allow you to run all commands of sorts.

gpu.clear(displayId, 0, 0, 0)

But then remember, updateDisplay is a requirement to draw all elements onto the monitor.

gpu.updateDisplay(displayId)