images on screen?

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

Moderators: cheriff, TyRaNiD

Post Reply
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

images on screen?

Post by roby65 »

i want to draw images on screen, i'm studying the GU but it's only for 3d...
are there any functions for 2d?
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

"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
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

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?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Have a look in the graphics.c source, you can find it with some doc on psp-programming.com...
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

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!)
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

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...
roby65
Posts: 52
Joined: Sun Jun 01, 2008 9:12 pm
Location: Mid Italy
Contact:

Post by roby65 »

i'm reinstalling everything from 0 using cygwin, i will post soon if i have problems installing SDL...thx :)
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

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....
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Search isn't even needed for that... it's about six threads down on the front page of this forum. :D
Post Reply