Jackal
07-20-2005, 10:25 AM
Hi, I am trying to make an opengl application in cygwin that simply draws lines. It is a mess.
The only thing that remotly works is freeglut. It brings up a window... glx.h doesn't even appear to exist and it won't link if I try to use regular glut.
The only things that work are freeglut specific things like drawing the predefined teapot or cube.
Lines don't show up.
glClearColor() causes the window to go black with a few pixels lit up with random colors here and there.
#include "/usr/X11R6/include/GL/freeglut.h"
#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
glVertex2f((x1), (y1)); glVertex2f((x2),(y2));glEnd();
//drawing out the lines
void display()
{
glClearColor(50.0,100.0,200.2,0.0);
drawOneLine(0,0,200,200);
glutSwapBuffers();
}
//the main function
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(400, 150);
glutInitWindowPosition(100, 100);
glutCreateWindow("Test");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
I use this to compile and link -
gcc gluttest.c -L /usr/X11R6/lib -lX11 -lXm -lXmu -lXext -lglut -lglu32 -lopengl32 -o test.exe The output is a window with a black backround with randomly lit up pixels here and there. Is there something wrong with the libraries I'm using?
The only thing that remotly works is freeglut. It brings up a window... glx.h doesn't even appear to exist and it won't link if I try to use regular glut.
The only things that work are freeglut specific things like drawing the predefined teapot or cube.
Lines don't show up.
glClearColor() causes the window to go black with a few pixels lit up with random colors here and there.
#include "/usr/X11R6/include/GL/freeglut.h"
#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
glVertex2f((x1), (y1)); glVertex2f((x2),(y2));glEnd();
//drawing out the lines
void display()
{
glClearColor(50.0,100.0,200.2,0.0);
drawOneLine(0,0,200,200);
glutSwapBuffers();
}
//the main function
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(400, 150);
glutInitWindowPosition(100, 100);
glutCreateWindow("Test");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
I use this to compile and link -
gcc gluttest.c -L /usr/X11R6/lib -lX11 -lXm -lXmu -lXext -lglut -lglu32 -lopengl32 -o test.exe The output is a window with a black backround with randomly lit up pixels here and there. Is there something wrong with the libraries I'm using?