Skip to content
This repository
Newer
Older
100644 48 lines (36 sloc) 1.202 kb
b9defa99 » stefan
2005-07-31 Import Holger Waechtler's PSP OpenGL ES implementation.
1 #include "pspgl_internal.h"
874d8a44 » jsgf
2005-11-05 If an index is in a buffer and is in hardware format, then use it
2 #include "pspgl_buffers.h"
b9defa99 » stefan
2005-07-31 Import Holger Waechtler's PSP OpenGL ES implementation.
3
4 void glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
5 {
874d8a44 » jsgf
2005-11-05 If an index is in a buffer and is in hardware format, then use it
6 struct pspgl_vertex_array *va = &pspgl_curctx->vertex_array.vertex;
1e61a549 » jsgf
2005-11-05 Detect if the application is supplying us vertices in hardware native
7 GLboolean native;
809f3d6d » jsgf
2006-01-14 This change does two things:
8 GLenum error;
1e61a549 » jsgf
2005-11-05 Detect if the application is supplying us vertices in hardware native
9
809f3d6d » jsgf
2006-01-14 This change does two things:
10 error = GL_INVALID_VALUE;
11 if (unlikely(size < 2 || size > 4))
12 goto out_error;
6e4424e6 » jsgf
2005-11-05 Implement OpenGL 1.1 vertex arrays. Implements glDrawArrays and
13
809f3d6d » jsgf
2006-01-14 This change does two things:
14 if (unlikely(stride < 0))
15 goto out_error;
6e4424e6 » jsgf
2005-11-05 Implement OpenGL 1.1 vertex arrays. Implements glDrawArrays and
16
809f3d6d » jsgf
2006-01-14 This change does two things:
17 error = GL_INVALID_ENUM;
18 if (unlikely(type != GL_BYTE && type != GL_SHORT && type != GL_FLOAT))
19 goto out_error;
6e4424e6 » jsgf
2005-11-05 Implement OpenGL 1.1 vertex arrays. Implements glDrawArrays and
20
21 if (stride == 0)
22 stride = __pspgl_gl_sizeof(type) * size;
23
1e61a549 » jsgf
2005-11-05 Detect if the application is supplying us vertices in hardware native
24 native = (size == 3);
25
874d8a44 » jsgf
2005-11-05 If an index is in a buffer and is in hardware format, then use it
26 psp_log("ptr=%p(%p) size=%d type=%x stride=%d native=%d\n",
27 pointer, __pspgl_bufferobj_deref(pspgl_curctx->vertex_array.arraybuffer, (void *)pointer),
28 size, type, stride, native);
1e61a549 » jsgf
2005-11-05 Detect if the application is supplying us vertices in hardware native
29
6720419c » jsgf
2006-02-18 Add an adjustment to each matrix. This allows a scale/translate to be
30 /* If we're changed vertex formats, then mark the modelview matrix
31 as dirty, so that any adjustment for this format can be
32 applied. */
33 if (va->type != type)
34 pspgl_curctx->modelview_stack.flags |= MF_DIRTY;
35
488cb041 » jsgf
2005-11-05 Implements the ARB_vertex_buffer_object extension. This just adds the
36 va->size = size;
37 va->type = type;
38 va->stride = stride;
39 va->ptr = pointer;
40 va->native = native;
41
42 __pspgl_varray_bind_buffer(va, pspgl_curctx->vertex_array.arraybuffer);
809f3d6d » jsgf
2006-01-14 This change does two things:
43
44 return;
45
46 out_error:
47 GLERROR(error);
b9defa99 » stefan
2005-07-31 Import Holger Waechtler's PSP OpenGL ES implementation.
48 }
Something went wrong with that request. Please try again.