Advertisement
Guest User

Simple_opengl_problem

a guest
Aug 20th, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. struct OpenGLWindow : GLCtrl {
  2.     Point point;
  3.  
  4.     virtual void GLPaint()
  5.     {
  6.     StdView();
  7.     //glClearColor(10.0,  20.0,  10.0,  1.0);
  8.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  9.     glMatrixMode (GL_PROJECTION);
  10.     glLoadIdentity ();
  11.     gluOrtho2D (0.0,xsfact*(float)xs, ysfact*(float)ys, 0.0);
  12.     if (enable_draw)
  13.         {
  14.         int i=0;
  15.         while (i<xs)
  16.             {
  17.             int j=0;
  18.             while(j<ys)
  19.                 {
  20.                 glBegin(GL_POINTS);
  21.                 float tmp_gl=gl_matrix[i][j];
  22.                 glColor3f(tmp_gl,tmp_gl,tmp_gl);
  23.                 glVertex2f(i,j);
  24.                 glEnd();   
  25.                 j++;
  26.                 }  
  27.             i++;
  28.             }
  29.  
  30.         };  
  31.     glFlush();
  32.     }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement