diff options
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 0251e89ae85..07b341e68af 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -22,6 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #include "glheader.h" #include "context.h" #include "enable.h" @@ -36,7 +37,6 @@ #include "math/m_translate.h" - void _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { @@ -911,3 +911,71 @@ _mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, } } } + + +/**********************************************************************/ +/***** Initialization *****/ +/**********************************************************************/ + +void _mesa_init_varray( GLcontext * ctx ) +{ + int i; + + /* Vertex arrays */ + ctx->Array.Vertex.Size = 4; + ctx->Array.Vertex.Type = GL_FLOAT; + ctx->Array.Vertex.Stride = 0; + ctx->Array.Vertex.StrideB = 0; + ctx->Array.Vertex.Ptr = NULL; + ctx->Array.Vertex.Enabled = GL_FALSE; + ctx->Array.Vertex.Flags = CA_CLIENT_DATA; + ctx->Array.Normal.Type = GL_FLOAT; + ctx->Array.Normal.Stride = 0; + ctx->Array.Normal.StrideB = 0; + ctx->Array.Normal.Ptr = NULL; + ctx->Array.Normal.Enabled = GL_FALSE; + ctx->Array.Normal.Flags = CA_CLIENT_DATA; + ctx->Array.Color.Size = 4; + ctx->Array.Color.Type = GL_FLOAT; + ctx->Array.Color.Stride = 0; + ctx->Array.Color.StrideB = 0; + ctx->Array.Color.Ptr = NULL; + ctx->Array.Color.Enabled = GL_FALSE; + ctx->Array.Color.Flags = CA_CLIENT_DATA; + ctx->Array.SecondaryColor.Size = 4; + ctx->Array.SecondaryColor.Type = GL_FLOAT; + ctx->Array.SecondaryColor.Stride = 0; + ctx->Array.SecondaryColor.StrideB = 0; + ctx->Array.SecondaryColor.Ptr = NULL; + ctx->Array.SecondaryColor.Enabled = GL_FALSE; + ctx->Array.SecondaryColor.Flags = CA_CLIENT_DATA; + ctx->Array.FogCoord.Size = 1; + ctx->Array.FogCoord.Type = GL_FLOAT; + ctx->Array.FogCoord.Stride = 0; + ctx->Array.FogCoord.StrideB = 0; + ctx->Array.FogCoord.Ptr = NULL; + ctx->Array.FogCoord.Enabled = GL_FALSE; + ctx->Array.FogCoord.Flags = CA_CLIENT_DATA; + ctx->Array.Index.Type = GL_FLOAT; + ctx->Array.Index.Stride = 0; + ctx->Array.Index.StrideB = 0; + ctx->Array.Index.Ptr = NULL; + ctx->Array.Index.Enabled = GL_FALSE; + ctx->Array.Index.Flags = CA_CLIENT_DATA; + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + ctx->Array.TexCoord[i].Size = 4; + ctx->Array.TexCoord[i].Type = GL_FLOAT; + ctx->Array.TexCoord[i].Stride = 0; + ctx->Array.TexCoord[i].StrideB = 0; + ctx->Array.TexCoord[i].Ptr = NULL; + ctx->Array.TexCoord[i].Enabled = GL_FALSE; + ctx->Array.TexCoord[i].Flags = CA_CLIENT_DATA; + } + ctx->Array.TexCoordInterleaveFactor = 1; + ctx->Array.EdgeFlag.Stride = 0; + ctx->Array.EdgeFlag.StrideB = 0; + ctx->Array.EdgeFlag.Ptr = NULL; + ctx->Array.EdgeFlag.Enabled = GL_FALSE; + ctx->Array.EdgeFlag.Flags = CA_CLIENT_DATA; + ctx->Array.ActiveTexture = 0; /* GL_ARB_multitexture */ +} |