示例#1
0
文件: widget.c 项目: beoran/eruta
/* Initializes a widget with given bounds and style. */
BBWidget * 
bbwidget_initbounds(BBWidget * self, int id,  BBWidgetAction * acts, Rebox bounds) {
  Color fg    = color_rgb(0,0,0);
  Color bg    = color_rgb(255,0,0);
  Style style = { fg, bg, NULL, NULL };
  return bbwidget_initall(self, id, acts, bounds, style);
}
示例#2
0
std::vector<LineStrip*> lines;
LineStrip *currentLine = nullptr;
Jarvis* jarvis;
LineStrip *currentGrahamPoints = nullptr;
Graham_Scan* graham_scan;
Triangulation2D_qcq* triangulation2D_qcq;
Voronoi* voronoi;
//Triangulation2D_Delaunay_Bowyer_Watson* triangulation2D_Delaunay_Bowyer_Watson;
Triangulation2D_Delaunay* triangulation2D_Delaunay;
//Delaunay* delaunay;

float windowColor[3] = {0, 0.5f, 0.5f};		// Window color
int windowVerticeToMove = -1;
float pas = 20;
color_rgb dessinColor = color_rgb(1.f, 0.f, 0.f);
const float DEG2RAD = M_PI / 180;

Point clicked;

int presse = 0;										// Stores if the mouse is dragging

/* Functions prototypes */
void display();										// manages displaying
void keyboard(unsigned char key, int x, int y);		// manages keyboard inputs
void keyboardSpecial(int key, int x, int y);		// manages keyboard inputs
void mouse(int bouton, int etat, int x, int y);		// manages mouse clicks
void motion(int x, int y);							// manages mouse motions

void drawWindow();									// draws the window (algorithm of my bite)
void createMenu();