www.pudn.com > CG2Programs.rar > device.h


#ifndef _DEVICE_H_
#define _DEVICE_H_

/* This provides low-level, device-specific routines. */

/* These example program were developed on an SGI workstation, using
the 'gl' language.  */

#include 


/* ============================================================ */
/* Constants */
/* ============================================================ */

#define WINDOW_WIDTH        400
#define WINDOW_HEIGHT       300 


/* ============================================================ */
/* Data Structure Types */
/* ============================================================ */

/* A point in device coordinates */
typedef struct {
  int x;
  int y;
} dcPt;

/* ============================================================ */
/* Convenience routines for data structures */
/* ============================================================ */

extern void dcPtShow (dcPt pt);
extern void setdcPt (dcPt * pt, int x, int y);



/* ============================================================ */
/* Device-specific routines */
/* ============================================================ */
extern long openGraphics (char * windowName, short xSize, short ySize);
extern void closeGraphics (int windowId);
extern void setPixel (int x, int y);
extern int  getPixel (int x, int y);
extern void plotPoint (float x, float y);
extern void setBackground (int c);
extern void setColor (int c);

#endif