ricardocabellov5.0balter-egos
trace mr.doob r08028
blogdemoscenefeaturedextrascontact
 *blog... kind of... *rss

« DiverterInspire08 demo log, da... »

Inspire08 demo log, day 30
13.05.2008
Status:
-2 days left until Inspire08
Back to the system code


... Ok, porting this to LWJGL ended up being a waste of time. The main porting was very quick, like, in 30min I had it done and working. Doing the applet version took more time, about 4 hours or so. And in the end there were some weird bugs with the timer, and after all the time spent trying to understand how to do the Applet version is the last thing I wanted to see. So, back to JOGL.

I also spent more time again on getting the position of the tune. I managed to get something this time. SourceDataLine.getFramePosition() return the amount of samples played, but they numbers aren't as smooth as a normal Timer, like the same number may repeat 5 times, which means that the animation is jumping. I had to do a crap fix for that:

public static long getPosition()
{
	/*
	 * For some reason the SourceDataLine.getFramePosition()
	 * doesn't give back smooth sequence of numbers, here it's
	 * a crap fix for it.
	 */
	
	if (lastSampleInfo != tune.getPosition())
	{
		lastSampleInfo = tune.getPosition();
		lastTimerInfo = System.currentTimeMillis();
	}
	
	return lastSampleInfo + (System.currentTimeMillis() - lastTimerInfo);
}

Am I the only one that thinks that it's weird that I have to do this? Still, it kind of works, but sometimes jumps back a tiny bit, I may come back to this code in a few days to try other things, but at least it uses the audio timer (somehow).

I was now starting doing the font system, it will take a bit still as I need to find the best/most dynamic approach.

I felt that closing the previews was a bad idea, so as soon as I have some text on top of the screen working I'll put a new version online so you can see where the thing is going.
posted by trace at 01:20
0 comment written so far

SORRY!
Is not that I don't care about what you have to say, of course I do, but they are speaking louder and I lost my patience :(
 *profile 



traditional id: Ricardo Cabello Miguel
based in: London, UK
serving to: Hi-ReS!
contact me: click here


 *latest posts 

* Inspire08 demo log, day 117 (07.08.2008)
* Inspire08 demo log, day 116 (06.08.2008)
* Thank you for writing to Yahoo! Accou... (01.08.2008)
* Thank you for writing to Yahoo! Accou... (01.08.2008)
* Definition of FAIL (31.07.2008)
* Ronny Pries live @ Alpha Box Jan'08 (23.07.2008)
* WALL·E (23.07.2008)
* Where do we get the time from? (22.07.2008)
* And now... can flash render a 320k+ vo... (21.07.2008)
* Pixel Attack 08 - 3D Slides (21.07.2008)
* My take on the RA DIOHEA_D / HOU SE OF... (20.07.2008)
* Story of Stuff (19.07.2008)
* FabricLive 40 DJ Noisia (17.07.2008)
* Can BitmapData.setPixel() fill your Br... (17.07.2008)
* Yet another 3D Clock (D///FEST holding... (11.07.2008)


 *latest comments 

* C++, SDL Coding? Maybe.. ;) (Preview) (trace)
* C++, SDL Coding? Maybe.. ;) (Preview) (Joey)
* La picaresca (spt)
* Mr. Slip Up (ricardo)
* La picaresca (ricardo)
* La picaresca (spt)
* La picaresca (sole)
* Demoscene @ Cirsa (sml)
* La picaresca (humphr3y)
* La picaresca (alfio)
* fiver2's new baby: debris (Jcl)
* Barcelona = full of shit(s) (Soli)
* Demoscene @ Cirsa (Scener)
* Rar & unrar with Ubuntu (SethPlate)
* Mindcandy 2 (Jcl)


 *advertising