SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | SWAP(typ, a, b) do{typ t=a;a=b;b=t;}while(0) |
#define | NUM_OBJECTS 100 |
#define | MAX_LINES 16 |
#define | MAX_RECTS 16 |
Functions | |
void | DrawPoints (SDL_Renderer *renderer) |
static int | add_line (int x1, int y1, int x2, int y2) |
void | DrawLines (SDL_Renderer *renderer) |
static int | add_rect (int x1, int y1, int x2, int y2) |
static void | DrawRects (SDL_Renderer *renderer) |
static void | DrawRectLineIntersections (SDL_Renderer *renderer) |
static void | DrawRectRectIntersections (SDL_Renderer *renderer) |
void | loop () |
int | main (int argc, char *argv[]) |
Variables | |
static SDLTest_CommonState * | state |
static int | num_objects |
static SDL_bool | cycle_color |
static SDL_bool | cycle_alpha |
static int | cycle_direction = 1 |
static int | current_alpha = 255 |
static int | current_color = 255 |
static SDL_BlendMode | blendMode = SDL_BLENDMODE_NONE |
int | mouse_begin_x = -1 |
int | mouse_begin_y = -1 |
int | done |
int | num_lines = 0 |
SDL_Rect | lines [MAX_LINES] |
int | num_rects = 0 |
SDL_Rect | rects [MAX_RECTS] |
#define MAX_LINES 16 |
Definition at line 83 of file testintersections.c.
Referenced by add_line().
#define MAX_RECTS 16 |
Definition at line 127 of file testintersections.c.
Referenced by add_rect().
#define NUM_OBJECTS 100 |
Definition at line 26 of file testintersections.c.
Referenced by main().
Definition at line 25 of file testintersections.c.
Referenced by add_rect().
|
static |
Definition at line 87 of file testintersections.c.
References SDL_Rect::h, MAX_LINES, num_lines, SDL_Log, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
|
static |
Definition at line 131 of file testintersections.c.
References SDL_Rect::h, MAX_RECTS, num_rects, SDL_Log, SWAP, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
void DrawLines | ( | SDL_Renderer * | renderer | ) |
Definition at line 105 of file testintersections.c.
References SDL_Rect::h, i, num_lines, SDL_RenderDrawLine, SDL_RenderGetViewport, SDL_SetRenderDrawColor, viewport, and SDL_Rect::w.
Referenced by loop().
void DrawPoints | ( | SDL_Renderer * | renderer | ) |
Definition at line 41 of file testintersections.c.
References current_alpha, current_color, cycle_alpha, cycle_color, cycle_direction, SDL_Rect::h, i, num_objects, SDL_RenderDrawPoint, SDL_RenderGetViewport, SDL_SetRenderDrawColor, viewport, and SDL_Rect::w.
Referenced by loop().
|
static |
Definition at line 162 of file testintersections.c.
References SDL_Rect::h, i, j, num_lines, num_rects, SDL_IntersectRectAndLine, SDL_RenderDrawLine, SDL_SetRenderDrawColor, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.
Referenced by loop().
|
static |
Definition at line 186 of file testintersections.c.
References i, j, num_rects, SDL_IntersectRect, SDL_RenderFillRect, and SDL_SetRenderDrawColor.
Referenced by loop().
|
static |
Definition at line 155 of file testintersections.c.
References num_rects, SDL_RenderFillRects, and SDL_SetRenderDrawColor.
Referenced by loop().
void loop | ( | ) |
Definition at line 202 of file testintersections.c.
References add_line(), add_rect(), SDL_MouseButtonEvent::button, SDL_Event::button, done, DrawLines(), DrawPoints(), DrawRectLineIntersections(), DrawRectRectIntersections(), DrawRects(), i, SDL_Event::key, SDL_KeyboardEvent::keysym, KMOD_SHIFT, SDL_Keysym::mod, mouse_begin_x, mouse_begin_y, NULL, num_lines, num_rects, SDLTest_CommonState::num_windows, renderer, SDLTest_CommonState::renderers, SDL_KEYDOWN, SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP, SDL_PollEvent, SDL_RenderClear, SDL_RenderPresent, SDL_SetRenderDrawColor, SDLTest_CommonEvent(), SDL_Keysym::sym, SDL_Event::type, SDLTest_CommonState::windows, SDL_MouseButtonEvent::x, and SDL_MouseButtonEvent::y.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 268 of file testintersections.c.
References blendMode, cycle_alpha, cycle_color, done, i, loop(), NULL, NUM_OBJECTS, num_objects, SDLTest_CommonState::num_windows, renderer, SDLTest_CommonState::renderers, SDL_atoi, SDL_BLENDMODE_ADD, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_NONE, SDL_GetTicks(), SDL_INIT_VIDEO, SDL_isdigit, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogSetPriority, SDL_RenderClear, SDL_SetRenderDrawBlendMode, SDL_SetRenderDrawColor, SDL_strcasecmp, SDL_TRUE, SDLTest_CommonArg(), SDLTest_CommonCreateState(), SDLTest_CommonInit(), SDLTest_CommonQuit(), and SDLTest_CommonUsage().
|
static |
Definition at line 35 of file testintersections.c.
Referenced by main().
|
static |
Definition at line 33 of file testintersections.c.
Referenced by DrawPoints().
|
static |
Definition at line 34 of file testintersections.c.
Referenced by DrawPoints().
|
static |
Definition at line 31 of file testintersections.c.
Referenced by DrawPoints(), and main().
|
static |
Definition at line 30 of file testintersections.c.
Referenced by DrawPoints(), and main().
|
static |
Definition at line 32 of file testintersections.c.
Referenced by DrawPoints().
int done |
Definition at line 38 of file testintersections.c.
Definition at line 85 of file testintersections.c.
int mouse_begin_x = -1 |
Definition at line 37 of file testintersections.c.
Referenced by loop().
int mouse_begin_y = -1 |
Definition at line 37 of file testintersections.c.
Referenced by loop().
int num_lines = 0 |
Definition at line 84 of file testintersections.c.
Referenced by add_line(), DrawLines(), DrawRectLineIntersections(), and loop().
|
static |
Definition at line 29 of file testintersections.c.
Referenced by DrawPoints(), and main().
int num_rects = 0 |
Definition at line 128 of file testintersections.c.
Referenced by add_rect(), DrawRectLineIntersections(), DrawRectRectIntersections(), DrawRects(), and loop().
Definition at line 129 of file testintersections.c.
|
static |
Definition at line 28 of file testintersections.c.