Difference between revisions of "IrisGL"

From Nekochan
Jump to: navigation, search
 
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''IRIS GL''' ('''I'''ntegrated '''R'''aster '''I'''maging '''S'''ystem '''G'''raphics '''L'''ibrary) was a proprietary graphics [[application programming interface|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]].
+
'''IRIS GL''' ('''I'''ntegrated '''R'''aster '''I'''maging '''S'''ystem '''G'''raphics '''L'''ibrary) was a proprietary graphics [[API|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 ==
 
== 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;
 +
    }
 +
  }
 +
}
 +
 +
<gallery>Image:Saver_IrisGL.jpg| saver running</gallery>
  
 
== References ==
 
== References ==
<references/>
 
  
 
== External links ==
 
== External links ==
 
* [http://www.opengl.org/ Official website]
 
* [http://www.opengl.org/ Official website]
 
* [http://www.sgi.com/products/software/opengl/ SGI's OpenGL website]
 
* [http://www.sgi.com/products/software/opengl/ SGI's OpenGL website]
 +
* [http://sourceforge.net/projects/igl/ IGL is a wrapper graphics library which converts IrisGL (SGI IRIX) calls to OpenGL calls]
  
  
 
[[Category:Graphics libraries]]
 
[[Category:Graphics libraries]]
 
[[Category:3D computer graphics]]
 
[[Category:3D computer graphics]]
[[Category:Application programming interfaces]]
+
[[Category:API]]
 
[[Category:Computer and video game development]]
 
[[Category:Computer and video game development]]
 
[[Category:Graphics standards]]
 
[[Category:Graphics standards]]
 +
[[Category:IRIX]]
 +
[[Category:IRIX_Programming]]

Latest revision as of 14:20, 25 March 2009

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

References

External links