Date: Tue, 21 Mar 2000 20:57:54 +0100 (MET) From: Ariel Burbaickij <Ariel.Burbaickij@mni.fh-giessen.de> To: freebsd-questions@freebsd.org Subject: OpenGL help needed realy URGENT! now Message-ID: <Pine.GSO.4.10.10003212049050.9535-200000@sun33>
index | next in thread | raw e-mail
[-- Attachment #1 --]
Well i tried to compile the attached snippet.
I got following errors:
GL/glut.h:No such file or directory and
gcc:file path prefix `/usr/X11/lib' never used
file GL/glut.h is present though :
/usr/X11R6/include/GL/glut.h
So something is probably wrong with the arguments i passed to compiler
we will use OpenGl at college so I badly need help.Please answer following
questions:
What are proper arguments to coerce gcc to run?
What are expected places for Mesa3 routines and GLUT?
Kind regards,
Ariel
Any additional questions aimed to clarify situation for potential helpers
are surely welcome
[-- Attachment #2 --]
#include <GL/glut.h>
/* Linux/Unix compilation:
* gcc sample1.c -lMesaGLU -lMesaGL -lXext -lX11 -lglut -lXi -lXmu \
* -b/usr/X11/lib
GLenum polygonMode=GL_LINE;
float rotX=0.0,rotY=0.0;
static void DrawCube()
{
glBegin(GL_QUADS);
glColor3f (0.0 , 0.0 , 0.0) ; glVertex3f(0.0 , 0.0 , 0.0);
glColor3f (1.0 , 0.0 , 0.0) ; glVertex3f(1.0 , 0.0 , 0.0);
glColor3f (1.0 , 0.0 , 1.0) ; glVertex3f(1.0 , 0.0 , 1.0);
glColor3f (0.0 , 0.0 , 1.0 ) ; glVertex3f(0.0 , 0.0 , 1.0);
glColor3f (0.0 , 1.0 , 0.0) ; glVertex3f (0.0 , 1.0 , 0.0);
glColor3f(0.0 , 1.0 , 1.0 ) ; glVertex3f (0.0 , 1.0 , 0.0 );
glColor3f(1.0 , 1.0 , 1.0 ) ; glVertex3f (1.0 , 1.0 , 1.0);
glColor3f(1.0 , 1.0 , 0.0 ) ; glVertex3f (1.0 , 1.0 , 0.0);
glEnd();
glBegin(GL_QUAD_STRIP);
glColor3f (0.0 , 0.0 , 1.0) ; glVertex3f (0.0 , 0.0 , 1.0);
glColor3f (0.0 , 1.0 , 1.0) ; glVertex3f (0.0 , 1.0 , 1.0);
glColor3f (1.0 , 0.0 , 1.0) ; glVertex3f (1.0 , 0.0 , 1.0);
glColor3f (1.0 , 1.0 , 1.0 ) ; glVertex3f(1.0 , 1.0 , 1.0);
glColor3f (1.0 , 0.0 , 0.0 ); glVertex3f (1.0 , 0.0 , 0.0);
glColor3f (1.0 , 1.0 , 0.0 ) ; glVertex3f (1.0 , 1.0 , 0.0);
glColor3f (0.0 , 0.0 , 0.0 ) ; glVertex3f ( 0.0 , 0.0 , 0.0 );
glColor3f (0.0 , 1.0 , 0.0) ; glVertex3f (0.0 , 1.0 , 0.0 );
glColor3f (0.0 , 0.0 , 1.0 ) ; glVertex3f ( 0.0 , 0.0 , 1.0);
glColor3f (0.0 , 1.0 , 1.0 ) ; glVertex3f (0.0 , 1.0 , 1.0);
glEnd();
}
static void Init(void)
{
glEnable(GL_DEPTH_TEST);
glPolygonMode(GL_FRONT_AND_BACK , GL_LINE);
}
static void Reshape (int width , int height)
{
glViewport(0 , 0 , (Glint)width , (Glint)height);
glMatrixMode(GL_PROJECTION);
glLoadIndentity();
gluPerspective(60.0 , 1.0 , 1.0 , 200.0);
glMatrixMode(GL_MODELVIEW);
}
static void Key(unsigned char key , int x , int y)
{
if (key==27)
exit(1);
if (key==' ')
{
if (polygonMode==GL_FILL)
polygonMode=GL_LINE;
else
polygonMode=GL_FILL;
glPolygonMode (GL_FRONT_AND_BACK , polygonMode);
glutPostRedisplay();
}
}
static void SpecialKey(int key , int x , int y )
{
switch(key) {
case GLUT_KEY_UP:
rotX -= 5 ;
break ;
case GLUT_KEY_DOWN:
rotX += 5 ;
break;
case GLUT_KEY_LEFT:
rotY -= 5;
break;
case GLUT_KEY_RIGHT:
rotY += 5 ;
break;
default:
return;
}
glutPostRedispaly();
}
static void Display(void)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef ( 0.0 , 0.0 , -3.0 );
glRotatef (rotY , 0.0 , 1.0 , 0.0);
glRotatef (rotX , 1.0 , 0.0 , 0.0);
glTranslatef ( -0.5 , -0.5 , -0.5);
DrawCube();
glutSwapBuffers();
}
int main ( int argc , char ** argv)
{
glutInit(&argc , argv);
glutInitWindowPosition(0 , 0);
glutInitWindowSize(300 , 300);
glutInitDisplayMode(GLUT_DEPTH|GLUT_RGB|GLUT_DOUBLE);
if (glutCreateWindow("Sample1") == GL_FALSE)
exit(1);
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Display);
glutMainLoop();
}
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10003212049050.9535-200000>
