Ejemplo n.º 1
0
int main(int argc, const char *argv[])
{
  glutInitDisplayString("rgba>=8 depth double");
  glutInitWindowSize(500, 500);
  glutInit( &argc, (char **) argv);
  glutCreateWindow("dreamtorus");

  // Regal workaround for OSX GLUT

  #ifdef __APPLE__
  RegalMakeCurrent(CGLGetCurrentContext());
  #endif

  RegalSetErrorCallback(myError);

  // Exercise REGAL_extension_query extension

  if (glIsSupportedREGAL("GL_REGAL_extension_query"))
  {
    printf("GL_REGAL_extension_query is supported.\n");

    if (glIsSupportedREGAL("GL_EXT_debug_marker"))
      printf("GL_EXT_debug_marker is supported.\n");
    else
      printf("GL_EXT_debug_marker is not supported.\n");

    if (glIsSupportedREGAL("GL_EXT_framebuffer_object"))
      printf("GL_EXT_framebuffer_object is supported.\n");
    else
      printf("GL_EXT_framebuffer_object is not supported.\n");

    if (glIsSupportedREGAL("GL_EXT_direct_state_access"))
      printf("GL_EXT_direct_state_access is supported.\n");
    else
      printf("GL_EXT_direct_state_access is not supported.\n");

    if (glIsSupportedREGAL("GL_NV_path_rendering"))
      printf("GL_NV_path_rendering is supported.\n");
    else
      printf("GL_NV_path_rendering is not supported.\n");
  }

  glutTimerFunc(16, myTick, 0);
  glutDisplayFunc(myDisplay);
  glutReshapeFunc(reshape);
  glutKeyboardFunc(myKeyboard);
  glutMainLoop();
  return 0;
}
Ejemplo n.º 2
0
Archivo: main.cpp Proyecto: vvuk/regal
int main(int argc, const char *argv[])
{
  glutInitDisplayString("rgba>=8 depth double");
  glutInitWindowSize(500, 500);
  glutInit( &argc, (char **) argv);
  glutCreateWindow("dreamtorus");

  glLogMessageCallbackREGAL(myOutput);

  // Regal workaround for OSX GLUT

  #ifdef __APPLE__
  RegalMakeCurrent(CGLGetCurrentContext());
  #endif

  // Regal workaround for Emscripten GLUT emulation

  #ifdef EMSCRIPTEN
  RegalMakeCurrent((RegalSystemContext)1);
  #endif

  RegalSetErrorCallback(myError);

  // Exercise REGAL_extension_query extension

  if (glIsSupportedREGAL("GL_REGAL_extension_query"))
  {
    printf("GL_REGAL_extension_query is supported.\n");

    if (glIsSupportedREGAL("GL_EXT_debug_marker"))
      printf("GL_EXT_debug_marker is supported.\n");
    else
      printf("GL_EXT_debug_marker is not supported.\n");

    if (glIsSupportedREGAL("GL_EXT_framebuffer_object"))
      printf("GL_EXT_framebuffer_object is supported.\n");
    else
      printf("GL_EXT_framebuffer_object is not supported.\n");

    if (glIsSupportedREGAL("GL_EXT_direct_state_access"))
      printf("GL_EXT_direct_state_access is supported.\n");
    else
      printf("GL_EXT_direct_state_access is not supported.\n");

    if (glIsSupportedREGAL("GL_NV_path_rendering"))
      printf("GL_NV_path_rendering is supported.\n");
    else
      printf("GL_NV_path_rendering is not supported.\n");
  }

  printf("\n");
  printf("E - Toggle GL error checking.\n");
  printf("D - Toggle debug checking.\n");
  printf("L - Toggle driver logging.\n");
  printf("M - Toggle emulation.\n");
  printf("R - Toggle driver calls.\n");
  printf("\n");

  glutTimerFunc(16, myTick, 0);
  glutDisplayFunc(myDisplay);
  glutReshapeFunc(dreamTorusReshape);
  glutKeyboardFunc(myKeyboard);
  glutMainLoop();
  return 0;
}