dijous, abril 24, 2008

iphone sdk amb suport de OpenGL!!

Toma 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!!!

Etiquetes de comentaris: ,

diumenge, abril 20, 2008

GenLab: My last insane tool

Hi all!!! After some weeks developing and doing some research with Cocoa and xcode, I've some cool screenshot to show!!
I've called this tool "GenLab" (Generator Lab), and will be the fusion of my 3 tools developed until now: Texture Generator, Texture Library and Object Generator... and probably another cool idea :)

By the moment, I've started integrating the Texture Generator, and all seems to work fine (as you can see :P), once this tool is totally ported, I'll start with the other 2.

Etiquetes de comentaris:

Learning objective-C

For everybody that want to start coding with Cocoa using Objetive-C, I recomend you this tutorial published in the great Cocoa Dev Central webpage. A good point for starters!!!

Etiquetes de comentaris:

dimecres, abril 02, 2008

fast code: from a "traditional" image buffer to NSImageView

Just 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];
I think that I've some problems releasing the data, but I think that you can make an idea of the process, I'm not describing how to write code, just explaining a process to display an image buffer in Cocoa (in my opinion, not properly documented).
--------------

And... obviously... the result!!


.happy coding!!

Etiquetes de comentaris:

dilluns, març 31, 2008

Dr. Who a TV3 (K3)!! i més news!!

Avui he escoltat a la radio que a TV3 emeten avui la MÍTICA sèrie Dr. Who!!!
Siiii!!! encara recordo estius veient embobat la (cutre) série Dr.Who!, és una sèrie de lo més surrealista, però que té molts seguidors a UK (per algo té 26 temporades!!!). Dons això, avui a les 20.45 al K3, toca ració de sci-fi!!!

Si, ho sé, la sèrie de Terminator: Les cròniques de Sarah Connor no val res!! jo la vaig estar veient i vaig tenir que apagar a meitat de capítol de lo cutre que era... per favor!!! qui es traga lo del terminator adolescent!!!!

Ah!!! Battlestar Galactica Temporada 4, comença el dia 4/04/2008, o sigui d'aquí res!! així que ja podeu preparar els bostres "burritos", a partir d'ara toca ració setmanal de Galàctica!! (i serà la última temporada!! :P)


Ahhhh!! i per acabar-ho de rematar, tenim X-files 2 d'aqui a res!! el 25 de Juliol he sentit!!


Etiquetes de comentaris:

dijous, març 27, 2008

Feel the force young tester

Etiquetes de comentaris:

dimarts, març 25, 2008

El Emulador del iPhone no té suport de OpenGLES

Desastrós!!!!

El 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.... :)

Etiquetes de comentaris: ,

divendres, març 21, 2008

my iphone hello world

weee!!!! quite simple!!

Etiquetes de comentaris:

back from india!!!

Hola a tots!!
Afans seguidors del meu blog!! se que heu patit molt perque no posava posts!!! però tranquils!! les vostres pregàries han sigut escoltades i això no passarà mai mes!!! simplement, estava molt liat amb la nova feina per trobar estones per escriure posts, però això s'ha acabat!, ja torno a estar a tope!!
A la nova feina estem tots bastant liats: és un nou projecte, som un equip bastant gran i tenim bastantes persones al càrrec, o sigui que aquests 2 primers mesos han sigut durillos, i la feina està sortint per tot arreu, però amb organització, tot acava tirant endavant!

Aquestes darreres 3 setmanes he anat a la India per motius de feina, de visita a la empresa Wipro. Wipro s'encarrega de proporcionar serveis de IT a Zurich, i com tot està començant, un company i jo a veure la gent, donar seminaris, etc... vamos, el que diriem "veure com està el patio". La idea que m'enporto és molt positiva, però no fa falta entrar en els detalls... aqui em limitaré a explicar el que he vist del país, la gent, posar fotitos i tot això... :D

Estic preparant una "cole" de fotos i videos, de les casi 800 que vaig fer :P

Etiquetes de comentaris:

Trastejant amb el sdk del iphone

Ahir 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à¿?

Etiquetes de comentaris: ,