2014-08-28 2 views
-1

GLSurfaceView를 테스트하기위한 간단한 코드를 작성합니다.GLSurfaceView가 작동하지 않습니다.

package com.jeobin.test; 

import android.app.Activity; 
import android.os.Bundle; 
import android.opengl.GLSurfaceView; 

public class MainActivity extends Activity { 
    GLSurfaceView view; 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     view = new GLSurfaceView(this); 
     setContentView(view); 
    } 
} 

코드에서 setContentView (view)를 추가 할 때 분해됩니다. 여기에 내 명단이있다.

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.jeobin.test" 
    android:versionCode="1" 
    android:versionName="1.0" > 
    <uses-feature android:glEsVersion="0x00020000" android:required="true" /> 
    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="19" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

일식에 문제가 있습니까?

답변

0

"나누기"란 무엇을 의미합니까? 그것은 전혀 실행됩니까? OpenGL ES를 사용하려면 렌더러 클래스를 작성하고 setRenderer()를 사용하여 GLSurfaceView로 설정해야합니다. 이것 좀 봐 : http://www.learnopengles.com/android-lesson-one-getting-started/

+0

내 노트 3 에서이 응용 프로그램을 열 때 "불행히도, 테스트 stoped"보여줍니다. 여기, 나는 GLSurface가 작동하는지 여부를 테스트하기위한 테스트 코드를 작성한다. 내 다른 코드에서는 renderer.class를 작성합니다. –

+0

문제는 setContentView를 호출하기 전에 렌더러를 GLSurfaceView 클래스로 설정해야한다는 것입니다. – Tristram