Jump to content
  • Advertisement
Sign in to follow this  
CastorX

PointList

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HY! I would like to draw a bitmap form the array "Final", that contains the position, and the the color of each pixel. The source code: ... #define D3DFVF_CUSTOMVERTEX2(D3DFVF_XYZRHW|D3DFVF_DIFFUSE)); ... if( SUCCEEDED( Dev->BeginScene() ) ) { Dev->SetFVF(D3DFVF_CUSTOMVERTEX2); /* METHOD1: for(unsigned long i=0;i<W*H;i++) { ActPoint.color=Final.color; ActPoint.position=Final.position; Dev->DrawPrimitiveUP(D3DPT_POINTLIST,1,&ActPoint,sizeof(CUSTOMVERTEX2)); }*/ /* METHOD2: Dev->DrawPrimitiveUP(D3DPT_POINTLIST,W*H,&Final,sizeof(CUSTOMVERTEX2)); */ Dev->EndScene(); } The Problem: If I use Method1 Anything is OK, but slow. If I use method two nothing will be drawn (but that does it fast). Is there other way to draw a picture onto the screen in D3D, but NOT as a texture. I use IPicture, with OLE Image loader, I'v tried to use the D3DXLoadSurfaceFromFile function, but there was allways the error: D3DXERR_INVALIDDATA. I want to resize the window, so I don't want to draw into the window directly. What is the problem with the code up there? Bye!

Share this post


Link to post
Share on other sites
Advertisement
Are you intentionally using the UP methods. I'm not sure by how much but they are known to be slower than their counterparts. I would suggest first trying a vertex buffer full of the points and rendering from that.

ace

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!