Пример #1
0
        /// <summary>
        /// Loads all the available bindings for the current context.
        /// </summary>
        /// <param name="context">The context used to query the available bindings.</param>
        /// <remarks>
        /// Loads all available entry points for the current OpenGL context.
        /// </remarks>
        public static void LoadBindings(IBindingsContext context)
        {
            Debug.Print("Loading entry points for {0}", typeof(Wgl).FullName);
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            for (int i = 0; i < EntryPoints.Length; i++)
            {
                EntryPoints[i] = context.GetProcAddress(EntryPointNames[i]);
            }
        }
 public NativeBindingsContext()
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         _context = new WglBindingsContext();
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
     {
         _context = new GlxBindingsContext();
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Пример #3
0
 private void InitGLContext()
 {
     // Initialize the OpenTK 3 GL context with GLFW.
     _graphicsContext = new GLFWBindingsContext();
     GL.LoadBindings(_graphicsContext);
 }
Пример #4
0
 public OpenToolkitBindingsContext(IBindingsContext bindingsContext)
 {
     _bindingContext = bindingsContext;
 }
Пример #5
0
 public void LoadBindings(IBindingsContext context)
 {
     _rendererImplementation.LoadBindings(context);
 }
Пример #6
0
 public void LoadBindings(IBindingsContext context)
 {
     GL.LoadBindings(context);
     GL.Enable(EnableCap.DepthTest);
     //GL.Enable(EnableCap.CullFace);
 }
Пример #7
0
 public GLContextBase(Clyde clyde)
 {
     Clyde           = clyde;
     BindingsContext = new BindingsContextImpl(this);
 }
Пример #8
0
 private void InitGLContext()
 {
     _graphicsContext = new GLFWBindingsContext();
     GL.LoadBindings(_graphicsContext);
 }