Esempio n. 1
0
        public static IntPtr GetProcAddress(Func <string, IntPtr> getProcAddress, GlInterface.GlContextInfo context,
                                            string entry, string extension, GlProfileType?profile = null)
        {
            // Ignore different profile type
            if (profile.HasValue && profile != context.Version.Type)
            {
                return(IntPtr.Zero);
            }

            // Check if extension is supported by the current context
            if (!context.Extensions.Contains(extension))
            {
                return(IntPtr.Zero);
            }

            return(getProcAddress(entry));
        }
Esempio n. 2
0
 public static IntPtr GetProcAddress(Func <string, IntPtr> getProcAddress, GlInterface.GlContextInfo context,
                                     string entry, int minVersionMajor, int minVersionMinor, GlProfileType?profile = null)
 {
     if (profile.HasValue && context.Version.Type != profile)
     {
         return(IntPtr.Zero);
     }
     if (context.Version.Major < minVersionMajor)
     {
         return(IntPtr.Zero);
     }
     if (context.Version.Major == minVersionMajor && context.Version.Minor < minVersionMinor)
     {
         return(IntPtr.Zero);
     }
     return(getProcAddress(entry));
 }