[GEM-dev] vertex_array branch

James Tittle II tigital at mac.com
Wed Aug 25 21:40:22 CEST 2004


On Aug 25, 2004, at 12:08 PM, IOhannes m zmoelnig wrote:

> IOhannes m zmoelnig wrote:
>> i do not know _where_ to check them in ? Geos/ seems to be the wrong 
>> place.
>> should we place it into Manips/ or make a seperate Vertex/-directory
>
> so if no one objects within 5 minutes i will create a new module 
> src/Vertex tomorrow.
> at least if no one objects until tomorrow.

...I don't object ;-)

> i really think, that there is a potential for a lot of vertex_ objects.
>
> i also want to add [vertex_add] and [vertex_mul] for 
> adding/multiplying 2 vertex arrays. (i have never seen higher maths on 
> objects but a*(x^2)+x really looks cool for x:=venus.obj)
>

...ok, so i finally got around to grabbing this branch, and after a bit 
of customizing to my dev environment, I ran into your warning for "# 
error please replace __APPLE__ by something more specific; JMZ 
"...there seems to be a coupla ways around this:

1.  as is is ok for apple, but to get similar behavior on other 
systems, use ATI_vertex_array_object and/or NV_vertex_array_object?  
This seems to be a tower of babel situation...

2.  change to ARB_vertex_buffer_object...this extension is newly 
supported on 10.3.4+, but isn't in the OpenGL.framework:  however, it's 
trivially easy to hack around this and create your own vbo.h with the 
correct defs:


#include <stdint.h>
#include <OpenGL/gl.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef intptr_t GLintptrARB;
typedef uintptr_t GLsizeiptrARB;

extern void glBindBufferARB(GLenum target, GLuint buffer);
extern void glDeleteBuffersARB(GLsizei n, const GLuint *buffers);
extern void glGenBuffersARB(GLsizei n, GLuint *buffers);
extern GLboolean glIsBufferARB(GLuint buffer);

extern void glBufferDataARB(GLenum target, GLsizeiptrARB size, const 
GLvoid *data, GLenum usage);
extern void glBufferSubDataARB(GLenum target, GLintptrARB offset, 
GLsizeiptrARB size, const GLvoid *data);
extern void glGetBufferSubDataARB(GLenum target, GLintptrARB offset, 
GLsizeiptrARB size, GLvoid *data);

extern void *glMapBufferARB(GLenum target, GLenum access);
extern GLboolean glUnmapBufferARB(GLenum target);

extern void glGetBufferParameterivARB(GLenum target, GLenum pname, 
GLint *params);
extern void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid 
**params);

#define GL_ARRAY_BUFFER_ARB                             0x8892
#define GL_ELEMENT_ARRAY_BUFFER_ARB                     0x8893

#define GL_ARRAY_BUFFER_BINDING_ARB                     0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB             0x8895
#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB              0x8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB              0x8897
#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB               0x8898
#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB               0x8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB       0x889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB           0x889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB     0x889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB      0x889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB              0x889E

#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB       0x889F

#define GL_STREAM_DRAW_ARB                              0x88E0
#define GL_STREAM_READ_ARB                              0x88E1
#define GL_STREAM_COPY_ARB                              0x88E2
#define GL_STATIC_DRAW_ARB                              0x88E4
#define GL_STATIC_READ_ARB                              0x88E5
#define GL_STATIC_COPY_ARB                              0x88E6
#define GL_DYNAMIC_DRAW_ARB                             0x88E8
#define GL_DYNAMIC_READ_ARB                             0x88E9
#define GL_DYNAMIC_COPY_ARB                             0x88EA

#define GL_READ_ONLY_ARB                                0x88B8
#define GL_WRITE_ONLY_ARB                               0x88B9
#define GL_READ_WRITE_ARB                               0x88BA

#define GL_BUFFER_SIZE_ARB                              0x8764
#define GL_BUFFER_USAGE_ARB                             0x8765
#define GL_BUFFER_ACCESS_ARB                            0x88BB
#define GL_BUFFER_MAPPED_ARB                            0x88BC

#define GL_BUFFER_MAP_POINTER_ARB                       0x88BD

#ifdef __cplusplus
}
#endif

...ok, so the vertex_buffer_object is fairly new, but seems better 
supported on linux/windoze (at least on recent graphics boards)...as 
far as I can tell on apple, the two paths a similar, with the exception 
that the vao is supported back to 10.2 and vbo is only 10.3.4+?

...any preferences?
jamie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 7568 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20040825/a6dcb7f3/attachment.bin>


More information about the GEM-dev mailing list