Skip to content

Instantly share code, notes, and snippets.

@od0x0
Created January 21, 2012 16:07
Show Gist options
  • Select an option

  • Save od0x0/1653166 to your computer and use it in GitHub Desktop.

Select an option

Save od0x0/1653166 to your computer and use it in GitHub Desktop.

Revisions

  1. Oliver Daids revised this gist Jan 21, 2012. 2 changed files with 26 additions and 1 deletion.
    25 changes: 25 additions & 0 deletions Might be useful with variants too
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    //This:
    variant UniformValue (Array[GLfloat, 16], GLfloat, Array[GLubyte, 4], …);
    record Uniform
    (
    name: String,
    location: GLint,
    value: ShaderUniformValue
    );


    //Into:
    record Uniform
    (
    name: String,
    location: GLint,
    value: variant Value (Array[GLfloat, 16], GLfloat, Array[GLubyte, 4], …);
    );

    //or even
    record Uniform
    (
    name: String,
    location: GLint,
    value: Array[GLfloat, 16] or GLfloat or Array[GLubyte, 4] or ...
    );
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -22,4 +22,4 @@ record Texture
    overload serializeToByteVector(settings: Texture.Settings, out: Vector[UInt8])
    {
    ...
    }
    }
  2. Oliver Daids created this gist Jan 21, 2012.
    25 changes: 25 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    record Texture
    (
    record Settings
    (
    compressed?: Bool,
    mipmapped?: Bool,
    clampedEdges?: Bool
    );
    settings: Settings
    //And/or
    settings: record Settings
    (
    compressed?: Bool,
    mipmapped?: Bool,
    clampedEdges?: Bool
    );

    //Rest of data definition
    ...
    );

    overload serializeToByteVector(settings: Texture.Settings, out: Vector[UInt8])
    {
    ...
    }