How is it be solved that the texture have it's dimensions not be powers-of-two?

I studied cocos2d code, and did not find out how it is soloved.

I rewrite the texture code access the cocos2d-x code, and it dosn’t use the shader program.But when the texture’s dimensions isn’t the powers-of-two,it dosen’t show up.why?

I used android platform

Im’ not sure i understand your question but here are my thoughts:
You won’t be able to use textures which are not powers-of-two for tiling.
There is no way a shader program is not used. In OpenglES 2.0 the shader program is a must have.

Thanks, The solution is shader program? If it is,then how it solve it?

The power of two is a hardware constraint. It is the best way to store textures in the memory.
What do you want to solve? And why?

I want to support textures which are not powers-of-two.Because this is convenient for my project.
I found the cocos2d-x support it, but I don’t found how it did.

apple jday wrote:

I want to support textures which are not powers-of-two.Because this is convenient for my project.
I found the cocos2d-x support it, but I don’t found how it did.

have you looked at this function in CCTexture2D.cpp?

bool CCTexture2D::initWithData(const void *data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, const CCSize& contentSize)

vamsi krishna veligatla wrote:

apple jday wrote:
> I want to support textures which are not powers-of-two.Because this is convenient for my project.
> I found the cocos2d-x support it, but I don’t found how it did.
>
have you looked at this function in CCTexture2D.cpp?
>
bool CCTexture2D::initWithData(const void *data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, const CCSize& contentSize)

Yes, I had study the code in the CCTexture2D,and I rewrite the code into my project, but it doesn’t support the textures which are not powers-of-two.
The difference of them is I didn’t use the shade program.