Re: C(++?) to EUPHORIA Code

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

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
> 


atom vPort
vPort = allocate(16) -- space for 4 integer values

glOrtho(0, vPort[3], 0, vPort[4], -1, 1) Euphoria is 1 based }}}

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

Search



Quick Links

User menu

Not signed in.

Misc Menu