Page 1 of 1

graph.c help

Posted: Thu Jun 02, 2005 2:01 am
by Hedonis
Heya's, ive dont alot of reading/trial and error but im still stumped on how to use graph from the ps2sdk to use a chain and write an image to the screen. I get absolutely nothing on screen or junk if I play around with the BITBLTBUF settings..

shouldnt a call to graph_vram_write be enough to achieve this?

address = 0
width = 128
height = 128
psm = GS_PSM_CT24
data = Tex->mem (loaded correctly in to memory)
data_size = 128x128x24 bits = 49152 bytes (which is 3072 Qwords)

if someone can point me in the right direction it would be very appreciated!
Hed

Posted: Thu Jun 02, 2005 2:19 am
by ooPo
Writing data directly to the framebuffer can be tricky due to the weird ways the GS uses vram.

You might get better results by writing the data offscreen and use a textured sprite primitive to draw it onscreen.

Still, graph_vram_write() should be enough. I'd suggest you make sure the framebuffer and texture are the same bit depth (CT24 in this case) and make sure Tex->mem is correctly aligned in main memory (use memalign instead of malloc).