Mixing SDL and PSPGU OR PSPGL texturing questions

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

Moderators: cheriff, TyRaNiD

Post Reply
Archaemic
Posts: 38
Joined: Sun Mar 18, 2007 7:23 am

Mixing SDL and PSPGU OR PSPGL texturing questions

Post by Archaemic »

Can you mix SDL and PSPGU? And if so, how? Resizing everything on the CPU is really awful. I thought I might be able to mix PSPGL with SDL, but it looks like textures are necessarily in VRAM on PSPGL (am I mistaken? If so, how do you make the textures in regular RAM?). The texture is not used that much. I just want to mark a certain area of memory as the texture to use, draw it, and then remove it. That's for PSPGL, if I can do that. If not, I want to mix PSPGU and SDL. I load all the images with SDL_image, but resizing is a pain, and too slow. The textures I have are generally too large to fit in VRAM, so I need them to be loaded in regular RAM (they are usually 3 - 7 MB, sometimes as large as 10 MB).
So I'm just wondering how to render to an SDL screen with PSPGU if it can be done, or how to mark a section of memory as a texture for PSPGL. I'm really having trouble finding answers on Google.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

You should be able to just use normal SDL GL stuff.
See rRootage in the pspware repository for an example.
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Re: Mixing SDL and PSPGU OR PSPGL texturing questions

Post by Raphael »

Archaemic wrote: So I'm just wondering how to render to an SDL screen with PSPGU if it can be done, or how to mark a section of memory as a texture for PSPGL. I'm really having trouble finding answers on Google.
You can't render to system ram. So unless you fit your render texture into VRAM, you're out of luck.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Archaemic
Posts: 38
Joined: Sun Mar 18, 2007 7:23 am

Post by Archaemic »

That's what I thought too, until I saw this:
http://psp.jim.sh/pspsdk-doc/group__GU. ... 790833dc3a

Or wait, you said render to system memory. The SDL screen is allocated in hardware. I want to render something FROM memory TO vram. Really, I just want to take advantage of the GE for a boost in resizing speed.
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

You can render FROM system ram, yes, you just need to give the pointer to the texture in the sceGuTexImage function. The only limitation is that the texture is 512x512 max (I doubt your 7-10MB image fits those restrictions, so you'd need to subdivide the rendering into seperate tiles).
The rendertarget needs to reside in VRAM and is also 512x512 max (specified via sceGuDrawBuffer
  • ()).
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Post Reply