Permalink
Browse files

Merge branch 'gl_Mar2014' into develop

  • Loading branch information...
2 parents 51c173e + b3fac68 commit d12bd18158ff0198b2091711d2f3d42deb69bedc @thefiddler thefiddler committed Mar 13, 2014
@@ -35,18 +35,18 @@
namespace Bind
{
- class BindStreamWriter : StreamWriter
+ class BindStreamWriter : IDisposable
{
- int indent_level = 0;
- Regex splitLines = new Regex(Environment.NewLine, RegexOptions.Compiled);
- //Regex splitLines = new Regex("(\r\n|\n\r|\n|\r)", RegexOptions.Compiled);
-
+ static readonly char[] SplitCharacters = new char[] { '\r', '\n' };
+ readonly StreamWriter sw;
public readonly string File;
+ int indent_level = 0;
+
public BindStreamWriter(string file)
- : base(file)
{
File = file;
+ sw = new StreamWriter(file);
}
public void Indent()
@@ -60,9 +60,10 @@ public void Unindent()
--indent_level;
}
- public override void Write(string value)
+ public void Write(string value)
{
- var lines = splitLines.Split(value);
+ var lines = value.Split(SplitCharacters,
+ StringSplitOptions.RemoveEmptyEntries);
bool is_multiline = lines.Length > 1;
if (is_multiline)
{
@@ -71,39 +72,60 @@ public override void Write(string value)
{
var line = lines[i];
WriteIndentations();
- base.Write(line);
- base.Write(System.Environment.NewLine);
+ sw.Write(line);
+ sw.Write(System.Environment.NewLine);
}
// Write the last line without appending a newline
WriteIndentations();
- base.Write(lines[lines.Length - 1]);
+ sw.Write(lines[lines.Length - 1]);
}
else
{
WriteIndentations();
- base.Write(value);
+ sw.Write(value);
}
}
- public override void WriteLine(string value)
+ public void Write(string format, params object[] args)
{
- // The Mono implementation of WriteLine calls Write internally.
- // The .Net implementation does not.
- // If running on Mono, we must avoid indenting in WriteLine
- // because then we'll indent twice (once in WriteLine and once in Write).
- // If running on .Net we must indent in both WriteLine and Write.
- // Neat, no?
- if (System.Type.GetType("Mono.Runtime") == null)
- {
- WriteIndentations();
- }
- base.WriteLine(value);
+ Write(String.Format(format, args));
+ }
+
+ public void WriteLine()
+ {
+ sw.WriteLine();
+ }
+
+ public void WriteLine(string value)
+ {
+ Write(value);
+ WriteLine();
+ }
+
+ public void WriteLine(string format, params object[] args)
+ {
+ WriteLine(String.Format(format, args));
+ }
+
+ public void Flush()
+ {
+ sw.Flush();
+ }
+
+ public void Close()
+ {
+ sw.Close();
}
void WriteIndentations()
{
for (int i = indent_level; i > 0; i--)
- base.Write(" ");
+ sw.Write(" ");
+ }
+
+ public void Dispose()
+ {
+ sw.Dispose();
}
}
}
@@ -1644,6 +1644,34 @@
</replace>
+ <overload name="glcore">
+ <function name="GetObjectLabel" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetObjectPtrLabel" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetProgramResourceiv" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetProgramResourceName" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetObjectPtrLabel" extension="KHR" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ </overload>
+
<overload name="gl">
<!-- generated from apitest -->
<function name="TessellationMode" extension="Amd" obsolete="Use AmdVertexShaderTessellator overload instead">
@@ -1781,11 +1809,46 @@
<type>BeginMode</type>
</param>
</function>
+ <function name="EdgeFlagv" extension="Core" obsolete="Use ref overload instead">
+ <param name="flag">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetObjectLabel" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetObjectPtrLabel" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetPointerv" extension="Core" obsolete="Use out overload instead">
+ <param name="params">
+ <count>0</count>
+ </param>
+ </function>
<function name="GetProgram" extension="Core" obsolete="Use GetProgramParameterName overload instead">
<param name="pname" index="1">
<type>ProgramParameter</type>
</param>
</function>
+ <function name="GetProgramPipelineInfoLog" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetProgramResourceiv" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetProgramResourceName" extension="Core" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
<function name="GetString" extension="Core" obsolete="Use StringNameIndexed overload instead">
<param name="name" index="0">
<type>StringName</type>
@@ -1886,6 +1949,21 @@
<type>ExtDirectStateAccess</type>
</param>
</function>
+ <function name="GetObjectLabel" extension="Ext" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetPointerv" extension="Ext" obsolete="Use out overload instead">
+ <param name="params">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetProgramPipelineInfoLog" extension="Ext" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
<function name="IsEnabledIndexed" extension="Ext" obsolete="Use IndexedEnableCap overload instead">
<param name="target" index="0">
<type>ExtDrawBuffers2</type>
@@ -1936,6 +2014,16 @@
<type>IbmVertexArrayLists</type>
</param>
</function>
+ <function name="GetObjectPtrLabel" extension="KHR" obsolete="Use out overload instead">
+ <param name="length">
+ <count>0</count>
+ </param>
+ </function>
+ <function name="GetPointerv" extension="KHR" obsolete="Use out overload instead">
+ <param name="params">
+ <count>0</count>
+ </param>
+ </function>
<function name="DrawTransformFeedback" extension="NV" obsolete="Use PrimitiveType overload instead">
<param name="mode" index="0">
<type>NvTransformFeedback2</type>
@@ -4797,6 +4885,21 @@
<function name="DrawElements" obsolete="Use PrimitiveType overload instead">
<param name="mode"><type>BeginMode</type></param>
</function>
+ <function name="ExtGetBuffersQCOM" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numBuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetFramebuffersQCOM" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numFramebuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetProgramsQCOM" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numPrograms"><count>0</count></param>
+ </function>
+ <function name="ExtGetRenderbuffersQCOM" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numRenderbuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetShadersQCOM" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numShaders"><count>0</count></param>
+ </function>
</overload>
<replace name="gles1">
@@ -5179,7 +5282,7 @@
<token name="TEXTURE9" value="0x84C9" />
</enum>
</add>
-
+
<!-- gles2 replacements for 2.0 and 3.0 -->
<replace name="gles2" version="2.0|3.0">
<!-- Buffer Objects [2.9] -->
@@ -5667,7 +5770,42 @@
</function>
</replace>
- <!-- gles2 overloads for 2.0 backwards compatibility-->
+ <!-- gles2 overloads for backwards compatibility (2.0 and 3.0) -->
+ <overload name="gles2">
+ <function name="GetObjectLabel" obsolete="Use out overload instead">
+ <param name="length"><count>0</count></param>
+ </function>
+ <function name="GetObjectPtrLabel" obsolete="Use out overload instead">
+ <param name="length"><count>0</count></param>
+ </function>
+ <function name="GetTranslatedShaderSource" extension="ANGLE" obsolete="Use out overload instead">
+ <param name="length"><count>0</count></param>
+ </function>
+ <function name="GetProgramPipelineInfoLog" extension="EXT" obsolete="Use out overload instead">
+ <param name="length"><count>0</count></param>
+ </function>
+ <function name="GetProgramBinary" extension="OES" obsolete="Use out overload instead">
+ <param name="length"><count>0</count></param>
+ <param name="binaryFormat"><count>0</count></param>
+ </function>
+ <function name="ExtGetBuffers" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numBuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetFramebuffers" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numFramebuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetPrograms" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numPrograms"><count>0</count></param>
+ </function>
+ <function name="ExtGetRenderbuffers" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numRenderbuffers"><count>0</count></param>
+ </function>
+ <function name="ExtGetShaders" extension="QCOM" obsolete="Use out overload instead">
+ <param name="numShaders"><count>0</count></param>
+ </function>
+ </overload>
+
+ <!-- gles2 overloads for backwards compatibility (2.0 only) -->
<overload name="gles2" version="2.0">
<!-- PrimtiveType <=> BeginMode overloads for backwards compatibility -->
<function name="DrawArrays" obsolete="Use PrimitiveType overload instead">
@@ -6555,7 +6693,7 @@
</enum>
</add>
-
+
<!-- gles2 3.0 enums -->
<add name="gles2" version="3.0">
<enum name="ActiveAttribType">
Oops, something went wrong.

0 comments on commit d12bd18

Please sign in to comment.