diff --git a/src/main.c b/src/main.c index 8dc409b..d5efa9f 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,33 @@ #include +Line l; + +void render(){ + //Clear the bitmap + BMP_clear(); + + //Draw the line defined above (in the background, hidden) + BMP_drawLine(&l); + + //Flip the data to the screen - i.e. actually draw the complete image on screen + BMP_flip(1); + + //Increment the destination y coordinate + l.pt2.y = l.pt2.y + 2; + + //Reset the destination y coordinate if it hits 160 + if (l.pt2.y == 160) + { + l.pt2.y = 0; + } + +} + +void update(){ + + +} + int main() { @@ -14,7 +42,6 @@ int main() VDP_setBackgroundColor(13); //A line needs a source coordinate x,y and a destination coordinate x,y along with a pallete colour. - Line l; l.pt1.x = 0; l.pt1.y = 0; l.pt2.x = 255; @@ -24,23 +51,7 @@ int main() while(TRUE) { - //Clear the bitmap - BMP_clear(); - - //Draw the line defined above (in the background, hidden) - BMP_drawLine(&l); - - //Flip the data to the screen - i.e. actually draw the complete image on screen - BMP_flip(1); - - //Increment the destination y coordinate - l.pt2.y = l.pt2.y + 2; - - //Reset the destination y coordinate if it hits 160 - if (l.pt2.y == 160) - { - l.pt2.y = 0; - } + render(); } return 0; } \ No newline at end of file