gvsu/cs677/final/mpi-fractals.cc
josh 9700421226 added Makefile mpi-fractals.cc
git-svn-id: svn://anubis/gvsu@312 45c1a28c-8058-47b2-ae61-ca45b979098e
2008-12-06 18:58:13 +00:00

55 lines
1.1 KiB
C++

/*
* Josh Holtrop
* 2008-12-11
* barebones SDL program
*/
#include <SDL/SDL.h>
#include <mpi.h>
#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
int width = 800;
int height = 600;
SDL_Surface * screen;
SDL_Event event;
if (SDL_Init(SDL_INIT_VIDEO))
{
cerr << "Failed to initialize SDL!" << endl;
return 1;
}
atexit(SDL_Quit);
if (!(screen = SDL_SetVideoMode(width, height, 32, 0)))
{
cerr << "Failed to set video mode!" << endl;
return 2;
}
Uint32 * pixels = (Uint32 *) screen->pixels;
Uint32 c;
for (c = 0; c < width * height; c++)
*pixels++ = c;
SDL_UpdateRect(screen, 0, 0, 0, 0);
bool going = true;
while (going && SDL_WaitEvent(&event) != 0)
{
switch (event.type)
{
case SDL_QUIT:
going = false;
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_q)
going = false;
break;
}
}
}