Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info. |
IRIS GL
(Redirected from IrisGL)
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
IRIS GL (Integrated Raster Imaging System Graphics Library) was a proprietary graphics API created by Silicon Graphics for producing 2D and 3D computer graphics on their IRIX based IRIS graphical workstations. Later SGI (Silicon Graphics, Inc.) removed their proprietary code, reworked various system calls, and released IRIS GL as the industry standard OpenGL.
History
See OpenGL section History.
Example
IrisGL is straight forward, an example for a simple screensaver:
//ssaver.cpp //written by Ruud van Gaal //ruud at racer dot nl //compile with CC -o saver ssaver.cpp -lgl -ldmedia //note that IrisGL is linked with lowercase gl while //OpenGL is linked with uppercase gl (-lGL) #include <gl/gl.h> #include <gl/device.h> #include <dmedia/dmedia.h> void Line(int x1,int y1,int x2,int y2) { short v[2]; bgnline(); v[0]=x1; v[1]=y1; v2s(v); v[0]=x2; v[1]=y2; v2s(v); endline(); } #define MAXX 1280 // getgdesc(GD_XPMAX) #define MAXY 1024 void main(int argc,char **argv) { int x1,y1,x2,y2; int v[2][2]; prefsize(1280,1024); winopen("GL window"); RGBmode(); doublebuffer(); //viewport(0,768,0,576); fullscrn(); gconfig(); //winposition(100,200,100,200); //imakebackground(); clear(); v[0][0]=1; v[0][1]=2; v[1][0]=3; v[1][1]=4; x1=100; y1=150; x2=400; y2=400; qdevice(ESCKEY); clear(); swapbuffers(); clear(); //swapbuffers(); while(1) { cpack(0); clear(); x1=x1+v[0][0]; if(x1<0||x1>=MAXX){ v[0][0]=-v[0][0]; x1=x1+v[0][0]; } y1=y1+v[0][1]; if(y1<0||y1>=MAXY){ v[0][1]=-v[0][1]; y1=y1+v[0][1]; } x2=x2+v[1][0]; if(x2<0||x2>=MAXX){ v[1][0]=-v[1][0]; x2=x2+v[1][0]; } y2=y2+v[1][1]; if(y2<0||y2>=MAXY){ v[1][1]=-v[1][1]; y2=y2+v[1][1]; } cpack(0xFFFFFFFF); Line(x1,y1,x2,y2); swapbuffers(); if(qtest()) { short data; if(qread(&data)==ESCKEY) break; } } }