SDL
2.0
|
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "SDL_test.h"
#include "SDL_test_common.h"
Go to the source code of this file.
Macros | |
#define | NUM_SPRITES 100 |
#define | MAX_SPEED 1 |
Functions | |
static void | quit (int rc) |
int | LoadSprite (const char *file) |
void | MoveSprites (SDL_Renderer *renderer, SDL_Texture *sprite) |
void | loop () |
int | main (int argc, char *argv[]) |
Variables | |
static SDLTest_CommonState * | state |
static int | num_sprites |
static SDL_Texture ** | sprites |
static SDL_bool | cycle_color |
static SDL_bool | cycle_alpha |
static int | cycle_direction = 1 |
static int | current_alpha = 0 |
static int | current_color = 0 |
static SDL_Rect * | positions |
static SDL_Rect * | velocities |
static int | sprite_w |
static int | sprite_h |
static SDL_BlendMode | blendMode = SDL_BLENDMODE_BLEND |
static int | iterations = -1 |
int | done |
#define MAX_SPEED 1 |
Definition at line 26 of file testsprite2.c.
Referenced by main().
#define NUM_SPRITES 100 |
Definition at line 25 of file testsprite2.c.
Referenced by main().
int LoadSprite | ( | const char * | file | ) |
Definition at line 59 of file testsprite2.c.
References SDL_PixelFormat::BitsPerPixel, blendMode, SDL_Surface::format, SDL_Surface::h, i, NULL, SDLTest_CommonState::num_windows, SDL_PixelFormat::palette, SDL_Surface::pixels, renderer, SDLTest_CommonState::renderers, SDL_CreateTextureFromSurface, SDL_DestroyTexture, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, SDL_SetTextureBlendMode, sprite_h, sprite_w, and SDL_Surface::w.
Referenced by main().
void loop | ( | ) |
Definition at line 245 of file testsprite2.c.
References done, i, MoveSprites(), NULL, SDLTest_CommonState::num_windows, SDLTest_CommonState::renderers, SDL_PollEvent, SDLTest_CommonEvent(), and SDLTest_CommonState::windows.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 267 of file testsprite2.c.
References blendMode, cycle_alpha, cycle_color, done, SDL_Rect::h, i, iterations, LoadSprite(), loop(), MAX_SPEED, NULL, NUM_SPRITES, num_sprites, SDLTest_CommonState::num_windows, quit(), renderer, SDLTest_CommonState::renderers, SDL_atoi, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ZERO, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_BLENDOPERATION_SUBTRACT, SDL_ComposeCustomBlendMode, SDL_GetTicks(), SDL_INIT_VIDEO, SDL_isdigit, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_malloc, SDL_RenderClear, SDL_SetRenderDrawColor, SDL_strcasecmp, SDL_TRUE, SDLTest_CommonArg(), SDLTest_CommonCreateState(), SDLTest_CommonInit(), SDLTest_CommonUsage(), SDLTest_FuzzerInit(), SDLTest_RandomIntegerInRange(), sprite_h, sprite_w, SDL_Rect::w, SDLTest_CommonState::window_h, SDLTest_CommonState::window_w, SDL_Rect::x, and SDL_Rect::y.
void MoveSprites | ( | SDL_Renderer * | renderer, |
SDL_Texture * | sprite | ||
) |
Definition at line 116 of file testsprite2.c.
References current_alpha, current_color, cycle_alpha, cycle_color, cycle_direction, SDL_Rect::h, i, iterations, NULL, num_sprites, SDL_FALSE, SDL_RenderClear, SDL_RenderCopy, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderGetViewport, SDL_RenderPresent, SDL_SetRenderDrawColor, SDL_SetTextureAlphaMod, SDL_SetTextureColorMod, sprite_h, sprite_w, viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
|
static |
Definition at line 49 of file testsprite2.c.
References SDL_free, and SDLTest_CommonQuit().
Referenced by main().
|
static |
Definition at line 39 of file testsprite2.c.
Referenced by LoadSprite(), and main().
|
static |
Definition at line 34 of file testsprite2.c.
Referenced by MoveSprites().
|
static |
Definition at line 35 of file testsprite2.c.
Referenced by MoveSprites().
|
static |
Definition at line 32 of file testsprite2.c.
Referenced by main(), and MoveSprites().
|
static |
Definition at line 31 of file testsprite2.c.
Referenced by main(), and MoveSprites().
|
static |
Definition at line 33 of file testsprite2.c.
Referenced by MoveSprites().
int done |
Definition at line 45 of file testsprite2.c.
|
static |
Definition at line 43 of file testsprite2.c.
Referenced by main(), and MoveSprites().
|
static |
Definition at line 29 of file testsprite2.c.
Referenced by main(), and MoveSprites().
|
static |
Definition at line 36 of file testsprite2.c.
|
static |
Definition at line 38 of file testsprite2.c.
Referenced by LoadSprite(), main(), and MoveSprites().
|
static |
Definition at line 38 of file testsprite2.c.
Referenced by LoadSprite(), main(), and MoveSprites().
|
static |
Definition at line 30 of file testsprite2.c.
|
static |
Definition at line 28 of file testsprite2.c.
|
static |
Definition at line 37 of file testsprite2.c.