About one year ago I found under “http://www.westga.edu/*dsharpe/courses/cs4250/OpenGL/install.html” (which, unfortunately, seems not to be available any more) the following simple programm (C code follows):
// From Angel, p. 436
#include <GL/glut.h>
#include <stdlib.h>
void myinit(void) {
glClearColor(1.0, 1.0, 1.0, 1.0);
glColor3f(1.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 500.0, 0.0, 500.0);
glMatrixMode(GL_MODELVIEW);
}
void display(void) {
typedef GLfloat point2[2];
point2 vertices[3] = {{0.0, 0.0}, {249.0, 499.0}, {499.0, 0.0}};
int j, k;
point2 p = {0.0, 0.0};
glClear(GL_COLOR_BUFFER_BIT);
for (k = 0; k < 50000; k++) {
j = rand() % 3;
p[0] = (p[0] + vertices[j][0]) / 2.0;
p[1] = (p[1] + vertices[j][1]) / 2.0;
glBegin(GL_POINTS);
glVertex2fv(p);
glEnd();
}
glFlush();
}
void main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (0, 0);
glutCreateWindow (“Sierpinski Gasket”);
glutDisplayFunc (display);
myinit();
glutMainLoop();
}
The tutorial text to it was (html source code follows):
<HTML>
<HEAD>
<TITLE>Installing OpenGL and Utilities</TITLE>
</HEAD>
<H1>Installing OpenGL and Utilities</H1>
These instructions tell how to install OpenGL, along with the glu, glut,
and aux libraries, under Microsoft Windows 95 and NT. They assume you have
Microsoft Developer’s Studio with Visual C++ installed; if not, then change
the folder name,
<UL>
C:\Program Files\DevStudio\VC
[/LIST]
to whatever is appropriate for your C/C++ installation.
<TABLE BORDER>
<TR>
<TD><UL>Windows 95[/LIST]</TD>
<TD><UL>Windows NT[/LIST]</TD>
</TR>
<TR VALIGN=TOP>
<TD>
[ol]
<LI>
Install OpenGL:
[list=a]
<LI>
Save glaux.h, and
<A HREF=glu.h>glu.h</A> in
C:\Program Files\DevStudio\VC\include\gl</LI>
<LI>
Right-click to save
glu32.lib, and
<A HREF=ftp://ftp.westga.edu/pub/class/dsharpe/opengl32.lib>opengl32.lib</A> in
C:\Program Files\DevStudio\VC\lib</LI>
<LI>
Right-click to save opengl32.dll in
C:\Windows\System</LI>
[/ol]
<LI>
Right-click to save <A HREF=ftp://ftp.westga.edu/pub/class/dsharpe/glut.dll>glut.dll</A> to
c:\windows\system</LI>
<LI>
Save <A HREF=glut.h>glut.h</A> to
c:\Program Files\DevStudio\Vc\include\gl</LI>
<LI>
Right-click to save <A HREF=ftp://ftp.westga.edu/pub/class/dsharpe/glut32.lib>glut32.lib</A> to
c:\Program Files\DevStudio\Vc\lib</LI>
</TD>
<TD>
[ol]
<LI>
Windows NT comes with OpenGL already installed.</LI>
<LI>
Right-click to save <A HREF=ftp://ftp.westga.edu/pub/class/dsharpe/glut.dll>glut.dll</A> to
c:\winnt\system32</LI>
<LI>
Save <A HREF=glut.h>glut.h</A> to
c:\Program Files\DevStudio\Vc\include\gl</LI>
<LI>
Right-click to save <A HREF=ftp://ftp.westga.edu/pub/class/dsharpe/glut32.lib>glut32.lib</A> to
c:\Program Files\DevStudio\Vc\lib</LI>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
[list=1]
<LI>
To test the installation:
[list=a]
<LI>Create a Visual C++ project called “glSierpinski”.</LI>
<LI>Save <A HREF=main.cpp>main.cpp</A> to your project
directory.</LI>
<LI>Add main.cpp to your project.</LI>
<LI>Go to the Project / Settings / Link window and add the file names
glut32.lib, glu32.lib, and opengl32.lib to the Object/library
modules box if necessary.</LI>
<LI>Compile it, link it, and run it. It should draw Sierpinski’s
gasket in a window.</LI>
</LI>
[/ol]
</TD>
</TR>
</TABLE>
[/LIST]
</BODY>
</HTML>
May be, it helps for a beginning!?
Good luck
Aris
(A.Christidis@de1.vdogrp.de)