hi benny!
Very nice 1k game! I would be proud if it would be my production *grin*. K++ for the nice work and for the source! As you may know i dont get work any C/CPP code (even i want to learn CPP)... i just did a small view to your source and possible following thing could optimize your exe size!? (i cant test here, sorry)... Hope i didnt made any mistake
Your original source:
Static void drawBat(void) {
glBegin(GL_QUADS);
glVertex2f(NULLNULL, NULLNULL);
glVertex2f(NULLNULLFIVE, NULLNULL);
glVertex2f(NULLNULLFIVE, NULLTWO);
glVertex2f(NULLNULL, NULLTWO);
glEnd();
}
Static void render( void ) {
glClear( GL_COLOR_BUFFER_BIT );
glLoadIdentity();
glTranslatef( NULLNINE, -NULLNULLEIGHT + batY, NULLFIVE );
drawBat();
glLoadIdentity();
glTranslatef( -NULLNINE, -NULLNULLEIGHT - batY, NULLNULL );
drawBat();
glLoadIdentity();
glTranslatef( ballX, ballY, NULLNULL );
glBegin(GL_QUADS);
glVertex2f(NULLNULL, NULLNULL);
glVertex2f(NULLNULLFIVE, NULLNULL);
glVertex2f(NULLNULLFIVE, NULLNULLFIVE);
glVertex2f(NULLNULL, NULLNULLFIVE);
glEnd();
}
Just try out to replace it with this (its possible to optimize it a bit, to save some more bytes!):
Static void drawObject( fTransX:float, fTransY:float, fTransZ:float, fLeft:float, fBottom:float, fRight:float, fTop:float )
{
glLoadIdentity();
glTranslatef_( fTransX, fTransY, fTransZ, );
glBegin(GL_QUADS);
glVertex2f( fLeft , fBottom );
glVertex2f( fRight, fBottom );
glVertex2f( fRight, fTop );
glVertex2f( fLeft , fTop );
glEnd();
}
Static void render( void ) {
glClear( GL_COLOR_BUFFER_BIT );
// glLoadIdentity();
// glTranslatef( NULLNINE, -NULLNULLEIGHT + batY, NULLFIVE );
// drawBat();
// glLoadIdentity();
// glTranslatef( -NULLNINE, -NULLNULLEIGHT - batY, NULLNULL );
// drawBat();
// glLoadIdentity();
// glTranslatef( ballX, ballY, NULLNULL );
// glBegin(GL_QUADS);
// glVertex2f(NULLNULL, NULLNULL);
// glVertex2f(NULLNULLFIVE, NULLNULL);
// glVertex2f(NULLNULLFIVE, NULLNULLFIVE);
// glVertex2f(NULLNULL, NULLNULLFIVE);
// glEnd();
drawObject( NULLNINE, -NULLNULLEIGHT + batY , NULLNULL, NULLNULL, NULLNULLFIVE, NULLTWO );
drawObject( -NULLNINE, -NULLNULLEIGHT - batY , NULLNULL, NULLNULL, NULLNULLFIVE, NULLTWO );
drawObject( ballX, ballY, NULLNULL, NULLNULL, NULLNULLFIVE, NULLNULLFIVE );
}
But as i have seen you are using floats, which needs some extra space in the exe... you can do all the things with integers and dont need to use OGL-floating commands, i am sure this will produce a small exe too. good luck!