PatchworkOS
Loading...
Searching...
No Matches
main.c File Reference
#include <libpatchwork/patchwork.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Go to the source code of this file.

Macros

#define WINDOW_WIDTH   500
 
#define WINDOW_HEIGHT   500
 

Functions

static void draw_marker (drawable_t *draw, point_t center, int64_t radius, const point_t *markerPoints, uint64_t pointCount, double angle, pixel_t pixel)
 
static void draw_hand (drawable_t *draw, point_t center, const point_t *handPoints, uint64_t pointCount, double angle, pixel_t pixel)
 
static uint64_t procedure (window_t *win, element_t *elem, const event_t *event)
 
int main (void)
 

Variables

static point_t hourMarker [] = {{-3, 0}, {3, 0}, {2, -30}, {-2, -30}}
 
static point_t minuteMarker [] = {{-1, 0}, {1, 0}, {1, -15}, {-1, -15}}
 
static point_t hourHand [] = {{-8, 15}, {8, 15}, {6, -50}, {3, -75}, {0, -85}, {-3, -75}, {-6, -50}}
 
static point_t minuteHand [] = {{-6, 15}, {6, 15}, {4, -120}, {2, -145}, {0, -155}, {-2, -145}, {-4, -120}}
 
static point_t secondHand [] = {{-2, 30}, {2, 30}, {2, 0}, {1, -165}, {0, -175}, {-1, -165}, {-2, 0}}
 

Macro Definition Documentation

◆ WINDOW_HEIGHT

#define WINDOW_HEIGHT   500

Definition at line 9 of file main.c.

◆ WINDOW_WIDTH

#define WINDOW_WIDTH   500

Definition at line 8 of file main.c.

Function Documentation

◆ draw_hand()

static void draw_hand ( drawable_t draw,
point_t  center,
const point_t handPoints,
uint64_t  pointCount,
double  angle,
pixel_t  pixel 
)
static

Definition at line 37 of file main.c.

References draw_polygon(), memcpy(), polygon_rotate(), point_t::x, and point_t::y.

Referenced by procedure().

◆ draw_marker()

static void draw_marker ( drawable_t draw,
point_t  center,
int64_t  radius,
const point_t markerPoints,
uint64_t  pointCount,
double  angle,
pixel_t  pixel 
)
static

Definition at line 21 of file main.c.

References draw_polygon(), memcpy(), polygon_rotate(), point_t::x, and point_t::y.

Referenced by procedure().

◆ main()

◆ procedure()

Variable Documentation

◆ hourHand

point_t hourHand[] = {{-8, 15}, {8, 15}, {6, -50}, {3, -75}, {0, -85}, {-3, -75}, {-6, -50}}
static

Definition at line 15 of file main.c.

Referenced by procedure().

◆ hourMarker

point_t hourMarker[] = {{-3, 0}, {3, 0}, {2, -30}, {-2, -30}}
static

Definition at line 11 of file main.c.

Referenced by procedure().

◆ minuteHand

point_t minuteHand[] = {{-6, 15}, {6, 15}, {4, -120}, {2, -145}, {0, -155}, {-2, -145}, {-4, -120}}
static

Definition at line 17 of file main.c.

Referenced by procedure().

◆ minuteMarker

point_t minuteMarker[] = {{-1, 0}, {1, 0}, {1, -15}, {-1, -15}}
static

Definition at line 13 of file main.c.

Referenced by procedure().

◆ secondHand

point_t secondHand[] = {{-2, 30}, {2, 30}, {2, 0}, {1, -165}, {0, -175}, {-1, -165}, {-2, 0}}
static

Definition at line 19 of file main.c.

Referenced by procedure().