Esempio n. 1
0
static void
draw(void)
{
#if USE_FIXED_POINT
   static const GLfixed verts[3][2] = {
      { -65536, -65536 },
      {  65536, -65536 },
      {      0,  65536 }
   };
   static const GLfixed colors[3][4] = {
      { 65536,     0,     0,    65536 },
      {     0, 65536,     0 ,   65536},
      {     0,     0, 65536 ,   65536}
   };
#else
   static const GLfloat verts[3][2] = {
      { -1, -1 },
      {  1, -1 },
      {  0,  1 }
   };
   static const GLfloat colors[3][4] = {
      { 1, 0, 0, 1 },
      { 0, 1, 0, 1 },
      { 0, 0, 1, 1 }
   };
#endif

   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

   {
#if USE_FIXED_POINT
      glVertexPointer(2, GL_FIXED, 0, verts);
      glColorPointer(4, GL_FIXED, 0, colors);
#else
      glVertexPointer(2, GL_FLOAT, 0, verts);
      glColorPointer(4, GL_FLOAT, 0, colors);
#endif
      glEnableClientState(GL_VERTEX_ARRAY);
      glEnableClientState(GL_COLOR_ARRAY);

      /* draw triangle */
      glDrawArrays(GL_TRIANGLES, 0, 3);

      /* draw some points */
      glPointSizex(FLOAT_TO_FIXED(15.5));
      glDrawArrays(GL_POINTS, 0, 3);

      glDisableClientState(GL_VERTEX_ARRAY);
      glDisableClientState(GL_COLOR_ARRAY);
   }

   glfwSwapBuffers(window);
}
void glPointSizexLogged(GLfixed size) {
	printf("glPointSizex(%i)\n", size);
	glPointSizex(size);
}