gave window a title, generated pixels differently
git-svn-id: svn://anubis/gvsu@313 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
9700421226
commit
ec3ac34994
@ -9,6 +9,8 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#define PROGNAME "Josh's CS677 Final : MPI Fractal Generator"
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
int width = 800;
|
||||
@ -30,11 +32,17 @@ int main(int argc, char * argv[])
|
||||
cerr << "Failed to set video mode!" << endl;
|
||||
return 2;
|
||||
}
|
||||
SDL_WM_SetCaption(PROGNAME, PROGNAME);
|
||||
|
||||
Uint32 * pixels = (Uint32 *) screen->pixels;
|
||||
Uint32 c;
|
||||
for (c = 0; c < width * height; c++)
|
||||
*pixels++ = c;
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
*pixels++ = (((x * 255 / width) & 0xFF) << 8)
|
||||
+ ((y * 255 / height) & 0xFF);
|
||||
}
|
||||
}
|
||||
SDL_UpdateRect(screen, 0, 0, 0, 0);
|
||||
|
||||
bool going = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user