[core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header. * `Segment` now tracks offset and length of indices, rather than primitives. This is more natural. * Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering. * `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms. * Use the debug shaders for debug tile rendering, like gl-js. * Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
This commit is contained in:
@@ -86,6 +86,7 @@ struct FillPatternUniforms : gl::Uniforms<
|
||||
|
||||
class FillProgram : public Program<
|
||||
shaders::fill,
|
||||
gl::Triangle,
|
||||
FillAttributes,
|
||||
FillUniforms>
|
||||
{
|
||||
@@ -94,6 +95,7 @@ class FillProgram : public Program<
|
||||
|
||||
class FillPatternProgram : public Program<
|
||||
shaders::fill_pattern,
|
||||
gl::Triangle,
|
||||
FillAttributes,
|
||||
FillPatternUniforms>
|
||||
{
|
||||
@@ -102,6 +104,7 @@ class FillPatternProgram : public Program<
|
||||
|
||||
class FillOutlineProgram : public Program<
|
||||
shaders::fill_outline,
|
||||
gl::Line,
|
||||
FillAttributes,
|
||||
FillUniforms>
|
||||
{
|
||||
@@ -110,6 +113,7 @@ class FillOutlineProgram : public Program<
|
||||
|
||||
class FillOutlinePatternProgram : public Program<
|
||||
shaders::fill_outline_pattern,
|
||||
gl::Line,
|
||||
FillAttributes,
|
||||
FillPatternUniforms>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user