示例#1
0
文件: egl.cs 项目: koush/Xaml
 public static extern bool QueryContext(EGLDisplay dpy, EGLContext ctx, int attribute, out int value);
示例#2
0
文件: egl.cs 项目: koush/Xaml
 public static extern bool MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
示例#3
0
文件: egl.cs 项目: koush/Xaml
 public static extern bool DestroyContext(EGLDisplay dpy, EGLContext ctx);
示例#4
0
文件: egl.cs 项目: koush/Xaml
 public static EGLContext CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list)
 {
     IntPtr ptr = eglCreateContext(dpy, config, share_context, attrib_list);
     EGLContext ret = new EGLContext();
     ret.Pointer = ptr;
     return ret;
 }
示例#5
0
文件: egl.cs 项目: koush/Xaml
 static extern IntPtr eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list);
示例#6
0
文件: Application.cs 项目: koush/Xaml
        void InitializeOpenGL()
        {
            ourDisplay = egl.GetDisplay(new EGLNativeDisplayType(IntPtr.Zero));

            int major, minor;
            bool ret = egl.Initialize(ourDisplay, out major, out minor);

            EGLConfig[] configs = new EGLConfig[10];
            int[] attribList = new int[]
            {
                egl.EGL_RED_SIZE, 5,
                egl.EGL_GREEN_SIZE, 6,
                egl.EGL_BLUE_SIZE, 5,
                egl.EGL_DEPTH_SIZE, 16 ,
                egl.EGL_SURFACE_TYPE, egl.EGL_WINDOW_BIT,
                egl.EGL_STENCIL_SIZE, egl.EGL_DONT_CARE,
                egl.EGL_NONE, egl.EGL_NONE
            };

            int numConfig;
            if (!egl.ChooseConfig(ourDisplay, attribList, configs, configs.Length, out numConfig) || numConfig < 1)
                throw new InvalidOperationException("Unable to choose config.");

            ourConfig = configs[0];
            ourContext = egl.CreateContext(ourDisplay, ourConfig, EGLContext.None, null);
        }