|
SDL
2.0
|
Include dependency graph for testgesture.c:Go to the source code of this file.
Data Structures | |
| struct | Point |
| struct | Knob |
Macros | |
| #define | WIDTH 640 |
| #define | HEIGHT 480 |
| #define | BPP 4 |
| #define | DEPTH 32 |
| #define | EVENT_BUF_SIZE 256 |
| #define | VERBOSE 0 |
Functions | |
| void | setpix (SDL_Surface *screen, float _x, float _y, unsigned int col) |
| void | drawLine (SDL_Surface *screen, float x0, float y0, float x1, float y1, unsigned int col) |
| void | drawCircle (SDL_Surface *screen, float x, float y, float r, unsigned int c) |
| void | drawKnob (SDL_Surface *screen, Knob k) |
| void | DrawScreen (SDL_Surface *screen, SDL_Window *window) |
| SDL_Window * | initWindow (SDL_Window *window, int width, int height) |
| void | loop () |
| int | main (int argc, char *argv[]) |
Variables | |
| static SDL_Event | events [EVENT_BUF_SIZE] |
| static int | eventWrite |
| static int | colors [7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF} |
| SDL_Surface * | screen |
| SDL_Window * | window |
| SDL_bool | quitting = SDL_FALSE |
| static Knob | knob |
| #define BPP 4 |
Definition at line 27 of file testgesture.c.
Referenced by setpix().
| #define DEPTH 32 |
Definition at line 28 of file testgesture.c.
| #define EVENT_BUF_SIZE 256 |
Definition at line 31 of file testgesture.c.
Referenced by DrawScreen(), and loop().
| #define HEIGHT 480 |
Definition at line 26 of file testgesture.c.
Referenced by main().
| #define VERBOSE 0 |
Definition at line 34 of file testgesture.c.
| #define WIDTH 640 |
Definition at line 25 of file testgesture.c.
Referenced by main().
| void drawCircle | ( | SDL_Surface * | screen, |
| float | x, | ||
| float | y, | ||
| float | r, | ||
| unsigned int | c | ||
| ) |
Definition at line 93 of file testgesture.c.
References SDL_fabs, SDL_sqrt, and setpix().
Referenced by drawKnob(), and DrawScreen().
| void drawKnob | ( | SDL_Surface * | screen, |
| Knob | k | ||
| ) |
Definition at line 111 of file testgesture.c.
References Knob::ang, drawCircle(), SDL_Surface::h, Knob::p, Knob::r, SDL_cosf, SDL_sinf, SDL_Surface::w, Point::x, and Point::y.
Referenced by DrawScreen().
| void drawLine | ( | SDL_Surface * | screen, |
| float | x0, | ||
| float | y0, | ||
| float | x1, | ||
| float | y1, | ||
| unsigned int | col | ||
| ) |
Definition at line 87 of file testgesture.c.
References SDL_fabs, SDL_max, and setpix().
| void DrawScreen | ( | SDL_Surface * | screen, |
| SDL_Window * | window | ||
| ) |
Definition at line 117 of file testgesture.c.
References colors, drawCircle(), drawKnob(), EVENT_BUF_SIZE, eventWrite, SDL_Surface::h, i, NULL, Knob::p, SDL_FillRect, SDL_FINGERDOWN, SDL_FINGERMOTION, SDL_FINGERUP, SDL_UpdateWindowSurface, setpix(), SDL_Surface::w, and Point::x.
Referenced by loop().
| SDL_Window* initWindow | ( | SDL_Window * | window, |
| int | width, | ||
| int | height | ||
| ) |
Definition at line 160 of file testgesture.c.
References SDL_CreateWindow, SDL_WINDOW_RESIZABLE, SDL_WINDOWPOS_CENTERED, and window.
Referenced by loop(), and main().
| void loop | ( | ) |
Definition at line 170 of file testgesture.c.
References Knob::ang, SDL_WindowEvent::data1, SDL_WindowEvent::data2, SDL_MultiGestureEvent::dDist, SDL_Event::dgesture, DrawScreen(), SDL_MultiGestureEvent::dTheta, SDL_DollarGestureEvent::error, SDL_WindowEvent::event, EVENT_BUF_SIZE, eventWrite, SDL_TouchFingerEvent::fingerId, SDL_DollarGestureEvent::gestureId, i, initWindow(), SDL_Event::key, SDL_KeyboardEvent::keysym, SDL_Event::mgesture, SDL_MultiGestureEvent::numFingers, Knob::p, quitting, Knob::r, SDL_DOLLARGESTURE, SDL_DOLLARRECORD, SDL_FINGERDOWN, SDL_FINGERMOTION, SDL_FINGERUP, SDL_GetNumTouchDevices, SDL_GetNumTouchFingers, SDL_GetTouchDevice, SDL_GetWindowSurface, SDL_KEYDOWN, SDL_LoadDollarTemplates, SDL_Log, SDL_MULTIGESTURE, SDL_PollEvent, SDL_PRIs64, SDL_QUIT, SDL_Quit, SDL_RecordGesture, SDL_RWclose, SDL_RWFromFile, SDL_SaveAllDollarTemplates, SDL_TRUE, SDL_WINDOWEVENT, SDL_WINDOWEVENT_RESIZED, SDLK_ESCAPE, SDLK_i, SDLK_l, SDLK_s, SDLK_SPACE, SDL_Keysym::sym, SDL_Event::tfinger, SDL_Event::type, SDL_Event::window, Point::x, SDL_TouchFingerEvent::x, SDL_MultiGestureEvent::x, Point::y, SDL_TouchFingerEvent::y, and SDL_MultiGestureEvent::y.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 277 of file testgesture.c.
References Knob::ang, HEIGHT, initWindow(), loop(), NULL, quitting, Knob::r, SDL_FALSE, SDL_GetWindowSurface, SDL_Init, SDL_INIT_VIDEO, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogSetPriority, SDL_Quit, and WIDTH.
| void setpix | ( | SDL_Surface * | screen, |
| float | _x, | ||
| float | _y, | ||
| unsigned int | col | ||
| ) |
Definition at line 57 of file testgesture.c.
References BPP, SDL_PixelFormat::BytesPerPixel, SDL_Surface::format, SDL_Surface::h, SDL_Surface::pitch, SDL_Surface::pixels, SDL_GetRGB, SDL_MapRGB, SDL_memcpy, and SDL_Surface::w.
Referenced by drawCircle(), drawLine(), and DrawScreen().
|
static |
Definition at line 40 of file testgesture.c.
Referenced by DrawScreen(), MapNto1(), SDL_LoadBMP_RW(), and SDL_SaveBMP_RW().
|
static |
Definition at line 36 of file testgesture.c.
Referenced by IsSDLWindowEventPending().
|
static |
Definition at line 37 of file testgesture.c.
Referenced by DrawScreen(), and loop().
|
static |
Definition at line 55 of file testgesture.c.
Definition at line 44 of file testgesture.c.
| SDL_Surface* screen |
Definition at line 42 of file testgesture.c.
| SDL_Window* window |
Definition at line 43 of file testgesture.c.
Referenced by initWindow().