private int findConfigAttrib(IEGL10 egl, EGLDisplay display, EGLConfig config, int attribute, int defaultValue)
 {
     if (egl.EglGetConfigAttrib(display, config, attribute, mValue))
     {
         return(mValue[0]);
     }
     return(defaultValue);
 }
 int GetAttrib(IEGL10 egl, EGLDisplay display, EGLConfig config, int attrib)
 {
     int[] ret = new int [1];
     try {
         egl.EglGetConfigAttrib(display, config, attrib, ret);
     } catch (Exception e) {
         Log.Warn("AndroidGraphicsMode", "EglGetConfigAttrib {0} threw exception {1}", attrib, e);
     }
     return(ret[0]);
 }
예제 #3
0
		int GetAttrib (IEGL10 egl, EGLDisplay display, EGLConfig config, int attrib)
		{
			int[] ret = new int [1];
			try {
				egl.EglGetConfigAttrib (display, config, attrib, ret);
			} catch (Exception e) {
				Log.Warn ("AndroidGraphicsMode", "EglGetConfigAttrib {0} threw exception {1}", attrib, e);
			}
			return ret[0];
		}
예제 #4
0
 static int GetAttribute(EGLConfig config, IEGL10 egl, EGLDisplay eglDisplay, int attribute)
 {
     int[] data = new int[1];
     egl.EglGetConfigAttrib(eglDisplay, config, EGL11.EglRedSize, data);
     return(data[0]);
 }
예제 #5
0
        private UserReadableEglConfig EglConfigToUserReadableEglConfig(EGLConfig eglConfig)
        {
            var surfaceType    = new int[1];
            var renderableType = new int[1];
            var redSize        = new int[1];
            var greenSize      = new int[1];
            var blueSize       = new int[1];
            var alphaSize      = new int[1];
            var depthSize      = new int[1];
            var stencilSize    = new int[1];
            var samples        = new int[1];

            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglSurfaceType, surfaceType))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglRenderableType, renderableType))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglRedSize, redSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglGreenSize, greenSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglBlueSize, blueSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglAlphaSize, alphaSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglDepthSize, depthSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglStencilSize, stencilSize))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }
            if (!egl.EglGetConfigAttrib(EGLDisplay, eglConfig, EGL10.EglSamples, samples))
            {
                throw new InvalidOperationException(string.Format("EglGetConfigAttrib {0:x}", egl.EglGetError()));
            }

            return(new UserReadableEglConfig
            {
                SurfaceType = surfaceType[0],
                RenderableType = renderableType[0],
                RedSize = redSize[0],
                GreenSize = greenSize[0],
                BlueSize = blueSize[0],
                AlphaSize = alphaSize[0],
                DepthSize = depthSize[0],
                StencilSize = stencilSize[0],
                Samples = samples[0]
            });
        }