Problem in Texture iOS

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
mrfit
Gnoblar
Posts: 2
Joined: Mon Jul 23, 2012 9:53 am

Problem in Texture iOS

Post by mrfit »

Hi I am trying this code on my iPad,

Code: Select all

Ogre::Real Width=800; Ogre::Real Height=600;
TexturePtr texture = TextureManager::getSingleton().createManual("DynamicTexture", // name
                                                                  ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
                                                                  TEX_TYPE_2D,       // type
                                                                  Width, Height,      // width & height
                                                                  0,                         // number of mipmaps
                                                                  PF_BYTE_BGRA,     // pixel format
                                                                  TU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
      
printf("width is: %ld\n",texture->getWidth());
printf("height is: %ld\n",texture->getHeight());
And the Result is :

width is: 1024
height is: 1024

Is there a problem in the create function, does it not use the width and height values specified?. Please help
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: Problem in Texture iOS

Post by Wolfmanfx »

Thats ok it rounds the texture dims to the nearest power of two dims.
mrfit
Gnoblar
Posts: 2
Joined: Mon Jul 23, 2012 9:53 am

Re: Problem in Texture iOS

Post by mrfit »

But I tried the same code on the Mac OS and it worked as expected the height and width are what is specified. For the iOS I need the width and height to be 800x600 not 1024x1024. I think there is a bug in the iOS Port, what do you think?
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Problem in Texture iOS

Post by masterfalcon »

Wolfman's right, it's not a bug. For GLES 1 and 2 the dimensions are rounded up. NPOT textures aren't turned on yet, there was a bug that I found that I haven't gotten to fixing.