ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Andrey Brindeew <abr@altlinux.ru>
To: community@altlinux.ru
Subject: [Comm] Re: OpenGL programming question (glut and fullscreen)
Date: Mon, 21 Apr 2003 17:51:30 +0400
Message-ID: <20030421135130.GA30435@abr.tool.ru> (raw)
In-Reply-To: <3EA3EFD9.2080008@interlot.ru>


[-- Attachment #1.1: Type: text/plain, Size: 297 bytes --]

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.

[-- Attachment #1.2: Makefile --]
[-- Type: text/plain, Size: 125 bytes --]

# 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

[-- Attachment #1.3: tezt.c --]
[-- Type: text/plain, Size: 1306 bytes --]

#include <GL/glut.h>
#include <stdio.h>

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 ;
}

[-- Attachment #2: Type: application/pgp-signature, Size: 245 bytes --]

  reply	other threads:[~2003-04-21 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-21 13:05 [Comm] " Andrey Brindeew
2003-04-21 13:19 ` Roman Savelyev
2003-04-21 13:51   ` Andrey Brindeew [this message]
2003-04-21 17:32 ` Roman Bogorodskiy
2003-04-21 18:26   ` [Comm] " Andrey Brindeew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030421135130.GA30435@abr.tool.ru \
    --to=abr@altlinux.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git