Opentk/Source/Bind/ES/ESGenerator.cs

42 lines
1.7 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.XPath;
using Bind.GL2;
using Bind.Structures;
using Delegate=Bind.Structures.Delegate;
using Enum=Bind.Structures.Enum;
namespace Bind.ES
{
// Generator implementation for OpenGL ES 1.0 and 1.1
class ESGenerator : Generator
{
public ESGenerator(Settings settings, string dirName)
: base(settings, dirName)
{
Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../ES11");
Settings.DefaultOutputNamespace = "OpenTK.Graphics.ES11";
Settings.DefaultImportsFile = "ES11Core.cs";
Settings.DefaultDelegatesFile = "ES11Delegates.cs";
Settings.DefaultEnumsFile = "ES11Enums.cs";
Settings.DefaultWrappersFile = "ES11.cs";
Settings.DefaultDocPath = Path.Combine(
Settings.DefaultDocPath, "ES20"); // no ES11 docbook sources available
// Khronos releases a combined 1.0+1.1 specification,
// so we cannot distinguish between the two.
// Todo: add support for common and light profiles.
Profile = "gles1";
// no explicit version means both 1.0 and 1.1 versions
// For compatibility with OpenTK 1.0 and Xamarin, generate
// overloads using the "All" enum in addition to strongly-typed enums.
// This can be disabled by passing "-o:-keep_untyped_enums" as a cmdline parameter.
Settings.DefaultCompatibility |= Settings.Legacy.KeepUntypedEnums;
[ES] Fixed loading of OpenGL ES core API eglGetProcAddress cannot be used to retrieve entry points of core functions. Instead, we use [DllImport] for core functions and function pointers for extension functions. Squashed commit of the following: commit 0b84aa6ef78dfa3600b81fc412eb192f2a87e40c Author: thefiddler <stapostol@gmail.com> Date: Sat Mar 15 02:24:58 2014 +0100 [Examples] Rolled back changes to Example browser commit 1acfbaac3d17184debdbbe872c58ac07d1b37c0a Author: thefiddler <stapostol@gmail.com> Date: Sat Mar 15 02:20:57 2014 +0100 [Examples] Rolled back WinForms example commit 835d9d6035a890bd3426566929fbfd25c493eca0 Author: thefiddler <stapostol@gmail.com> Date: Sat Mar 15 01:15:01 2014 +0100 [Examples] Rolled back erroneous GLControl mods commit 056418014f0e835e83fb85b54b8749519a555364 Author: thefiddler <stapostol@gmail.com> Date: Fri Mar 14 23:11:11 2014 +0100 [Rewrite] Remove calli prototypes When a function is called indirectly via a function pointer, its prototype is not required (the prototype is added as a callsite at the calli invocation.) Removing these prototypes reduces binary size by roughly 400KB. commit 353a16ec2836c597150d2fab28581e7c264b2b39 Author: thefiddler <stapostol@gmail.com> Date: Fri Mar 14 22:31:25 2014 +0100 [Rewrite] Call DllImports directly When a function does not have an allocated slot (i.e. slot = -1), then we will call its DllImport signature directly. commit 9a5313e4b7afb10b698d255e4b5637887bf71cf3 Author: thefiddler <stapostol@gmail.com> Date: Fri Mar 14 22:30:04 2014 +0100 [Bind] Do not allocate slots for DllImports commit 6ac5342409363cac0e59f9dc669948b319bd20a9 Author: thefiddler <stapostol@gmail.com> Date: Fri Mar 14 22:29:07 2014 +0100 [Bind] Added option to use DllImports This is necessary for the core functionality of OpenGL ES, where eglGetProcAddress returns null or garbage (the latter on Android.)
2014-03-16 18:40:49 +00:00
Settings.DefaultCompatibility |= Settings.Legacy.UseDllImports;
}
}
}