Не удается разрешить символ - PullRequest
0 голосов
/ 06 июня 2019

Я делаю создание среды OpenGL из студии android, но я столкнулся с тем, что это не может разрешить символ. Я не уверен почему. У меня изначально была эта проблема на gLView, но я смог решить эту проблему с импортом android.opengl.GLSurfaceView, но, насколько я понимаю, MyGLSurfaceView - это новый класс? но он вызывается с GLSurfaceView через gLView? Я немного запутался, почему это происходит и что я сделал не так.

package com.example.opengltest;

import android.app..Activity;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;



import android.os.Bundle;

public class MainActivity extends Activity {
 private GLSurfaceView gLView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //Create a GLSurfaceView instance and set it
    // as  the Content View for this Activity
    gLView = new MyGLSurfaceView(this);
    setContentView(gLView);
}

XML-код

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.opengltest">
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<supports-gl-texture android:name="GL_OES_compressed_paletted_texture" />


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

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

1 Ответ

0 голосов
/ 06 июня 2019

Попробуйте, дайте мне знать, что происходит.

gLView = findViewById(R.id.myview); //Try with this line ,initialize (myview is example id) 

    gLView = new MyGLSurfaceView(this);
    setContentView(gLView);

XML добавьте эту строку в файл макета

android:id="@+id/myview"
...