2016年5月23日 星期一

搖晃的紅酒杯

#include <stdio.h>
FILE *fout=NULL, *fin=NULL;
int main(int argc, char**argv)
{
    if(fout==NULL) fout=fopen("output.txt", "w+");
    ///printf("Hello world");
    fprintf(fout, "Hellow world");
}










#include <GL/glut.h>
#include <stdio.h>
FILE *fout=NULL, *fin=NULL;
void display()
{
    glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);
    glutSolidTeapot(0.3);
    glutSwapBuffers();
}
void motion(int x, int y)
{
    if(fout==NULL) fout=fopen("output.txt","w+");
    fprintf(fout, "%d %d\n", x, y);;
}
int main(int argc, char**argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("3D");
    glutDisplayFunc(display);
    glutMotionFunc(motion);

    glutMainLoop();

}

沒有留言:

張貼留言