I am making a small 3D graphics / demo for personal training. I know d3d9 and a little about d3d11, but a little about opengl at the moment, so I intend to ignore the actual rendering of the graphics so that my scene graph and everything βaboveβ, he needs to learn a little about how to actually draw graphics. I intend to get it working with d3d9, then add d3d11 support and finally opengl support. Just like a training exercise to learn about 3D graphics and abstraction.
I am not very good at opengl at this point, but I donβt want my abstract interface to display anything that is not easy to implement in opengl. In particular, I look at vertex buffers. In d3d, they are essentially an array of structures, but looking at the opengl interface, the equivalent seems to be a vertex array. However, they seem organized differently, where you need a separate array for the vertices, one for normals, one for texture coordinates, etc. And installation using glVertexPointer, glTexCoordPointer, etc.
I was hoping to implement the VertexBuffer interface, like Directx, but it looks like in d3d you have an array of structures, and in opengl you need a separate array for each element, which makes finding a common abstraction quite difficult to make efficient.
Is there a way to use opengl similarly to directx? Or any suggestions on how to come up with a higher level abstraction that will work effectively with both systems?
source share