1

Orthogonal Projection で OpenGLES 1.0 2D ゲームを作成しようとしています。私の Nexus 7 タブレットでは 1280x720 で動作するはずです。添付の写真に見られるように、ビューポートを 557x320 にダウンスケールする画面互換モードのようです。

http://i.stack.imgur.com/00Lw1.png

スプライトが途切れ途切れに見え、私はそれを修正するために何時間も試みました. 私のコードは次のとおりです。

@Override
public void onSurfaceChanged(GL10 gl, int width, int height)
{
    gl.glViewport(0, 0, (int)width, (int)height);

    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();

    gl.glOrthof(0.0f, (float)game_width, (float)game_height, 0.0f, 1.0f, -1.0f);

    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();

    gl10 = gl;
}

@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config)
{        
    gl.glEnable(GL10.GL_TEXTURE_2D);
    gl.glEnable(GL10.GL_ALPHA_TEST);
    gl.glAlphaFunc(GL10.GL_GREATER, 0.5f);
    gl.glEnable(GL10.GL_BLEND);
    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
    gl.glDisable(GL10.GL_DEPTH_TEST);

    gl10 = gl;

    scene = new SCN_scn_title();
    scene.mgp = this;

}

私のマニフェストは次のとおりです。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.website.packagenamehere" android:versionCode="1" android:versionName="1.0">
    <application android:label="Block Party" android:icon="@drawable/ic_launcher" allowBackup="true" hardwareAccelerated="true" theme="@android:style/Theme.NoTitleBar.Fullscreen">
        <activity android:name="MainActivity" android:label="Block Party">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission name="android.permission.VIBRATE" />
    <supports-screens xlargeScreens="true" largeScreens="true" normalScreens="true" smallScreens="true" anyDensity="true" resizeable="false" />
    <uses-sdk minSdkVersion="10" targetSdkVersion="15" />
</manifest>

この問題を解決できないようです。私の質問は、これをどのように修正すればよいですか?

4

1 に答える 1