p8g
p8g copied to clipboard
[Feature]: Add setup function
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 ofdraw
, which requires cumbersome workarounds where you need to define another constant likeWIDTH
in order to use it beforedraw
loop is started.
Options:
- Provide a setup function that is called right before the first frame is rendered.
- Remove globals altogether