0
votes

A bit of context :

I'm working on a GPU emulator (the NV2A if you want to know) at the push-buffer level, and I'm trying to implement the drawing using OpenGL. The GPU commands that I have to emulate contain separate pointers for each vertex component (so positions are in an entirely different memory address than fog coordinates, colors, texture coordinates, etc.) Other data, like vertex component size, type and stride are also present in the push-buffer, but those are not really relevant to this question.

I've been reading about Vertex Array Objects, but as far as my tests go, the pointers you can set with glVertexAttribPointer should all be relative to a Vertex Buffer Object - something I would like to avoid, as I've already got a copy of the data in memory.

The question :

Is it possible in OpenGL to draw vertices using separate pointers (not managed by any OpenGL API) per vertex component? And how would the code look like, roughy?

PS: Since I'm emulating a GPU, I have to take vertex shader programs into account too. I haven't worked on these yet, so any suggestion on that is welcome too. TIA!

1
Are you going to use OpenGL in core profile or compatibility profile? - shoosh
@shoosh: I don't even know what that means - I'm afraid I'm a OpenGL newbie. But maximum compatibility is my target - ATI, NVidia, and other mainstream cards on WinXP and up. - PatrickvL
why do you want to avoid VBO? - kvark
@kvark : Since the vertex components are already in memory, I see no reason to spend memory on them twice (VBO's are actual buffers, right? So any filling must be done as a copy, costing twice the memory - and at a speed penalty too I presume.) - PatrickvL

1 Answers

2
votes

You don't need to use VBOs, glVertexAttribPointer takes a normal CPU-pointer if no VBO is bound (you can call glBindBuffer(GL_ARRAY_BUFFER, 0) to make sure). And yes, you can set up one address per attribute stream.