Google
Web alhem.net
Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

InitSDL Class Reference

#include <InitSDL.h>

List of all members.

Public Member Functions

 InitSDL (int argc, char *argv[])
 ~InitSDL ()
void DrawBox (int X, int Y)


Detailed Description

File ......... InitSDL.h Published .... 2005-02-07 Author ....... grymse@alhem.net

Definition at line 27 of file InitSDL.h.


Constructor & Destructor Documentation

InitSDL::InitSDL int  argc,
char *  argv[]
 

File ......... InitSDL.cpp Published .... 2005-02-07 Author ....... grymse@alhem.net

Definition at line 29 of file InitSDL.cpp.

References InitSDL().

Referenced by InitSDL().

00029 : gui::SDLControl(argc,argv) 00030 { 00031 }

InitSDL::~InitSDL  ) 
 

Definition at line 34 of file InitSDL.cpp.

00035 { 00036 }


Member Function Documentation

void InitSDL::DrawBox int  X,
int  Y
 

Definition at line 40 of file InitSDL.cpp.

References DrawBox(), NUM_COLORS, X, XMAX, Y, and YMAX.

Referenced by DrawBox().

00041 { 00042 static unsigned int seeded = 0; 00043 SDL_Rect area; 00044 Uint32 color; 00045 00046 /* Seed the random number generator */ 00047 if ( seeded == 0 ) 00048 { 00049 srand(time(NULL)); 00050 seeded = 1; 00051 } 00052 00053 /* Get the bounds of the rectangle */ 00054 area.w = (rand() % XMAX); 00055 area.h = (rand() % YMAX); 00056 area.x = X - (area.w / 2); 00057 area.y = Y - (area.h / 2); 00058 color = (rand() % NUM_COLORS); 00059 color = 0; 00060 00061 /* Do it! */ 00062 LockMutex(); 00063 SDL_FillRect(GetScreen(), &area, color); 00064 SDL_UpdateRects(GetScreen(), 1, &area); 00065 UnlockMutex(); 00066 }


The documentation for this class was generated from the following files:
Generated for SDL C++ GUI by doxygen 1.3.6