forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Good tutorial for the gu?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri Nov 04, 2005 10:19 am    Post subject: Good tutorial for the gu? Reply with quote

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...
Back to top
View user's profile Send private message
jsgf



Joined: 12 Jul 2005
Posts: 254

PostPosted: Fri Nov 04, 2005 10:44 am    Post subject: Reply with quote

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=archive;node=tip;type=zip for the sprite code. http://goop.org/psp/gl/sprite-test.zip is a demo of it in action.
Back to top
View user's profile Send private message Visit poster's website
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri Nov 04, 2005 10:49 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Fri Nov 04, 2005 11:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri Nov 04, 2005 11:38 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Fri Nov 04, 2005 4:25 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group