
[ES 2.0] Cleanup #1
Posted Sunday, 12 July, 2009 - 13:46 by Inertia| Project: | The Open Toolkit library |
| Version: | 1.0-beta-1 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
enum BlendMode
{
Funcadd = ((int)0X8006),
Funcsubtract = ((int)0X800a),
Funcreversesubtract = ((int)0X800b),
}
SVN: void BlendEquation( OpenTK.Graphics.GLES20.All mode)
New: void BlendEquation( BlendMode mode)
SVN: void BlendEquationSeparate( OpenTK.Graphics.GLES20.All modeRGB, OpenTK.Graphics.GLES20.All modeAlpha)
New: void BlendEquationSeparate( BlendMode modeRGB, BlendMode modeAlpha)
-------------------------------
enum BlendFactor
{
Zero = ((int)0),
One = ((int)1),
Srccolor = ((int)0X0300),
Oneminussrccolor = ((int)0X0301),
Dstcolor = ((int)0X0306),
Oneminusdstcolor = ((int)0X0307),
Srcalpha = ((int)0X0302),
Oneminussrcalpha = ((int)0X0303),
Dstalpha = ((int)0X0304),
Oneminusdstalpha = ((int)0X0305),
Constantcolor = ((int)0X8001),
Oneminusconstantcolor = ((int)0X8002),
Constantalpha = ((int)0X8003),
Oneminusconstantalpha = ((int)0X8004),
Srcalphasaturate = ((int)0X0308), // only valid for source RGB/Alpha, do 2nd enum?
}
SVN: void BlendFunc( OpenTK.Graphics.GLES20.All sfactor, OpenTK.Graphics.GLES20.All dfactor)
New: void BlendFunc( BlendFactor sfactor, BlendFactor dfactor)
SVN: void BlendFuncSeparate( OpenTK.Graphics.GLES20.All srcRGB, OpenTK.Graphics.GLES20.All dstRGB, OpenTK.Graphics.GLES20.All srcAlpha, OpenTK.Graphics.GLES20.All dstAlpha)
New: void BlendFuncSeparate( BlendFactor srcRGB, BlendFactor dstRGB, BlendFactor srcAlpha, BlendFactor dstAlpha)
-------------------------------
enum BufferTarget
{
Arraybuffer = ((int)0X8892),
Elementarraybuffer = ((int)0X8893),
// PBO stuff missing
}
enum BufferUsage
{
Dynamicdraw = ((int)0X88e8),
Staticdraw = ((int)0X88e4),
Streamdraw = ((int)0X88e0),
}
SVN: void BindBuffer( OpenTK.Graphics.GLES20.All target, Int32 buffer)
New: void BindBuffer( BufferTarget target, Int32 buffer)
SVN: void BufferData( OpenTK.Graphics.GLES20.All target, IntPtr size, IntPtr data, OpenTK.Graphics.GLES20.All usage)
New: void BufferData( BufferTarget target, IntPtr size, IntPtr data, BufferUsage usage)
SVN: void BufferSubData( OpenTK.Graphics.GLES20.All target, IntPtr offset, IntPtr size, IntPtr data)
New: void BufferSubData( BufferTarget target, IntPtr offset, IntPtr size, IntPtr data)
enum GetBufferPName
{
Buffersize = ((int)0X8764),
Bufferusage = ((int)0X8765),
}
SVN: void GetBufferParameter( OpenTK.Graphics.GLES20.All target, OpenTK.Graphics.GLES20.All pname, Int32* @params)
New: void GetBufferParameter( BufferTarget target, GetBufferPName pname, Int32* @params)
-------------------------------
enum VertexAttribType
{
Byte = ((int)0X1400),
Unsignedbyte = ((int)0X1401),
Short = ((int)0X1402),
Unsignedshort = ((int)0X1403),
Fixed = ((int)0X140c),
Float = ((int)0X1406),
}
SVN: void VertexAttribPointer( Int32 indx, Int32 size, OpenTK.Graphics.GLES20.All type, bool normalized, Int32 stride, IntPtr ptr)
New: void VertexAttribPointer( Int32 indx, Int32 size, VertexAttribType type, bool normalized, Int32 stride, IntPtr ptr)
-------------------------------
SVN: void Clear( Int32 mask)
New: void Clear( ClearBufferMask mask)
-------------------------------
enum ShaderType
{
Vertexshader = ((int)0X8b31),
Fragmentshader = ((int)0X8b30),
}
SVN: Int32 CreateShader( OpenTK.Graphics.GLES20.All type)
New: Int32 CreateShader( ShaderType type)
SVN: void GetShaderPrecisionFormat( OpenTK.Graphics.GLES20.All shadertype, OpenTK.Graphics.GLES20.All precisiontype, Int32* range, Int32* precision)
New: void GetShaderPrecisionFormat( ShaderType shadertype, ShaderPrecision precisiontype, Int32* range, Int32* precision)
-------------------------------
SVN: void CullFace( OpenTK.Graphics.GLES20.All mode)
New: void CullFace( CullFaceMode mode)
-------------------------------
SVN: void DepthFunc( OpenTK.Graphics.GLES20.All func)
New: void DepthFunc( StencilFunction func)
Yes, the enums can be shared between stencilfunc and depthfunc. Maybe rename the enum to something like ComparisonFunction.
-------------------------------
enum DrawElementsType
{
Unsignedbyte = ((int)0X1401),
Unsignedshort = ((int)0X1403),
}
SVN: void DrawArrays( OpenTK.Graphics.GLES20.All mode, Int32 first, Int32 count)
New: void DrawArrays( BeginMode mode, Int32 first, Int32 count)
SVN: void DrawElements( OpenTK.Graphics.GLES20.All mode, Int32 count, OpenTK.Graphics.GLES20.All type, IntPtr indices)
New: void DrawElements( BeginMode mode, Int32 count, DrawElementsType type, IntPtr indices)
-------------------------------
SVN: void Enable( OpenTK.Graphics.GLES20.All cap)
New: void Enable( EnableCap cap)
SVN: void Disable( OpenTK.Graphics.GLES20.All cap)
New: void Disable( EnableCap cap)
SVN: bool IsEnabled( OpenTK.Graphics.GLES20.All cap)
New: bool IsEnabled( EnableCap cap)
-------------------------------
SVN: void FrontFace( OpenTK.Graphics.GLES20.All mode)
New: void FrontFace( FrontFaceDirection mode)
-------------------------------
enum ReturnedAttribType
{
Float = ((int)0X1406),
Floatvec2 = ((int)0X8b50),
Floatvec3 = ((int)0X8b51),
Floatvec4 = ((int)0X8b52),
Floatmat2 = ((int)0X8b5a),
Floatmat3 = ((int)0X8b5b),
Floatmat4 = ((int)0X8b5c),
}
SVN: void GetActiveAttrib( Int32 program, Int32 index, Int32 bufsize, ref Int32 length, ref Int32 size, ref OpenTK.Graphics.GLES20.All type, String name)
New: void GetActiveAttrib( Int32 program, Int32 index, Int32 bufsize, out Int32 length, out Int32 size, out ReturnedAttribType type, String name)
-------------------------------
Enum UniformTypes is missing:
Float = ((int)0X1406),
Int = ((int)0X1404),
SVN: void GetActiveUniform( Int32 program, Int32 index, Int32 bufsize, ref Int32 length, ref Int32 size, ref OpenTK.Graphics.GLES20.All type, String name)
New: void GetActiveUniform( Int32 program, Int32 index, Int32 bufsize, out Int32 length, out Int32 size, out UniformTypes type, String name)
-------------------------------
Enum ErrorCode is missing:
Invalidframebufferoperation = ((int)0X0506),
SVN: OpenTK.Graphics.GLES20.All GetError()
New: ErrorCode GetError()
-------------------------------
enum ProgramPName
{
Deletestatus = ((int)0X8b80),
Linkstatus = ((int)0X8b82),
Validatestatus = ((int)0X8b83),
Infologlength = ((int)0X8b84),
Attachedshaders = ((int)0X8b85),
Activeattributes = ((int)0X8b89),
Activeattributemaxlength = ((int)0X8b8a),
Activeuniforms = ((int)0X8b86),
Activeuniformmaxlength = ((int)0X8b87),
}
SVN: void GetProgram( UInt32 program, OpenTK.Graphics.GLES20.All pname, ref Int32 @params)
New: void GetProgram( UInt32 program, ProgramPName pname, ref Int32 @params)
-------------------------------
enum ShaderPName
{
Shadertype = ((int)0X8b4f),
Deletestatus = ((int)0X8b80),
Compilestatus = ((int)0X8b81),
Infologlength = ((int)0X8b84),
Shadersourcelength = ((int)0X8b88),
}
SVN: void GetShader( UInt32 shader, OpenTK.Graphics.GLES20.All pname, ref Int32 @params)
New: void GetShader( UInt32 shader, ShaderPName pname, ref Int32 @params)
-------------------------------
Enum StringName is missing:
Shadinglanguageversion = ((int)0X8b8c),
BUG: function returns ubyte* (i.e. null-terminated string), not byte
SVN: Byte GetString( OpenTK.Graphics.GLES20.All name)
New: string GetString( StringName name)
-------------------------------
From existing enum VertexArrays, which isn't used elsewhere:
Remove:
Vertexattribarraypointer = ((int)0X8645),
Add:
Currentvertexattrib = ((int)0X8626),
SVN: void GetVertexAttrib( Int32 index, OpenTK.Graphics.GLES20.All pname, ref Single @params)
New: void GetVertexAttrib( Int32 index, VertexArrays pname, ref Single @params)
-------------------------------
enum VertexAttribArrayPointer // rename this to something shorter
{
Vertexattribarraypointer = ((int)0X8645),
}
SVN: void GetVertexAttribPointer( Int32 index, OpenTK.Graphics.GLES20.All pname, IntPtr pointer)
New: void GetVertexAttribPointer( Int32 index, VertexAttribArrayPointer pname, IntPtr pointer)
-------------------------------
SVN: void Hint( OpenTK.Graphics.GLES20.All target, OpenTK.Graphics.GLES20.All mode)
New: void Hint( HintTarget target, HintMode mode)
-------------------------------
SVN: void ShaderBinary( Int32 n, UInt32* shaders, OpenTK.Graphics.GLES20.All binaryformat, IntPtr binary, Int32 length)
OpenGL ES defines no specific binary formats,
but does provide a mechanism to obtain token values for such formats provided
by extensions. The number of shader binary formats supported can be obtained
by querying the value of NUM_SHADER_BINARY_FORMATS. The list of specific
binary formats supported can be obtained by querying the value of SHADER_-
BINARY_FORMATS.
Related Tokens:
Shaderbinaryformats = ((int)0X8df8),
Numshaderbinaryformats = ((int)0X8df9),
-------------------------------
Enum StencilOp is missing the Token "Zero", the rest is fine.
SVN: void StencilFunc( OpenTK.Graphics.GLES20.All func, Int32 @ref, Int32 mask)
New: void StencilFunc( StencilFunc func, Int32 @ref, Int32 mask)
SVN: void StencilFuncSeparate( OpenTK.Graphics.GLES20.All face, OpenTK.Graphics.GLES20.All func, Int32 @ref, Int32 mask)
New: void StencilFuncSeparate( CullFaceMode, StencilFunc func, Int32 @ref, Int32 mask)
SVN: void StencilMaskSeparate( OpenTK.Graphics.GLES20.All face, Int32 mask)
NEw: void StencilMaskSeparate( CullFaceMode face, Int32 mask)
SVN: void StencilOp( OpenTK.Graphics.GLES20.All fail, OpenTK.Graphics.GLES20.All zfail, OpenTK.Graphics.GLES20.All zpass)
New: void StencilOp( StencilOp fail, StencilOp zfail, StencilOp zpass)
SVN: void StencilOpSeparate( OpenTK.Graphics.GLES20.All face, OpenTK.Graphics.GLES20.All fail, OpenTK.Graphics.GLES20.All zfail, OpenTK.Graphics.GLES20.All zpass)
New: void StencilOpSeparate( CullFaceMode face, StencilOp fail, StencilOp zfail, StencilOp zpass)


