Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="test_viewport" FullScreen="255" ScreenMode="0" MouseVisible="255" FileVersion="2" AndroidPackageName="com.txori.test_viewport" AndroidPortrait="1">
<OnLoaded>
<ZExternalLibrary ModuleName="opengl32">
<BeforeInitExp>
<![CDATA[//
if(ANDROID)
{
this.ModuleName = "libGLESv1_CM.so";
}
else if(LINUX)
{
this.ModuleName = "libGL.so";
}
else
{
this.ModuleName = "opengl32";
}]]>
</BeforeInitExp>
<Source>
<![CDATA[//
const int GL_VIEWPORT = 0x0BA2;
void glGetIntegerv(int pname, xptr params){}]]>
</Source>
</ZExternalLibrary>
<ZExpression>
<Expression>
<![CDATA[//
glGetIntegerv(0x0BA2, Viewport);
trace(intToStr(Viewport[0]));
trace(intToStr(Viewport[1]));
trace(intToStr(Viewport[2]));
trace(intToStr(Viewport[3]));]]>
</Expression>
</ZExpression>
</OnLoaded>
<OnRender>
<UseMaterial Material="DigitsMaterial"/>
<RenderText Scale="0.5">
<TextExpression>
<![CDATA[//
intToStr(Viewport[2])+" "+intToStr(Viewport[3]);]]>
</TextExpression>
</RenderText>
</OnRender>
<Content>
<Array Name="Viewport" Type="1" SizeDim1="4"/>
<Bitmap Name="DigitsBitmap" Width="128" Height="16">
<Producers>
<BitmapFromFile Comment="Imported from Digits.bmp" Transparency="1" DataWidth="128" DataHeight="16">
<BitmapFile>
<![CDATA[789CED583BAE22410CECE372088EC009B800393931292921211921195B9AD2962CFFBA9176A5173C0768F0B8FD29DBDDEE19E3977E045D2E97D7EBF5F97CF08BE75E18628FC723322B92CCF97CC642F19FCFE7F57A9DFAC6259613F58093AE3D1E8F92AC42A3C06EB7AB1CC0ABDBED467CA8077F9DFCFBFDD6DBFBFD7E381CA67189A00D0BB10AEED1193C37F229FE00414A1CD985C49C7C088303CFF7FB7D632EE24F3DD24FD3F8750B6148B02BB42806ACC00708A975BE85931068DC56507860A62A85A97E0B38F537194CF11F5B0A7A30638D9D4EA769BA23FE510FEA1F3236D78CCBA11DC5AC89B405985C1714FE562058432BDDCDE2B7FAA9BC495F639A2900AA53BB2276AEFEC6F66139B9564ABD82A48B2B420A73568CD4B440156CAC0A4711D894523D699F4E5D22B160D6534078ADF295A3641AC86BA3A998E52335A97B293FCDA32596F1B405B89545E54DB03DFEE39B14C4FD070EC3BAADDB69A5C92B97C7141F976E115B20B6183D74ADC12DDA06C8339AB8F1B0180B4055327DC82B6A99028C1FF1953B37A32A4064992BF8439B4389E97078C6C3CE52D50288E2BD11DDE6B3051FA54EE4750A4315A39B7AFE9FF01F7F3B37EEC0DA4CF0366D4FA2A491323AC321C4E5D1553B4DE015966B32E9C7ADAA05C656DE9A3FE370924E2C2C8915FCFFF9FE43EAE7BAB1B536731401B1BB503A7FB208057235D28CED1CB4DB4233E78FA20558DEAC7FF442F4F9DBBDCE128BC7317B8417F11F5B1ED38E16018D4A9B76A1883FABBA37CD6AFFEA1E348A16A003023CFADC84D09FD1E39BF9135E71D35BC73F4DEEA20CA180C5883F38D3B818457FB348298216E38DB3562C33A6697A0B5BBF7F31539C0722FE88D76DE644C0CEB1E0B8A188321598DC8552FC572622B6C0F4738A230668FD8C5DEC38DCEADD3710D6D54A031270FBFDA1CA1AAF7529FEF441F77442E74620661068734E904C33A9EAD4B34C015B7DE88816F5F5C01649D4407225218EBB0F5A439AE5ACCCCAFD572608C5F4FB5B55FF636B251D764C68CCBEF613C9A433AAD519F1D768E1A8D2002BCAA3ADDB5449AA0D4E6A9EC4435A30829DF8F471FDD24FA03FFC4DB206]]>
</BitmapFile>
</BitmapFromFile>
</Producers>
</Bitmap>
<Font Name="DigitsFont" Bitmap="DigitsBitmap" FirstChar="48" CharPixelWidth="12" CharPixelHeight="16"/>
<Material Name="DigitsMaterial" Light="0" Blend="2" Font="DigitsFont"/>
</Content>
</ZApplication>
But the result on Android is 0 0. Landscape and Portrait.
And on Linux, 800 600.
Other App.ScreenMode are working on Linux.