Change capitalization of 2D for consistency

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Error when we try to change the active state

Changing a state object while we're in that state yields goofy results. Better
to just crash.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Rudimentary color buffer management for states

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Pass the name for the position variable to foreach()

No more implicit manipulation of namespaces.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Add refcounting for texmaps and blank texmaps

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Fix default draw buffer setup in state code

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Use calloc when allocating a new state

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Add a reference counter API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Remove extraneous variable declaration

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Remove wrong use of vec_expand in state.c and refcount.c

It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
It's a = vec_expand(a, a_size) not just vec_expand(a, a_size)
...

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Actually build the new refcount code

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Port ebuf to use the new refcounting API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Free a refcounter when it becomes 0, not when it goes negative

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Port vbuf to new refcount API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Port mesh to new refcount API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Add warning for refcounts going negative

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Port texmap to new refcount API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>