#include #include "SDL/SDL.h" #include //constants const int horizontalRez = 1400; const int verticalRez = 1050; const int maxStars = 1500; const int updateTime = 30; const int centerX = horizontalRez/2; const int centerY = verticalRez/2; const int Scale = 900; //star object struct star { int x,y,z; }; //array of Stars star starField[maxStars]; // Function prototypes void initStars(void); void putpixel(SDL_Surface *S, int x, int y, int color); void drawStar(SDL_Surface *S); void updateStars(void); void initStars(void){ int i; for (i=0;ipixels; pixels[(S->pitch * y / 4) + x] = color; } void drawStar(SDL_Surface *S){ int i; int xcoord; int ycoord; int b; int c; SDL_FillRect(S, NULL, 0x000000); for (i=0;i 0 && ycoord > 0) putpixel(S, xcoord, ycoord, SDL_MapRGB(S->format, 255, 255, 255)); } } void updateStars(void){ int i; for (i=0;i