Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在GvrView Android surface上启用sRGB帧缓冲区?_Android_Opengl Es_Android Ndk_Google Cardboard_Google Vr - Fatal编程技术网

如何在GvrView Android surface上启用sRGB帧缓冲区?

如何在GvrView Android surface上启用sRGB帧缓冲区?,android,opengl-es,android-ndk,google-cardboard,google-vr,Android,Opengl Es,Android Ndk,Google Cardboard,Google Vr,有人知道在Google VR SDK的GvrView上启用sRGB的方法吗 对于经典的GLSurfaceView,我使用了setEGLWindowSurfaceFactory,它工作得很好-见下文 据我所知,该表面工厂未被GvrView曝光,是否有任何解决方法或替代方法?通过NDK api 我在官方文件中找不到任何东西 view.setEGLWindowSurfaceFactory(mWindow_sRGB_SurfaceFactory); private final EGLWindowSur

有人知道在Google VR SDK的
GvrView
上启用sRGB的方法吗

对于经典的
GLSurfaceView
,我使用了
setEGLWindowSurfaceFactory
,它工作得很好-见下文

据我所知,该表面工厂未被
GvrView
曝光,是否有任何解决方法或替代方法?通过NDK api

我在官方文件中找不到任何东西

view.setEGLWindowSurfaceFactory(mWindow_sRGB_SurfaceFactory);

private final EGLWindowSurfaceFactory mWindow_sRGB_SurfaceFactory = new EGLWindowSurfaceFactory() {

        public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                              EGLConfig config, Object nativeWindow) {
            EGLSurface result = null;
            final int EGL_GL_COLORSPACE_KHR = 0x309D;
            final int EGL_GL_COLORSPACE_SRGB_KHR = 0x3089;
            final int[] surfaceAttribs = {
                    EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR,
                    EGL10.EGL_NONE
            };

            result = egl.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs);
            ...
        }