annotate src/vertex-attribute.c @ 54:7fd43d272c93 good64bit

Ahh .. yup.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 06 Aug 2013 15:57:30 +0300
parents 217cd6863772
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /* ============================================================================
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Freetype GL - A C OpenGL Freetype engine
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Platform: Any
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 * WWW: http://code.google.com/p/freetype-gl/
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * Copyright 2011,2012 Nicolas P. Rougier. All rights reserved.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 * modification, are permitted provided that the following conditions are met:
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 * 1. Redistributions of source code must retain the above copyright notice,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 * this list of conditions and the following disclaimer.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 * 2. Redistributions in binary form must reproduce the above copyright
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer in the
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 * documentation and/or other materials provided with the distribution.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 * THIS SOFTWARE IS PROVIDED BY NICOLAS P. ROUGIER ''AS IS'' AND ANY EXPRESS OR
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 * EVENT SHALL NICOLAS P. ROUGIER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 * The views and conclusions contained in the software and documentation are
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 * those of the authors and should not be interpreted as representing official
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 * policies, either expressed or implied, of Nicolas P. Rougier.
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 * ============================================================================
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 */
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #include <assert.h>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 #include <string.h>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 #include <stdlib.h>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 #include <stdio.h>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 #include "vec234.h"
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 #include "platform.h"
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 #include "vertex-attribute.h"
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 // ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 vertex_attribute_t *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 vertex_attribute_new( GLchar * name,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 GLint size,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 GLenum type,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 GLboolean normalized,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 GLsizei stride,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 GLvoid *pointer )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 vertex_attribute_t *attribute =
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 (vertex_attribute_t *) malloc (sizeof(vertex_attribute_t));
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 assert( size > 0 );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 attribute->name = (GLchar *) strdup( name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 attribute->index = -1;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 attribute->size = size;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 attribute->type = type;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 attribute->normalized = normalized;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 attribute->stride = stride;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 attribute->pointer = pointer;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 return attribute;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 // ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 void
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 vertex_attribute_delete( vertex_attribute_t * self )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 assert( self );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 free( self->name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 free( self );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 #include <stddef.h>
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 char *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 strndup (const char *s, size_t n)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 char *result;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 size_t len = strlen (s);
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 if (n < len)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 len = n;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 result = (char *) malloc (len + 1);
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 if (!result)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 return 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 result[len] = '\0';
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 return (char *) memcpy (result, s, len);
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 // ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 vertex_attribute_t *
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 vertex_attribute_parse( char *format )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 GLenum type = 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 int size;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 int normalized = 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 char ctype;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 char *name;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 vertex_attribute_t *attr;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 char *p = strchr(format, ':');
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 if( p != NULL)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 name = strndup(format, p-format);
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 if( *(++p) == '\0' )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 fprintf( stderr, "No size specified for '%s' attribute\n", name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 free( name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 return 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 size = *p - '0';
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 if( *(++p) == '\0' )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 fprintf( stderr, "No format specified for '%s' attribute\n", name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 free( name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 return 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 ctype = *p;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 if( *(++p) != '\0' )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 if( *p == 'n' )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 normalized = 1;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 else
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 fprintf(stderr, "Vertex attribute format not understood ('%s')\n", format );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 return 0;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146 switch( ctype )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 case 'b': type = GL_BYTE; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 case 'B': type = GL_UNSIGNED_BYTE; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 case 's': type = GL_SHORT; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 case 'S': type = GL_UNSIGNED_SHORT; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 case 'i': type = GL_INT; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 case 'I': type = GL_UNSIGNED_INT; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154 case 'f': type = GL_FLOAT; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 default: type = 0; break;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 attr = vertex_attribute_new( name, size, type, normalized, 0, 0 );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 free( name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 return attr;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 // ----------------------------------------------------------------------------
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 void
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 vertex_attribute_enable( vertex_attribute_t *attr )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 if( attr->index == -1 )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 GLint program;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173 glGetIntegerv( GL_CURRENT_PROGRAM, &program );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 if( program == 0)
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176 return;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178 attr->index = glGetAttribLocation( program, attr->name );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 if( attr->index == -1 )
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 {
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181 return;
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183 }
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 glEnableVertexAttribArray( attr->index );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185 glVertexAttribPointer( attr->index, attr->size, attr->type,
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 attr->normalized, attr->stride, attr->pointer );
785057719d9b Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187 }