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.
Functions | |
static void | quit (int rc) |
int | LoadSprite (char *file, SDL_Renderer *renderer) |
void | DrawOnViewport (SDL_Renderer *renderer, SDL_Rect viewport) |
void | loop () |
int | main (int argc, char *argv[]) |
Variables | |
static SDLTest_CommonState * | state |
static SDL_Rect | viewport |
static int | done |
static int | j |
static SDL_bool | use_target = SDL_FALSE |
static SDL_Texture * | sprite |
static int | sprite_w |
static int | sprite_h |
void DrawOnViewport | ( | SDL_Renderer * | renderer, |
SDL_Rect | viewport | ||
) |
Definition at line 95 of file testviewport.c.
References SDL_Rect::h, NULL, rect, renderer, SDL_QueryTexture, SDL_RenderClear, SDL_RenderCopy, SDL_RenderDrawLine, SDL_RenderDrawPoint, SDL_RenderFillRect, SDL_RenderSetClipRect, SDL_RenderSetViewport, SDL_SetRenderDrawColor, sprite, viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
int LoadSprite | ( | char * | file, |
SDL_Renderer * | renderer | ||
) |
Definition at line 46 of file testviewport.c.
References SDL_PixelFormat::BitsPerPixel, SDL_Surface::format, SDL_Surface::h, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, renderer, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, SDL_TRUE, sprite, sprite_h, sprite_w, and SDL_Surface::w.
Referenced by main().
void loop | ( | ) |
Definition at line 149 of file testviewport.c.
References done, DrawOnViewport(), SDL_Rect::h, i, j, NULL, SDLTest_CommonState::num_windows, SDLTest_CommonState::renderers, SDL_GetTicks(), SDL_Log, SDL_PollEvent, SDL_RenderCopy, SDL_RenderPresent, SDL_SetRenderTarget, SDLTest_CommonEvent(), state, SDLTest_CommonState::targets, use_target, viewport, SDL_Rect::w, SDLTest_CommonState::windows, SDL_Rect::x, and SDL_Rect::y.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 198 of file testviewport.c.
References done, frames, i, j, LoadSprite(), loop(), NULL, SDLTest_CommonState::num_windows, quit(), renderer, SDLTest_CommonState::renderers, SDL_CreateTexture, SDL_Delay, SDL_GetTicks(), SDL_GetWindowSize, SDL_INIT_VIDEO, SDL_Log, SDL_PIXELFORMAT_RGBA8888, SDL_RenderClear, SDL_SetRenderDrawColor, SDL_SetRenderTarget, SDL_strcasecmp, SDL_TEXTUREACCESS_TARGET, SDL_TRUE, SDLTest_CommonArg(), SDLTest_CommonCreateState(), SDLTest_CommonInit(), SDLTest_CommonLogUsage(), state, SDLTest_CommonState::targets, use_target, and SDLTest_CommonState::windows.
|
static |
Definition at line 39 of file testviewport.c.
References SDLTest_CommonQuit(), and state.
Referenced by main().
|
static |
Definition at line 29 of file testviewport.c.
|
static |
Definition at line 29 of file testviewport.c.
|
static |
Definition at line 34 of file testviewport.c.
Referenced by DrawOnViewport(), and LoadSprite().
|
static |
Definition at line 35 of file testviewport.c.
Referenced by LoadSprite().
|
static |
Definition at line 35 of file testviewport.c.
Referenced by LoadSprite().
|
static |
Definition at line 26 of file testviewport.c.
Definition at line 30 of file testviewport.c.
|
static |
Definition at line 28 of file testviewport.c.
Referenced by Draw(), DrawComposite(), DrawLines(), DrawOnViewport(), DrawPoints(), DrawRects(), GetWindowViewportValues(), loop(), MoveSprites(), SDL_RendererEventWatch(), SDLTest_ScreenShot(), SetDrawState(), and UpdateLogicalSize().