This has been interesting excercise. There is still one Debug message I am seeing that I dont like but it doesnt seem to have much impact nor can I explain it.
I think this is due to fact your FVF has 2 texture coordinates and it knows your not using textures. It does not seem to affect behavior.
I would suggest you manage the IndexBuffer the same way you manage the VertexBuffer with direct memory manipulations instead of the sliceing.
Now the approach you are using for static geomitry is ok. Unless you have lots of tiny meshes then you would want to merge the vertex and index buffers.
This will be aweful for for anykind of dynamic or animated mesh. For that you need a global dynamic buffer similar to what I used in the Max2d.
I also would probably not use Dx9Max2d driver as the base as it manages the begin scene end scene states. Use the
Base driver.
You really dont want to mix Max2d rendering be it Dx9 or OpenGL as Max2d. Its not very effeicent rendering and state managment which will affect 3d performance in complex scenes greatly.
Thanks for posting If you guys are interested I would like to show you some work that I had done similar to what your attempting but havent explored it fully out but might be something you would intereted in.
I will be making some changes to the Dx9Max2d library based upon some things that I have seen after relooking at it while trying to figure out your problem.
Doug
[5424] Direct3D9: (WARN) :Stream 0 stride and vertex size, computed from the current vertex declaration or FVF, are different, which might not work with pre-DX8 drivers
I think this is due to fact your FVF has 2 texture coordinates and it knows your not using textures. It does not seem to affect behavior.
I would suggest you manage the IndexBuffer the same way you manage the VertexBuffer with direct memory manipulations instead of the sliceing.
Now the approach you are using for static geomitry is ok. Unless you have lots of tiny meshes then you would want to merge the vertex and index buffers.
This will be aweful for for anykind of dynamic or animated mesh. For that you need a global dynamic buffer similar to what I used in the Max2d.
I also would probably not use Dx9Max2d driver as the base as it manages the begin scene end scene states. Use the
Base driver.
SuperStrict Framework pub.win32 Import "DX9Graphics.bmx" Import brl.GLGraphics SetGraphicsDriver(D3D9GraphicsDriver(),GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER) Function Clear(dwColor:Int) D3D9GraphicsDriver().Direct3DDevice9().Clear(0,Null,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,dwColor,1.0,0) End Function Function BeginScene:Int() Return D3D9GraphicsDriver().BeginScene()=0 End Function Function EndScene() D3D9GraphicsDriver().EndScene() End Function Graphics 640,480,0 While Not KeyHit(Key_Escape) Clear($FFFF0000) If BeginScene() EndScene() End If Flip 0 Wend
You really dont want to mix Max2d rendering be it Dx9 or OpenGL as Max2d. Its not very effeicent rendering and state managment which will affect 3d performance in complex scenes greatly.
Thanks for posting If you guys are interested I would like to show you some work that I had done similar to what your attempting but havent explored it fully out but might be something you would intereted in.
I will be making some changes to the Dx9Max2d library based upon some things that I have seen after relooking at it while trying to figure out your problem.
Doug