[T2Di 1.3] setScreenMode gets called twice when running on the iPhone
by Dave Calabrese · in iTorque 2D · 02/01/2010 (7:54 pm) · 7 replies
SetScreenMode gets called twice when running on the device. This could potentially cause some weird resolution settings. This call is already handeled through iPhoneOGLVideo.mm, so this call only duplicates it. Fix is simple:
In platform/platformVideo.cc, change the setScreenMode method to read as such:
I have not checked, however this issue concernes me that there could be numerous duplicated video commands.
In platform/platformVideo.cc, change the setScreenMode method to read as such:
//------------------------------------------------------------------------------
bool Video::setScreenMode( U32 width, U32 height, U32 bpp, bool fullScreen )
{
#if !(defined(TORQUE_OS_IPHONE))
if ( smCurrentDevice )
{
//MIN_RESOLUTION defined in platformWin32/platformGL.h
if(width == 0)
width = MIN_RESOLUTION_Y;
if(height == 0)
height = MIN_RESOLUTION_X;
if(bpp == 0)
bpp = MIN_RESOLUTION_BIT_DEPTH;
smCritical = true;
bool result = smCurrentDevice->setScreenMode( width, height, bpp, fullScreen );
smCritical = false;
return( result );
}
#endif
return( false );
}I have not checked, however this issue concernes me that there could be numerous duplicated video commands.
About the author
Recent Threads
#2
02/01/2010 (8:41 pm)
Oh, totally agreed. This is only one place I've found so far. I've been doing a massive engine-wide iPad update to expose maximum compatibility and I've been finding numerous places that need to be updated to handle even the iPhone properly. I had considered posting more of the changes, but then I realized I could just do an iPad update post in total with everything all in one, but this one seemed to be big enough to post on its own.
#3
But yes I think such a thread wouldn't be bad, perhaps even bring more people onto the plan, ripping T2Di apart to find more or less all the direct problem areas (the indirect ones are clear: its TGE based not T3D, as such we can't add a OpenGL ES 2.0 renderer just like that)
02/01/2010 (8:50 pm)
the worst thing I found is the define binding for the resolution without even a basic interest in asking the iphone os about the resolution.But yes I think such a thread wouldn't be bad, perhaps even bring more people onto the plan, ripping T2Di apart to find more or less all the direct problem areas (the indirect ones are clear: its TGE based not T3D, as such we can't add a OpenGL ES 2.0 renderer just like that)
#4
02/01/2010 (9:47 pm)
Actually, in terms of resolutions, I don't think we need to ask the device what the resolution is. We know that the iPhone will always be 320x480, and we always know the iPad will be 768x1024. All we need to know is the device (and orientation / intended orientation of application).
#5
hardcoding, especially when done through defines, can only lead to problems out of my sight
02/01/2010 (9:57 pm)
we know that they are like that right now. but I take it for granted that the 4th generation iphone / itouch will not be 480x320 but 800x480 or alike!hardcoding, especially when done through defines, can only lead to problems out of my sight
#6
That being said...
You're right, lol.
02/01/2010 (10:06 pm)
Personally, I have a hard time seeing Apple changing up the resolution on the iPhone as it would render all previous apps with compatibility problems, and the last thing Apple wants to do is mess with their app catalog. They were able to do that with the iPad because it's a totally different device.That being said...
You're right, lol.
#7
But they have to start to ramp up the resolution as they are just too small for current generations. Also the major restriction, the gpu power, has been brought to the point where they could ramp it up without any performance hit between the previous and the current generation.
Just because the nexus one is the same shit as all androids before (1Ghz cpu but still OpenGL ES 1.0? What drugs do they get at the google design team?), that does not mean that all Arm9 android phones will be shit.
Also there is Palm with a kind of more appealing store than the Android store where I definitely never would want to enter as commercial dev even in its current state.
The ipad is a totally different device with other targets, thats true.
But even existing devices that evolve have to evolve towards current standards somewhen.
Apple avoided the 800x480 move since the very first generation and I don't think they can justify it for another year.
02/01/2010 (10:18 pm)
From that point of view you are right.But they have to start to ramp up the resolution as they are just too small for current generations. Also the major restriction, the gpu power, has been brought to the point where they could ramp it up without any performance hit between the previous and the current generation.
Just because the nexus one is the same shit as all androids before (1Ghz cpu but still OpenGL ES 1.0? What drugs do they get at the google design team?), that does not mean that all Arm9 android phones will be shit.
Also there is Palm with a kind of more appealing store than the Android store where I definitely never would want to enter as commercial dev even in its current state.
The ipad is a totally different device with other targets, thats true.
But even existing devices that evolve have to evolve towards current standards somewhen.
Apple avoided the 800x480 move since the very first generation and I don't think they can justify it for another year.
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
this seems to be related to the "lazy path solution" to handle portrait and vertical by missusing a 480x480 resolution to then kick it down to the really intend one and things alike