Created
November 27, 2008 06:20
-
-
Save teamon/29699 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* allegro | |
* | |
* Created by teamon on 08-11-20. | |
* Copyright (c) 2008 __MyCompanyName__. All rights reserved. | |
*/ | |
#include <Allegro/allegro.h> | |
#include <math.h> | |
int main(int argc, const char *argv[]) | |
{ | |
allegro_init(); | |
install_keyboard(); | |
if (set_gfx_mode(GFX_AUTODETECT, 600, 600, 0, 0)) { | |
allegro_message("Error setting 320x200x8 gfx mode:\n%s\n", allegro_error); | |
return -1; | |
} | |
int r,g,b; | |
int x=0, y=1; | |
float t=0; | |
float a = 1; | |
int h = 0; | |
while(1) | |
{ | |
x = a * sin(t); | |
y = a * cos(t); | |
t += 0.00001; | |
a += 0.00003; | |
//clear(screen); | |
h++; | |
hsv_to_rgb((h/10000) % 360, 100, 80, &r, &g, &b); | |
circlefill(screen, 300+x, 300+y, 1, makecol(r, g, b)); | |
//circlefill(screen, 20, 20+h, 15, makecol(r, g, b)); | |
} | |
return 0; | |
} | |
END_OF_MAIN(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment