SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | NUM_HAPPY_FACES 100 /* number of faces to draw */ |
#define | HAPPY_FACE_SIZE 32 /* width and height of happyface */ |
Functions | |
void | initializeHappyFaces (SDL_Renderer *renderer) |
void | render (SDL_Renderer *renderer, double deltaTime) |
void | initializeTexture (SDL_Renderer *renderer) |
int | main (int argc, char *argv[]) |
Variables | |
static SDL_Texture * | texture = 0 |
struct { | |
float x | |
float y | |
float xvel | |
float yvel | |
} | faces [NUM_HAPPY_FACES] |
Definition at line 11 of file happy.c.
Referenced by initializeHappyFaces(), and render().
Definition at line 10 of file happy.c.
Referenced by initializeHappyFaces(), and render().
void initializeHappyFaces | ( | SDL_Renderer * | renderer | ) |
Definition at line 26 of file happy.c.
References faces, HAPPY_FACE_SIZE, i, NUM_HAPPY_FACES, randomFloat(), and SDL_RenderGetLogicalSize.
Referenced by main().
void initializeTexture | ( | SDL_Renderer * | renderer | ) |
Definition at line 106 of file happy.c.
References fatalError(), SDL_Surface::format, NULL, SDL_BLENDMODE_BLEND, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_LoadBMP, SDL_MapRGB, SDL_SetColorKey, and SDL_SetTextureBlendMode.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 130 of file happy.c.
References done, fatalError(), initializeHappyFaces(), initializeTexture(), NULL, render(), renderer, SDL_CreateRenderer, SDL_CreateWindow, SDL_Delay, SDL_DestroyTexture, SDL_GetWindowSize, SDL_Init, SDL_INIT_VIDEO, SDL_PollEvent, SDL_Quit, SDL_QUIT, SDL_RenderSetLogicalSize, SDL_WINDOW_ALLOW_HIGHDPI, SDL_WINDOW_FULLSCREEN, SDL_Event::type, and updateDeltaTime().
void render | ( | SDL_Renderer * | renderer, |
double | deltaTime | ||
) |
Definition at line 42 of file happy.c.
References faces, SDL_Rect::h, HAPPY_FACE_SIZE, i, NUM_HAPPY_FACES, SDL_RenderClear, SDL_RenderCopy, SDL_RenderGetLogicalSize, SDL_RenderPresent, SDL_SetRenderDrawColor, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by main().
struct { ... } faces[NUM_HAPPY_FACES] |
Referenced by initializeHappyFaces(), and render().
|
static |