Update of /cvsroot/csdopenglnet/tutorials/lesson04
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10886
Modified Files:
lesson04.cs
Log Message:
Test
Index: lesson04.cs
===================================================================
RCS file: /cvsroot/csdopenglnet/tutorials/lesson04/lesson04.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** lesson04.cs 13 Jul 2004 19:51:59 -0000 1.1
--- lesson04.cs 13 Jul 2004 21:00:33 -0000 1.2
***************
*** 2,28 ****
using System;
! public class Lesson03 : csdGL {
protected float rotTri = 0.0f;
protected float rotQua = 0.0f;
! public Lesson03() {
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH );
glutInitWindowSize( 640, 480 );
! glutCreateWindow("Lesson 03");
initGL();
glutDisplayFunc( new cb0_glutDisplayFunc( draw ) );
glutKeyboardFunc( new cb0_glutKeyboardFunc(keyboard) );
glutReshapeFunc( new cb0_glutReshapeFunc( reshape ) );
! glutVisibilityFunc( new cb0_glutVisibilityFunc( visibility ) );
glutMainLoop();
}
!
! protected void visibility( int status ) {
! if ( status == GLUT_VISIBLE ) {
glutIdleFunc( new cb0_glutIdleFunc( draw ) );
} else {
! glutIdleFunc( null );
! }
}
--- 2,32 ----
using System;
! public class Lesson04 : csdGL {
protected float rotTri = 0.0f;
protected float rotQua = 0.0f;
! public Lesson04() {
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH );
glutInitWindowSize( 640, 480 );
! glutCreateWindow("Lesson 04");
initGL();
glutDisplayFunc( new cb0_glutDisplayFunc( draw ) );
glutKeyboardFunc( new cb0_glutKeyboardFunc(keyboard) );
glutReshapeFunc( new cb0_glutReshapeFunc( reshape ) );
! glutVisibilityFunc( new cb0_glutVisibilityFunc( visible ) );
glutMainLoop();
}
!
! protected void visible( int state ) {
! Console.Write( state );
! if ( state==GLUT_VISIBLE ) {
glutIdleFunc( new cb0_glutIdleFunc( draw ) );
} else {
! glutIdleFunc( new cb0_glutIdleFunc( idle ) );
! }
! }
!
! protected void idle() {
}
***************
*** 36,50 ****
}
- protected void reshape2( int width, int height ) {
- float h = ((float)height) / ((float)width);
- glViewport (0, 0, width, height);
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- glFrustum (-1.0, 1.0, -h, h, 5.0, 5.0);
- glMatrixMode (GL_MODELVIEW);
- glLoadIdentity ();
- // glTranslatef (0.0f, 0.0f, -40.0f);
- }
-
protected void reshape( int width, int height ) {
if (height==0) height = 1;
--- 40,43 ----
***************
*** 90,94 ****
glutSwapBuffers();
! rotTri += 0.2f;
rotQua -= 0.15f;
}
--- 83,87 ----
glutSwapBuffers();
! rotTri += 0.20f;
rotQua -= 0.15f;
}
***************
*** 99,103 ****
public static void Main( string[] args) {
! new Lesson03();
}
--- 92,96 ----
public static void Main( string[] args) {
! new Lesson04();
}
|