2016-10-23 8 views
0

으로 컴파일하려고하면 Qt 5.6의 "Cube OpenGL ES 2.0 예제"의 표준 예제 인 25.2.2인데, Win/Linux에서는 좋지만 Android 7.0 - API 24에서는 검은 색 화면이 좋습니다.QOpenGLWidget을 Android에서 어떻게 사용할 수 있습니까?

같은 문제는 내가 MainWindow를에 QOpenGLWidget의 객체를 넣을 때 발생 - 두 경우 모두에서 API를 24

응용 프로그램 출력을 - 안드로이드 7.0에서 검은 화면 : 나는 안드로이드로 다운 그레이드 할 때

W libQtGUI.so: (null):0 ((null)): QOpenGLShader::compile(Vertex): ERROR: Valid GLSL but not GLSL ES 
W libQtGUI.so: (null):0 ((null)): *** Problematic Vertex shader source code *** 
W libQtGUI.so: (null):0 ((null)): #define lowp 
W libQtGUI.so: #define mediump 
W libQtGUI.so: #define highp 
W libQtGUI.so: #line 1 
W libQtGUI.so: attribute highp vec3 vertexCoord;attribute highp vec2 textureCoord;varying highp vec2 uv;uniform highp mat4 vertexTransform;uniform highp mat3 textureTransform;void main() { uv = (textureTransform * vec3(textureCoord,1.0)).xy; gl_Position = vertexTransform * vec4(vertexCoord,1.0);} 
W libQtGUI.so: (null):0 ((null)): *** 
W libQtGUI.so: (null):0 ((null)): QOpenGLShader::compile(Fragment): ERROR: Valid GLSL but not GLSL ES 
W libQtGUI.so: (null):0 ((null)): *** Problematic Fragment shader source code *** 

을하지만, SDK 도구 25.1.7에서 https://dl.google.com/android/repository/tools_r25.1.7-windows.zip QOpenGLWidget는 MainWindow에서만 Android에서 잘 작동하지만 QOpenGLWidget이 포함되어 있으면 다른 QDialog를 표시하지 않습니다.

QOpenGLWidget을 Android에서 사용할 수 있습니까?

답변

3

데스크톱 GL을 사용하기 위해 컴파일 된 코드와 비슷한 오류가 발생합니다. GLWidget 코드는 모르지만 Qt 빌드 시스템에는 라이브러리를 빌드하는 동안 OpenGL 버전/flavor select가 있습니다. 오류는 Qt가 데스크톱 OpenGL로 빌드되었지만 Android는 OpenGL ES 만 제공하는 것처럼 들립니다. 데스크탑 측에서 실제로 사용되는 OpenGL flavor를 확인할 수 있습니다. OpenGL의 두 가지 기능 모두에 대한 라이브러리를 제공하기 때문에 linux/windows에서만 작동합니다.