From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 21 Apr 2003 17:51:30 +0400 From: Andrey Brindeew To: community@altlinux.ru Message-ID: <20030421135130.GA30435@abr.tool.ru> Mail-Followup-To: community@altlinux.ru References: <20030421130503.GB27250@abr.tool.ru> <3EA3EFD9.2080008@interlot.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ADZbWkCsHQ7r3kzd" Content-Disposition: inline In-Reply-To: <3EA3EFD9.2080008@interlot.ru> Subject: [Comm] Re: OpenGL programming question (glut and fullscreen) Sender: community-admin@altlinux.ru Errors-To: community-admin@altlinux.ru X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.0.9 Precedence: bulk Reply-To: community@altlinux.ru List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Archived-At: List-Archive: List-Post: --ADZbWkCsHQ7r3kzd Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline Content-Transfer-Encoding: 8bit --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Apr 21, 2003 at 05:19:21PM +0400, Roman Savelyev wrote: > | Приложенный к этому письму пример не работает. > Это закономерно, т.к. в письме вложений не обнаружено :) пардон, исправляюсь :-) -- WBR, Andrey Brindeew. "No one person can understand Perl culture completely" (C) Larry Wall. --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=Makefile # gcc -o teapot teapot.c -L/usr/X11R6/lib/ -lGL -lglut %: %.c gcc -pg -o $@ $< -L/usr/lib -L/usr/X11R6/lib -L. -lGL -lglut --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tezt.c" #include #include float angle = 0.0 ; void anim(void) { angle += 1.0 ; if (angle >= 360.0) angle -= 360.0 ; glutPostRedisplay() ; } void keyboard(unsigned char key, int x, int y) { switch(key) { default: exit(0) ; } } void display(void) // the disp[lay function { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ; glRotatef(angle,1.0,1.0,1.0) ; glutSolidCube(1.0) ; glutSwapBuffers() ; } void reshape(int w, int h) // the reshape function { glViewport(0,0,(GLsizei)w,(GLsizei)h) ; glMatrixMode(GL_PROJECTION) ; glLoadIdentity() ; gluPerspective(60.0,(GLfloat)w/(GLfloat)h,1.0,30.0) ; glMatrixMode(GL_MODELVIEW) ; glLoadIdentity() ; glTranslatef(0.0,0.0,-3.6) ; } int main (int argc, char** argv) { glutInit(&argc, argv) ; glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH) ; glutGameModeString("1152x864:24") ; if (glutGameModeGet(GLUT_GAME_MODE_WIDTH) != -1) // if the width is different to -1 { glutEnterGameMode() ; // enter full screen mode glutDisplayFunc(display) ; glutReshapeFunc(reshape) ; glutIdleFunc(anim) ; glutKeyboardFunc(keyboard) ; glutMainLoop() ; } else // print out that this mode is not available printf("The current mode is not supported in this system\n") ; return 0 ; } --Kj7319i9nmIyA2yE-- --ADZbWkCsHQ7r3kzd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Get my public key at http://abr.pp.ru/gpg.html iD8DBQE+o/di3gaCZ4hbZncRAlN+AJ46x3wZoiCL/6QX7rmMv1LZS7WTIACgmo4f uCf2hwfmpNyWxsKdExcEsxI= =DWZV -----END PGP SIGNATURE----- --ADZbWkCsHQ7r3kzd--