SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | WINDOW_WIDTH 640 |
#define | WINDOW_HEIGHT 480 |
#define | NUM_SPRITES 100 |
#define | MAX_SPEED 1 |
Functions | |
static void | quit (int rc) |
int | LoadSprite (char *file, SDL_Renderer *renderer) |
void | MoveSprites (SDL_Renderer *renderer, SDL_Texture *sprite) |
void | loop () |
int | main (int argc, char *argv[]) |
Variables | |
static SDL_Texture * | sprite |
static SDL_Rect | positions [NUM_SPRITES] |
static SDL_Rect | velocities [NUM_SPRITES] |
static int | sprite_w |
static int | sprite_h |
SDL_Renderer * | renderer |
int | done |
#define MAX_SPEED 1 |
Definition at line 27 of file testspriteminimal.c.
Referenced by main().
#define NUM_SPRITES 100 |
Definition at line 26 of file testspriteminimal.c.
Referenced by main(), and MoveSprites().
#define WINDOW_HEIGHT 480 |
Definition at line 25 of file testspriteminimal.c.
Referenced by main(), and MoveSprites().
#define WINDOW_WIDTH 640 |
Definition at line 24 of file testspriteminimal.c.
Referenced by main(), and MoveSprites().
int LoadSprite | ( | char * | file, |
SDL_Renderer * | renderer | ||
) |
Definition at line 45 of file testspriteminimal.c.
References SDL_PixelFormat::BitsPerPixel, SDL_Surface::format, SDL_Surface::h, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, SDL_TRUE, sprite_h, sprite_w, and SDL_Surface::w.
Referenced by main().
void loop | ( | ) |
Definition at line 128 of file testspriteminimal.c.
References done, MoveSprites(), SDL_KEYDOWN, SDL_PollEvent, SDL_QUIT, and SDL_Event::type.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 147 of file testspriteminimal.c.
References done, SDL_Rect::h, i, LoadSprite(), loop(), MAX_SPEED, NULL, NUM_SPRITES, quit(), SDL_CreateWindowAndRenderer, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogSetPriority, sprite_h, sprite_w, SDL_Rect::w, WINDOW_HEIGHT, WINDOW_WIDTH, SDL_Rect::x, and SDL_Rect::y.
void MoveSprites | ( | SDL_Renderer * | renderer, |
SDL_Texture * | sprite | ||
) |
Definition at line 94 of file testspriteminimal.c.
References i, NULL, NUM_SPRITES, SDL_RenderClear, SDL_RenderCopy, SDL_RenderPresent, SDL_SetRenderDrawColor, sprite_h, sprite_w, window_h, WINDOW_HEIGHT, window_w, WINDOW_WIDTH, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
|
static |
int done |
Definition at line 35 of file testspriteminimal.c.
|
static |
Definition at line 30 of file testspriteminimal.c.
SDL_Renderer* renderer |
Definition at line 34 of file testspriteminimal.c.
|
static |
Definition at line 29 of file testspriteminimal.c.
Referenced by LoadSprite(), and main().
|
static |
Definition at line 32 of file testspriteminimal.c.
Referenced by LoadSprite(), main(), and MoveSprites().
|
static |
Definition at line 32 of file testspriteminimal.c.
Referenced by LoadSprite(), main(), and MoveSprites().
|
static |
Definition at line 31 of file testspriteminimal.c.