root/samples/mikk_ni3_92/scissoring_box.php

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. display
  2. GLUT_INIT
  3. GLUT_CALL_FUNC
  4. MY_INIT

<?php

  /*
   * http://wiki.livedoor.jp/mikk_ni3_92/d/%a5%b7%a5%b6%a5%ea%a5%f3%a5%b0%a5%dc%a5%c3%a5%af%a5%b9
   */


function display()
{

    glClear(GL_COLOR_BUFFER_BIT);

    glEnable(GL_SCISSOR_TEST);
    glScissor(0, 0, 20, 20);
    glClearColor(1.0, 1.0, 1.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glDisable(GL_SCISSOR_TEST);


    glFlush();
}


function GLUT_INIT()
{
    glutInitDisplayMode(GLUT_RGBA);
    glutInitWindowSize(200,200);
    glutInitWindowPosition(150,150);
}


function GLUT_CALL_FUNC()
{
    glutDisplayFunc('display');
}

function MY_INIT()
{
    glClearColor(0.0, 0.0, 1.0, 1.0);
}



glutInit($argv);
GLUT_INIT();
glutCreateWindow("window name");
GLUT_CALL_FUNC();
MY_INIT();
glutMainLoop();
exit (0);



/* [<][>][^][v][top][bottom][index][help] */