p8g icon indicating copy to clipboard operation
p8g copied to clipboard

[Feature]: Add setup function

Open bernhardfritz opened this issue 2 years ago • 0 comments

Describe your idea

As brought up by iddq_tea on discord https://discord.com/channels/959169147550445598/959169147550445601/1028975291667841114, there is no setup function in p8g. I have stated my concerns about a dedicated setup function, but I can also see why a setup function could be handy.

Problem:

  • Right now globals like width, height can only be used inside of draw, which requires cumbersome workarounds where you need to define another constant like WIDTH in order to use it before draw loop is started.

Options:

  • Provide a setup function that is called right before the first frame is rendered.
  • Remove globals altogether

bernhardfritz avatar Nov 20 '22 20:11 bernhardfritz