new render function
This commit is contained in:
parent
6ab95bff58
commit
3b95d24e5e
47
src/main.c
47
src/main.c
@ -1,5 +1,33 @@
|
||||
#include <genesis.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user