code
iphone sdk amb suport de OpenGL!!
0Toma pelotazo!
Han tret la 4a beta del SDK del iphone, el readme posa…
This fourth beta release of the iPhone SDK includes a complete set of tools, compilers, frameworks, and documentation for creating iPhone OS applications. These tools include the Xcode IDE, and the Instruments analysis tool, among many others. With this software you can develop applications that run on iPhone and iPod touch using the included iPhone Simulator.”
per fi!!!
GenLab: My last insane tool
0Hi all!!! After some weeks developing and doing some research with Cocoa and xcode, I’ve some cool screenshot to show!!
By the moment, I’ve started integrating the Texture Generator, and all seems to work fine (as you can see
), once this tool is totally ported, I’ll start with the other 2.
Learning objective-C
0fast code: from a "traditional" image buffer to NSImageView
0Just a fast code lesson:
Assumptions:
gfx_data (uchar) –> our “traditional” RGB image buffer
IVFinalexture (NSImageView) –> where we want to view our image
bmp (NSBitmapImageRep) –> Temporal, to store the rgb buffer
img (NSImage) –> Temporal, to store the Bitmap
So the sequence (more or less) is:
uchar buffer –> NSBitmapImageRep –> NSImage –> NSImageView
unsigned char *gfx_data;
int gfx_width = 256;
int gfx_heigth = 256;
int gfx_samplespp = 3;
gfx_data = malloc (gfx_width*gfx_heigth*gfx_samplespp);
int i=0;
int max = gfx_width*gfx_heigth*gfx_samplespp;
for (i=0; i<(max);i+=3)
{
// Do your demoscene-fancy effect here
int valor = sin((float)i*4.0/(float)(gfx_width*gfx_heigth))*255.0;
if (valor<0) valor="valor*-1;
gfx_data[i]= valor;
}
// Convert buffer to NSBitmapImageRep
NSBitmapImageRep* bmp = [[NSBitmapImageRep alloc]initWithBitmapDataPlanes:&gfx_data
pixelsWide: gfx_width
pixelsHigh: gfx_heigth
bitsPerSample: 8
samplesPerPixel: gfx_samplespp
hasAlpha: NO
isPlanar: NO
colorSpaceName: NSCalibratedRGBColorSpace
bytesPerRow: (gfx_width*gfx_samplespp)
bitsPerPixel: 24];
// Store the NSBitmapImageRep in a NSImage structure
NSImage *img = [NSImage alloc];
[img addRepresentation:bmp];
// Set the NSImage into the NSImageView (IVFinaltexture)
if ([IVFinaltexture image]!=nil)
[[IVFinaltexture image] release];
[IVFinaltexture setImage:img];
//free (gfx_data); // WTF! system crashes if I uncomment this!
[bmp release];
[img release];
————–
And… obviously… the result!!
El Emulador del iPhone no té suport de OpenGLES
0El emulador del iPhone que ve amb el SDK oficial no té suport de OpenGL-ES!!! és increible!!, però si tota la interfície (diria) que va amb OpenGL! com pot ser que no pugui ni tan sols inicialitzar una finestra de OpenGL amb el emulador???
Per el missatge d’error, sembla que la (cara) solució és comprarse un iPhone/ipod Touch i connectarlo al mac… però això no és viable!! amb PocketPC ja passava això i de totes les HORES i HORES que m’he passat programant en pocketPC casi mai vaig usar el dispositiu real (tot i que el tenia), però a la llarga no és pràctic… el que volem és un simulador, però un simulador que ho emuli TOT senyors, no em vinguin amb milongues de que la part de OpenGL-ES no la poden simular pq no m’ho crec!!
A més, encara tinc que enterarme be del rollo del certificat digital que Apple tha de dornar per poder fer applicacions per iPhone… pq com s’hagi de pagar… ho tenen clar els de apple que pagaré per poder fer demos en iphone!! ademes, que tenen que ser revisades per ells… thsss!!, no flipen ni res!!
Per si de cas, aniré mirant-me el SDK no oficial….
Trastejant amb el sdk del iphone
0Ahir el nostre amic silenci es va apoderar de un ipod touch… realment impressionant!! aixi que no me n’he pogut estar i m’he instal·lat el SDK del iphone… realment els de Apple ho han tornat a fer!! té una pinta impressionant!!!
De moment he pogut fer molt poques coses, sol fer una app d’exemple i poc més.. tot i que sembla que sol es pot fer servir objective-C, es veu un entorn molt potent i amb moltes possibilitats.
Per cert, he vist una cosa curiosa al emulador del iphone… futur suport de… català¿?
pomod 0.7.6 update!! (again!!)
0- Default config changed, now ‘Accurate mpeg’ option is false by default (streams load much faster)
- Spectrum bars control is not visible if we disable it
pomod 0.7.5
0Well, we can say that it is a minor version (0.7 to 0.7.5), there are no big news, only small bugfixes, and a small feature:
- Feature: File list now is sorted alphabetically (for me, is a big feature, despite it was only 1 line of code
) — little changes are powerful [capità enciam] - Bug: Deleting a file from playlist without anything selected was causing an exception
- Bug: Spectrum bars where not loaded propertly from default config file
- Bug: Spectrum bars are setted to zero’s if we disable spectrum analyzer viewer (merlucin request)
Meanwhile, a new music pack is coming, so stay tunned!
Novetats de l’últim xcode3
2Hola! porto un parell de dies trastejant amb el últim xcode 3 (el que be amb el Leopard) i he de dir que porta més canvis dels que em pensava, entre ells hi destaco:
La veritat és que em va xocar bastant al principi, però després de fer-ho servir una mica he de dir que és un sistema bastant mes pràctic i menys caòtic… tot i que això impliqui canviar tots els meus tutorials… o fer-ne de nous!
- La manera de connectar els botons i finestres l’han fet mes intuitiu i en qualsevol moment pots veure com tens els controls connectats.
- Core animation!!! m’he quedat flipat al veure que es poden aplicar efectes de core animation a elements de finestra, coses com aplicar un radial blur a un botó, o fer un efecte de ‘pixellate’ a una llista de elements és, com a mínim, curiós!! (ojo, no dic que sigui pràctic! dic que és curiós!)
- Els snapshots! tot i que encara no he probat, ens permet fer canvis al nostre codi, podent fer un “revert” del codi i tornar a com estavem abans… sense tenir que ser servir cap SVN. Útil per canvis “tontos” o proves de concepte.
- Els errors es mostren a la pantalla de codi… sembla una tonteria, però ho trobo super útil!!!
- El codi el podem replegar, de manera que no molesti… bastant pràctic!
- El ObjeciveC 2.0 i el garbage collector. Aquesta és una gran novetat ja que, a part de les novetats del ObjectiveC 2.0, per els programadors destralers com jo, el garbage collerctor ens va de conya per oblidar-nos una mica dels maldecaps dels malloc’s i frees
- El Xray te molt bona pinta segons em va dir el Winden, així que tindré que seguir investigant, ja que encara no he pogut veure com funciona realment…
… i moltes mes coses que incorpora… pero no m’ha donat temps de veure com van
seguirem informant!!



Recent Comments