Re: C(++?) to EUPHORIA Code

new topic     » goto parent     » topic index » view thread      » older message » newer message

Evan Marshall wrote:
> 
> cklester wrote:
> > 
> > Can somebody see where I'm going wrong...
> > 
> > --original C code...
> > void glEnable2D()
> > {
> > 	int vPort[4];
> > 
> >    glGetIntegerv(GL_VIEWPORT, vPort);
> > 
> >    glMatrixMode(GL_PROJECTION);
> >    glPushMatrix();
> >    glLoadIdentity();
> > 
> >    glOrtho(0, vPort[2], 0, vPort[3], -1, 1);
> >    glMatrixMode(GL_MODELVIEW);
> >    glPushMatrix();
> >    glLoadIdentity();
> > }
> > 
> > --my translation attempt:
> > global procedure glGo2D()
> > 
> > 	--I have no idea what to do with this line!!!
> > 	--glGetIntegerv(GL_VIEWPORT, vPort)
> > 	
> > 	glMatrixMode(GL_PROJECTION)
> > 	glPushMatrix()
> > 	glLoadIdentity()
> > 	
> > 	glOrtho(0, vPort[2], 0, vPort[3], -1, 1)
> > 	glMatrixMode(GL_MODELVIEW)
> > 	glPushMatrix()
> > 	glLoadIdentity()
> > end procedure
> > 
> 
> <font color="#330033"></font>
> <font color="#FF00FF">atom </font><font color="#330033">vPort</font>
> <font color="#330033">vPort = allocate(16) </font><font color="#FF0055">--
> space for 4 integer values</font>
> <font color="#330033"></font>
> <font color="#330033">glOrtho(0, vPort</font><font
> color="#993333">[</font><font color="#330033">3</font><font
> color="#993333">]</font><font color="#330033">, 0, vPort</font><font
> color="#993333">[</font><font color="#330033">4</font><font
> color="#993333">]</font><font color="#330033">, -1, 1)  </font><font
> color="#FF0055">--Euphoria is 1 based</font>
> <font color="#330033"></font>


That should be:
glOrtho(0,peek4u(vPort+8),0,peek4u(vPort+12),-1,1)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu