File: gliq.h

package info (click to toggle)
glut 3.6-4
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 9,084 kB
  • ctags: 15,234
  • sloc: ansic: 131,032; makefile: 2,129; ada: 2,012; yacc: 473; fortran: 290; lex: 131; sed: 49; csh: 38
file content (76 lines) | stat: -rw-r--r-- 1,918 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*  
 *  CS 453 - Final project : An OpenGL version of the pegboard game IQ
 *  Due : June 5, 1997
 *  Author : Kiri Wagstaff
 *
 *  File : gliq.h
 *  Description : Main header file
 *
 */

#ifndef GLIQ_H
#define GLIQ_H

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/glut.h>
#include "trackball.h"
#include "tb.h"

/* defines */
#define BOARDSIZE 9   /* on a side, total of 81 holes */
#define SELECT_BUFFER 256

/* enums */
enum {UNUSED, EMPTY, FULL, CANMOVE, CANTMOVE};    /* for each hole */
enum {SELBOARD, PLAY, HIGHSC, VIEWSCORES};        /* current state */
enum {NONE, LEFTARR=100, SELECT, RIGHTARR, QUIT}; /* board selection */

/* from gliq.c */
extern  int curstate;
extern  int lastpicked;
extern  int pegs;
extern  int totalpegs;
extern  void display(void);

/* from board.c */
extern  int*** boards;
extern  int    curboard;
extern  int    numboards;  
extern  int    filled[BOARDSIZE][BOARDSIZE];
extern  void   selectboard(void);
extern  void   readboards(void);
extern  void   drawboard(void);
extern  void   drawpegs(void);
extern  void   drawpeg(void);
extern  void   displaybuttons(void);

/* from game.c */
extern  int playdone;
extern  void playgame(void);
extern  int legalmove(void);
extern  int canmove(int peg);
extern  int movesexist(void);
extern  void drawquit(float x, float y, float r1, float r2);

/* from score.c */
extern  int minscore;
extern  int minpegs;
extern  int numentered;
extern  int written;
extern  void highscore(void);
extern  void readscores(void);
extern  void showhighscores(void);
extern  void keyscores(unsigned char key, int x, int y);
extern  void idlescore(void);

/* from pick.c */
extern  int       picked;
extern  GLuint    select_buffer[];
extern  GLboolean selection;
extern  GLuint    pick(int x, int y);
extern  void      passive(int x, int y);
extern  void      text(GLuint x, GLuint y, GLfloat scale, char *format, ...);

#endif