Sunday, 21 November 2010

glBegin to vertex arrays

So even though i already did some conversions from opengl to opengles, i cannot remember what and how i did! here is a little reminder

glBegin( GL_QUADS );
glTexCoord2i(0, 0);
glVertex3f( 0-(ButtonSprites[index].Width/2), 0-(ButtonSprites[index].Height/2), 0 );

glTexCoord2i(1, 0);
glVertex3f( 0+(ButtonSprites[index].Width/2), 0-(ButtonSprites[index].Height/2), 0 );

glTexCoord2i(1, 1);
glVertex3f( 0+(ButtonSprites[index].Width/2), 0+(ButtonSprites[index].Height/2), 0 );

glTexCoord2i(0, 1);
glVertex3f( 0-(ButtonSprites[index].Width/2), 0+(ButtonSprites[index].Height/2), 0 );

get converted into

int numvertices = 4;
glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays
glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays

float* vertices= new float[3*numvertices]; //3 coordiantes per vertex
float* textcoord= new float[2*numvertices]; //2 texture coordiantes per vertex

//fill in your array of vertices and texture coordinates with data
textcoord[0] = 0;
textcoord[1] = 0;
textcoord[2] = 1;
textcoord[3] = 0;
textcoord[4] = 1;
textcoord[5] = 1;
textcoord[6] = 0;
textcoord[7] = 1;

vertices[0] = -(ButtonSprites[index].Width/2);
vertices[1] = -(ButtonSprites[index].Height/2);
vertices[2] = 0;
vertices[3] = (ButtonSprites[index].Width/2);
vertices[4] = -(ButtonSprites[index].Height/2);
vertices[5] = 0;
vertices[6] = (ButtonSprites[index].Width/2);
vertices[7] = (ButtonSprites[index].Height/2);
vertices[8] = 0;
vertices[9] = -(ButtonSprites[index].Width/2);
vertices[10] = (ButtonSprites[index].Height/2);
vertices[11] = 0;

glVertexPointer( 3, GL_FLOAT, 0, vertices ); // Set The Vertex Pointer To Vertex Data
glTexCoordPointer( 2, GL_FLOAT, 0, textcoord ); // Set The Vertex Pointer To TexCoord Data

glDrawArrays( GL_TRIANGLE_FAN, 0, numvertices ); //Draw the vertices

Thursday, 16 September 2010

we made it! Hedgewars on AppStore

After almost 1 year of work, the porting is done!

man what a load of work! but i feel proud now :D

some of the reactions:
burp: wee!
burp: awesome
Smaxx: apple doesn't grant proper credit to me
Smaxx: let's call the fsf
Tiy: \o/
Tiy: \o\o\o\o
Tiy: o/o/o/o/

good job guys

Sunday, 7 February 2010

so my thesis is up

Parallel and Distributed Programming on Low Latency Clusters

aaand it's finally here! the latest and hopefully last thesis i'll have to write is finally public!
You can download it, read it, shred it, enjoy it, burn it, copy it as long as you quote the author and the source!


All the projects here are under a Creative Commons 3.0 licence! You can use and distribute them as you like (just quote the author so he knows his work is not useless)!

If you wish to get in touch with me write at