Skip to content

Instantly share code, notes, and snippets.

@od0x0
Created January 21, 2012 16:07
Show Gist options
  • Save od0x0/1653166 to your computer and use it in GitHub Desktop.
Save od0x0/1653166 to your computer and use it in GitHub Desktop.
Nested Clay
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])
{
...
}
//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 ...
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment