Friday, 22 April 2011

blog placeholder

long time no post
yesterday was so memorable i needed to record it somewhere

- i had breakfast with my parents
- i was able to add an input format to bino
- i was able to make a Siano SMS1140 tuner working (needed this file renamed as dvb_nova_12mhz_b0.inp)
- i was able to change the fuse for my car plug that blew two weeks ago
- i was able to change one light lamp of my car

\o/

Friday, 14 January 2011

vimeo rocks

So i decided to post my videos on Vimeo, with english subtitles

Attesa - http://vimeo.com/18759147
Ulysses' Syndrome - http://vimeo.com/18763331
Out of order - http://vimeo.com/18765477

and to celebrate this move, here is my first timelapse

Waiting for light

Waiting for light from Vittorio Giovara on Vimeo.

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 );
glEnd();


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

FINALLY!
After almost 1 year of work, the porting is done!
http://itunes.apple.com/us/app/hedgewars/id391234866?mt=8

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!

Documents

Wednesday, 16 December 2009

How to compile SDL_Mixer for the iPhone

So this is a question that has popped up more than once in SDL mailing list, so I decided to give my contribution to the howto-documentation. If you're looking for Ogg or MP3 decoders this is your guide; unfortunately i couldn't make it compile with MIDI support.

First: open the XCode.tar.gz archive in the SDL_mixer sources, and load the project file in Xcode.
Second: go the project preferences and modify the base sdk and architecture like in the pictureOf course you can choose a lower sdk, i successfully compiled the library for iphone 2.0. Once in the main windows again choose the "Static Library" from the Active Target list.
Third: Expand the Targets label on the left and double click on Static Library; this will show the specific target options. Select the Preprocessor macros doubleclicking it and modify it by removing MID_MUSIC, MOD_MUSIC and USE_NATIVE_MIDI and add __IPHONEOS__ definition.

Fourth: One last step, remove native_midi_macosx.c from the Compile Sources list in your Static Library target and the library is ready! It's compile time!


Sound great doesn't it? However here is bad news: for our application to correcly load OGG file (and most likely mp3 as well but i haven't tested it) we'll need another library to correctly link the various ogg functions. Don't worry, I'll guide you!

We have two options:
1- we can download ogg and vorbis and compile them from command line, set up the dependencies between the two, fix the paths and so on... if you're eager to try the command line is this:
< ./configure --prefix=/usr/local/iphone --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.2.1 CFLAGS="-pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.1 -gdwarf-2 -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/usr/include/libxml2 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk" CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk -Wl,-dead_strip -miphoneos-version-min=3.1" >
2- we can simply use Tremor, which is an ogg implementation designed for memory constrained device with only integer operations: perfect for the iphone!
It comes bundled in another project, Cocos2d, a great framework for games. If you download it and select the libvorbis target, you will get a single decoding library statically linked for the iphone. It's compile time again!

Place both libraries in the Frameworks folder of your application and... Enjoy your ogg audio on the iphone!
Please drop a comment for critics and suggestions (and appreciations too :) )
Vittorio



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 projectsymphony@gmail.com