Comments
#1
First part.
Unfinished:
-PBO related tokens missing
-Come up with a good solution for ShaderBinary()
#2
That's a lot of work (whistles!)
Unless the specs have a definite list of binary formats, I think we should just leave this parameter as 'All' or 'int'. (I don't think there is such a list, considering every IHV can define its own extensions.)
#3
This is the easy, fun part of the cleanup. It will get really ugly with the texture, frame- and render-buffer stuff that is coming next. ;)
I also plan to do separate enums for GetFloat, GetInt, etc., the GetPName enum from our OpenGL bindings is something I never liked and I'd like to try doing this cleaner for ES (maybe even do it for GL too, if it doesn't prove to be a major headache).
The supported binary formats are implementation dependent, we could probably do something similar to X-Ram's wrapper but I think that's futile unless we have dozens of different platforms to test this on. Like you said, 'All' or 'int' it is for now, I see no way doing this without either users being active helpers in testing it, or having the devices available.
#4
#5
Solved Issues:
Remaining Issues:
#6
Invalidframebufferoperation should be InvalidFramebufferOperation (noting so I don't forget it when merging the enums).
#7
Specs merged into es20 branch, rev. 2373.
#8
Bindings regenerated (rev. 2382).
#9
Closing issues fixed in 1.0 beta-1.