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 

images on screen?

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



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Fri Jan 30, 2009 11:56 pm    Post subject: images on screen? Reply with quote

i want to draw images on screen, i'm studying the GU but it's only for 3d...
are there any functions for 2d?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Sat Jan 31, 2009 12:13 am    Post subject: Reply with quote

"drawing" means basically copying (or "blitting") images into the region of memory marked as video memory. If -for instance - graphic mode of PSP is setted in a 8888 mode, then each pixel will be rapresented by four bytes (let's say RGBA). To draw an image at (x, y) you'll need to copy each line of your sprite to memory starting at address vindex+x+y*linesize*pixelsize vindex being the start of vram, linesize being the alignment (usually 512) and pixelsize the size in bytes of a single pixel (4 in our previous example). GU IS NOT for 3d only since if you need to be hardware accelerated you MUST use it (or at least you must use graphic engine's chip). So you can use GU ignoring z axis (and configuring camera properly)...play around with pspsdk examples
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Sat Jan 31, 2009 1:13 am    Post subject: Reply with quote

jean wrote:
"drawing" means basically copying (or "blitting") images into the region of memory marked as video memory. If -for instance - graphic mode of PSP is setted in a 8888 mode, then each pixel will be rapresented by four bytes (let's say RGBA). To draw an image at (x, y) you'll need to copy each line of your sprite to memory starting at address vindex+x+y*linesize*pixelsize vindex being the start of vram, linesize being the alignment (usually 512) and pixelsize the size in bytes of a single pixel (4 in our previous example). GU IS NOT for 3d only since if you need to be hardware accelerated you MUST use it (or at least you must use graphic engine's chip). So you can use GU ignoring z axis (and configuring camera properly)...play around with pspsdk examples


so, is there a function to read a texture from file and blit it to the screen? or should i copy byte manually?
i know another way is to create a mesh on the screen and texturize it as if it is the screen...possible using psp?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sat Jan 31, 2009 1:19 am    Post subject: Reply with quote

Have a look in the graphics.c source, you can find it with some doc on psp-programming.com...
_________________
Get Xplora!
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Sat Jan 31, 2009 1:37 am    Post subject: Reply with quote

ne0h wrote:
Have a look in the graphics.c source, you can find it with some doc on psp-programming.com...

i have a problem....i would like to use SDL because i used it on windows, but i'm on win32 psp sdk and afaik the SDL for psp is avaible only on linux.... (i should compile it on linux with make!)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sat Jan 31, 2009 3:25 am    Post subject: Reply with quote

I've used SDL on one of my programm and I use the Heimdall sdk, (win32 like )....
I don't remember if I've downloaded it or I've found it in the SDK...
_________________
Get Xplora!
Back to top
View user's profile Send private message
roby65



Joined: 01 Jun 2008
Posts: 55
Location: Mid Italy

PostPosted: Sat Jan 31, 2009 5:32 am    Post subject: Reply with quote

i'm reinstalling everything from 0 using cygwin, i will post soon if i have problems installing SDL...thx :)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Sat Jan 31, 2009 6:47 pm    Post subject: Reply with quote

There's nothing difficult about looking into examples, i don't think you'll find more help than this here. And, also, an advice: download Heimdall's sdk, don't mess around with cygwin - it is the fast way. Just another word before you come back saying "Oh, well, where can i found that beauty"...there's a link called "search" in this forum, and friends tell me it can do miracles....
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Feb 01, 2009 9:30 am    Post subject: Reply with quote

Search isn't even needed for that... it's about six threads down on the front page of this forum. :D
Back to top
View user's profile Send private message AIM Address
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