2D accelerated Sample ?
2D accelerated Sample ?
Hello, i'm looking for a simple sample, showing how to display some png images, using the hardware acceleration.
It could be a simple pspgl sample.
This kind of sample can be very useful for beginning a 2d project.
I searched a lot but didn't find, so i post this request.
Thanks for your help.
It could be a simple pspgl sample.
This kind of sample can be very useful for beginning a 2d project.
I searched a lot but didn't find, so i post this request.
Thanks for your help.
thanks for your answer
i like sdl, but i really think that it is a good idea to start a project using the more acceleration avalaible.
i know the dreamcast scene, and the first sdl libs weren't hardware accelerated. chui recently released a sdl lib with hardware acceleration and it's very fast.
I hope the psp-scene release a sdl - hardware accelerated, just as chui did.
i like sdl, but i really think that it is a good idea to start a project using the more acceleration avalaible.
i know the dreamcast scene, and the first sdl libs weren't hardware accelerated. chui recently released a sdl lib with hardware acceleration and it's very fast.
I hope the psp-scene release a sdl - hardware accelerated, just as chui did.
The video hw acceleration in sdl (currently) only applies to rescaling odd resolutions and old-school bit depths.
A hw accelerated blit (sceGuCopyImage) could be easily added ... but the Gu is currently only initialised with a SWSURFACE. So for the blit to work, Gu must also be initialised with a HWSURFACE, any objections?
A hw accelerated blit (sceGuCopyImage) could be easily added ... but the Gu is currently only initialised with a SWSURFACE. So for the blit to work, Gu must also be initialised with a HWSURFACE, any objections?
How would sceGuCopyImage allow hardware acceleration?
Would it only allow accelerated blits for images that do not use alpha blending or a transparency color? I thought to utilize eaither of those features, you had to use the GU, or a port of openGL and the likes.
Also, is there a hardware accelerated SDL revsion in the SVN somewhere, or was mrbrown only referring to the one that is limited in HW acceleration to scaling images at odd resolutions (the main copy)?
Garak
Would it only allow accelerated blits for images that do not use alpha blending or a transparency color? I thought to utilize eaither of those features, you had to use the GU, or a port of openGL and the likes.
Also, is there a hardware accelerated SDL revsion in the SVN somewhere, or was mrbrown only referring to the one that is limited in HW acceleration to scaling images at odd resolutions (the main copy)?
Garak
There's some stuff in the existing code that could be cleaned up a bit. For example GuUpdateRects should only update the rects it's passed, not the entire screen, and there's a bug I'd like to track down where the scaled screen is sometimes shifted right a few pixels, and sometimes doesn't show up at all (this is with 320x240x16, and it changes each time I run the program; I'll see if I can make an example). Also, what do you think about making the scaling configurable? Maybe SDL_FULLSCREEN could be used to indicate whether we want aspect ratio preserved.
I'm with you on that generic GuUpdateRects. I've already split it into a GuStretchBlit function - as I reuse it for scaled hwsurface accelerated blits.
I propose an environment variable be used to preserve aspect ratio (other video drivers use getenv). X11 uses SDL_VIDEO_CENTERED and SDL_VIDEO_WINDOW_POS for instance. And DirectFB defines SDL_DIRECTFB_MGA_STRETCH to zoom. Perhaps the best name would be SDL_ASPECT_RATIO...?
I propose an environment variable be used to preserve aspect ratio (other video drivers use getenv). X11 uses SDL_VIDEO_CENTERED and SDL_VIDEO_WINDOW_POS for instance. And DirectFB defines SDL_DIRECTFB_MGA_STRETCH to zoom. Perhaps the best name would be SDL_ASPECT_RATIO...?
I propose we make it even more flexible: SDL_VIDEO_WINDOW_POS=x1,y1,x2,y2. For example fullscreen is 0,0,479,271, 4:3 aspect ratio would be around 59,0,421,271, and an unscaled 320x240 is 80,16,400,256. Could specify a fullscreen rotated mode, too: 479,0,0,271rinco wrote:I propose an environment variable be used to preserve aspect ratio
Re: 2D accelerated Sample ?
Here is my very simple sample for you. I cut the codes from the TV program I am working on.
It uses GU only (I still cant get SDL compile on pspsdk ...), sceGuCopyImage for drawing to vram, double buffered, do 60 fps atm (because it is very basic).
What ...
It keep drawing two BMPs into screen ..
Usage ..
TRIANGLE : show fps
CROSS : exit
any other buttons : pause the drawing.
Tools :
http://mach-one.uw.hu/index.php?stuffz=win/m1pspc
for convert bmps to c
GFX :
Thanks http://www.themepsp.com/ for the car images.
DL :
http://www.users.on.net/~froggy/
Hope it helps !!!
It uses GU only (I still cant get SDL compile on pspsdk ...), sceGuCopyImage for drawing to vram, double buffered, do 60 fps atm (because it is very basic).
What ...
It keep drawing two BMPs into screen ..
Usage ..
TRIANGLE : show fps
CROSS : exit
any other buttons : pause the drawing.
Tools :
http://mach-one.uw.hu/index.php?stuffz=win/m1pspc
for convert bmps to c
GFX :
Thanks http://www.themepsp.com/ for the car images.
DL :
http://www.users.on.net/~froggy/
Hope it helps !!!
patpsp wrote:Hello, i'm looking for a simple sample, showing how to display some png images, using the hardware acceleration.
It could be a simple pspgl sample.
This kind of sample can be very useful for beginning a 2d project.
I searched a lot but didn't find, so i post this request.
Thanks for your help.
I put together a sample of layering a simple sprite library on top of PSPGL to get accelerated blitting performance. This goes beyond simple blitting, and makes the hardware's ability to also scale, rotate and tint sprites easily usable.
The demo draws a few dozen sprites of various sizes (up to half the screen size), all blended, without making the PSP break a sweat. 'Circle' pauses things so you can see what's going on.
You can download the executable from http://www.goop.org/psp/gl/sprite-test.zip.
Source is at http://hg.goop.org/pspgl/libsprite?cmd= ... p;type=zip; you'll need a current pspgl-jsgf as well (http://www.goop.org/psp/gl).
The demo draws a few dozen sprites of various sizes (up to half the screen size), all blended, without making the PSP break a sweat. 'Circle' pauses things so you can see what's going on.
You can download the executable from http://www.goop.org/psp/gl/sprite-test.zip.
Source is at http://hg.goop.org/pspgl/libsprite?cmd= ... p;type=zip; you'll need a current pspgl-jsgf as well (http://www.goop.org/psp/gl).