Task

Create a window and draw a pixel in it, subject to the following:

  the window is 320 x 240
  the color of the pixel must be red (255,0,0)
  the position of the pixel is x = 100, y = 100
import rapid/gfx
 
var
  window = initRWindow()
    .size(320, 240)
    .title("Rosetta Code - draw a pixel")
    .open()
  surface = window.openGfx()
 
surface.loop:
  draw ctx, step:
    ctx.clear(gray(0))
    ctx.begin()
    ctx.point((100.0, 100.0, rgb(255, 0, 0)))
    ctx.draw(prPoints)
    discard step # Prevent unused variable warnings
  update step:
    discard step