Good tutorial for the gu?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Good tutorial for the gu?

Post by Gary13579 »

I was just using the pg.h and pg.c from hello world, but people have been saying I need to start using the Gu.

I've downloaded and installed libpng and zlib, now is there any pre-made files for blitting images, and hopefully transparency?
If there isn't, how about a good tutorial?

I've looked in the include files, and found a bit, but not much. I have also looked at samples/gu/blit, but that's a lot of code just to blit a random image...
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

Post by jsgf »

The code in sample/gu is pretty minimal, though the blit code is a bit over-complex by in trying to optimise by transferring in cache-friendly chunks.

You could consider using PSPGL. It has a somewhat higher-level interface for interfacing to the graphics hardware, and I wrote a simple sprite library layered on top of it to demonstrate its use for 2D graphics.

See http://www.goop.org/psp/gl and http://hg.goop.org/pspgl/libsprite?cmd= ... p;type=zip for the sprite code. http://goop.org/psp/gl/sprite-test.zip is a demo of it in action.
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

Yes, but PSPGL looks like it would be more complex :)

It was suggested that I should use the Lua Player graphics.c/h. I looked at this code, does anyone have a quick sample of how to load a PNG and display it to the screen using this method?
71M
Posts: 122
Joined: Tue Jun 21, 2005 5:28 am
Location: London

Post by 71M »

You might want to look at the code to FileAssistant++, there's a simple texture manager CTextureManager.cpp and a simple GU wrapper in CGfx.cpp
Hopefully that'll give you a start for what you're needing.
PM me with any further questions you have regarding this.

Cheers,
71M
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

I didn't know FA++ was open source :O
Plus I'd really rather have the simpliest thing possible. I'm new to programming on consoles, and pretty new to C++ itself.

Edit: I've gotten the PSP to blit images using the Lua Player graphics.c :D
Now, does anyone know how transparency works?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

The 'overcomplex' code was done in the process of increasing performance however. Since it makes such a big difference in speed, it has been kept that way, doing a fullscreen-blit as one operation really takes a big bite out of cache-effiency. I hope your code still deals with this. :)
GE Dominator
Post Reply