SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | WINDOW_W 640 |
#define | WINDOW_H 480 |
#define | NUM_SPRITES 100 |
#define | MAX_SPEED 1 |
Functions | |
static void | quit (int rc) |
SDL_Texture * | LoadSprite (SDL_Renderer *renderer, char *file) |
void | MoveSprites (SDL_Renderer *renderer, SDL_Texture *sprite) |
int | main (int argc, char *argv[]) |
Variables | |
static NativeWindowFactory * | factories [] |
static NativeWindowFactory * | factory = NULL |
static void * | native_window |
static SDL_Rect * | positions |
static SDL_Rect * | velocities |
#define MAX_SPEED 1 |
Definition at line 23 of file testnative.c.
Referenced by main().
#define NUM_SPRITES 100 |
Definition at line 22 of file testnative.c.
Referenced by main(), and MoveSprites().
#define WINDOW_H 480 |
Definition at line 21 of file testnative.c.
Referenced by main().
#define WINDOW_W 640 |
Definition at line 20 of file testnative.c.
Referenced by main().
SDL_Texture* LoadSprite | ( | SDL_Renderer * | renderer, |
char * | file | ||
) |
Definition at line 53 of file testnative.c.
References SDL_Surface::format, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, and sprite.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 123 of file testnative.c.
References NativeWindowFactory::CreateNativeWindow, done, SDL_WindowEvent::event, SDL_Rect::h, i, LoadSprite(), MAX_SPEED, MoveSprites(), NULL, NUM_SPRITES, quit(), renderer, SDL_CreateRenderer, SDL_CreateWindowFrom, SDL_GetCurrentVideoDriver, SDL_GetError, SDL_GetWindowSize, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_malloc, SDL_PollEvent, SDL_QueryTexture, SDL_QUIT, SDL_RenderClear, SDL_SetRenderDrawColor, SDL_SetWindowTitle, SDL_strcmp, SDL_VideoInit, SDL_WINDOWEVENT, SDL_WINDOWEVENT_EXPOSED, sprite, sprite_h, sprite_w, SDL_Event::type, SDL_Rect::w, SDL_Event::window, WINDOW_H, window_h, WINDOW_W, window_w, SDL_Rect::x, and SDL_Rect::y.
void MoveSprites | ( | SDL_Renderer * | renderer, |
SDL_Texture * | sprite | ||
) |
Definition at line 84 of file testnative.c.
References SDL_Rect::h, i, NULL, NUM_SPRITES, SDL_QueryTexture, SDL_RenderClear, SDL_RenderCopy, SDL_RenderGetViewport, SDL_RenderPresent, SDL_SetRenderDrawColor, sprite_h, sprite_w, viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by main().
|
static |
Definition at line 43 of file testnative.c.
References NativeWindowFactory::DestroyNativeWindow, and SDL_VideoQuit.
Referenced by main().
|
static |
Definition at line 25 of file testnative.c.
|
static |
Definition at line 37 of file testnative.c.
|
static |
Definition at line 38 of file testnative.c.
|
static |
Definition at line 39 of file testnative.c.
|
static |
Definition at line 39 of file testnative.c.