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 

sceGuTexImage 4th parameter?

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



Joined: 13 Sep 2007
Posts: 19
Location: Gorizia, ITALY

PostPosted: Fri Sep 14, 2007 8:48 am    Post subject: sceGuTexImage 4th parameter? Reply with quote

sceGuTexImage( 0, Width, Height, Witdh, data);

I can't understand well this 4th parameter, I found it's not the width, but you've got to set the same value of the texture width: it's always ok since we use square textures (128*128.. 512*512 ecc) but when I got to use a texture of 32pixels * 128? What is exactly this value?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Fri Sep 14, 2007 5:44 pm    Post subject: Reply with quote

Parameter 2 is the texture width
Parameter 4 is the texture buffer width.

There's a big difference between the two... The second parameter is required to be a power of 2, and describes how to address inside the texture. Parameter 4 describes how the texture is layed out in memory, and is required to be aligned to 16 pixels, but need not be to be set to the same value as the texture width, you can for example set the hardware to render from a 256x256 texture stored inside a 512x256 block:
Code:
sceGuTexImage(0, 256, 256, 512, texture);

_________________
GE Dominator
Back to top
View user's profile Send private message
ruspa



Joined: 13 Sep 2007
Posts: 19
Location: Gorizia, ITALY

PostPosted: Sat Sep 15, 2007 2:24 am    Post subject: Reply with quote

I got it! So, if I have only one texture in an image, I will use the image width, while if I have prepared a font table image, I will set the buffer width to the font width so that the gu can jump correctly to the rightmost pixel to the first one of the next line, isn't it?

Thanks for telling me, this is really important and useful (assuming I understood hehe) :D
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