home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / Cube Drop 2001 1.0 / Canvas.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-17  |  1.6 KB  |  64 lines

  1. #ifdef WIN32
  2. #include "windows.h"
  3. #endif
  4.  
  5. #ifndef CANVAS_H
  6. #define CANVAS_H
  7.  
  8. #include <GL/gl.h>
  9. #include <GL/glu.h>
  10. #include <GL/glut.h>
  11. #include <GL/glaux.h>
  12. #include <math.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <stdlib.h>
  16.  
  17. #define DISPLAY_LIST_SIZE 10
  18. #define TRUE 1
  19. #define FALSE 0
  20. #define YES 1
  21. #define NO 0
  22. #define glRGB(x, y, z)    glColor3ub((GLubyte)x, (GLubyte)y, (GLubyte)z)
  23.  
  24. typedef struct DISPLAY_LIST_STRUCT
  25. {
  26.     char name[40];
  27.     GLint id;
  28.     GLint available;
  29. } DISPLAY_LIST_TYPE;
  30.  
  31. class Canvas{
  32. public:
  33.     GLint miWidth;
  34.     GLint miHeight;
  35.     GLint m_CurrDegree;
  36.  
  37.     DISPLAY_LIST_TYPE display_list[DISPLAY_LIST_SIZE];
  38.         
  39.     Canvas(GLint x, GLint y, GLint width, GLint height, char *windowTitle);
  40.     ~Canvas();
  41.     void setPerspectiveWindow(GLdouble fovy, GLdouble aspect,GLdouble zNear,GLdouble zFar);
  42.     void setWindow(GLfloat fLeft, GLfloat fRight, GLfloat fBottom, GLfloat fTop);
  43.     void setViewport(GLint iX, GLint iY, GLsizei iWidth, GLsizei iHeight);
  44.     void setBackgroundColor(GLfloat red, GLfloat green, GLfloat blue);
  45.     void setLighting();
  46.     void setBlending();
  47.     void setDepthBuffer();
  48.     void setDiffuseMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  49.     void setAmbientMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  50.     void setMaterialShininess(GLint intensity);
  51.     void setSpecularMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  52.     void Box(int, int, int);
  53.     GLint ReserveDisplayListId(char *name);
  54.     GLint FindDisplayListId(char *name);
  55.     void buildGrid(char *Name);
  56.     GLint cubeSize;
  57.     GLfloat gameWidth;
  58.     GLfloat gameDepth;
  59.     GLfloat gameHeight;
  60. };
  61.  
  62.  
  63.  
  64. #endif