   pixel plotting
  Hey all,The book i''m reading uses Plot8(100,20,26, (UCHAR *)ddsd.lpSurface,(int)ddsd.lPitch); to plot a pixle on the surface but this function dosen''t exsist in the directx 9 anymore.Is there any other function that does the same in directx 9?thanks 
  IDirect3DSurface9::LockRect() ;  Acquire a pointer to the surface by locking it. Adjust the pBits for the type of access you want i.e DWORD, BYTE etc... (don''t forget the pitch too) then simply calculate the position by: pitch * y + x and then set the colour on that pixel.Release the surface and present the screen.You can then create a function and call it Plot8 if you want.However, I would recommend not making this a function as the call takes more time than actually placing the colour value itself.   ____________________________________________________________Try RealityRift at www.planetrift.comFeel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said. I could be wrong or right but the ideas are mine.;  I build some functions myself and these are very fast inline HRESULT D3DLockSurface(LPDIRECT3DSURFACE9 pD3DS, D3DLOCKED_RECT* D3DLockedRect){return pD3DS->LockRect(D3DLockedRect,0,0);}inline HRESULT D3DUnlockSurface(LPDIRECT3DSURFACE9 pD3DS){return pD3DS->UnlockRect();}inline void D3DPutPixel(D3DLOCKED_RECT D3DLockedRect, int x, int y, unsigned int rgb565){int offset = (y*D3DLockedRect.Pitch + x*2);unsigned char* szSurface = (unsigned char*)D3DLockedRect.pBits;memcpy(szSurface + offset,&rgb565,2);}rgb565 can be done with:#define RGB565(r,g,b) ((r << 11) | (g << 5) | b)unsigned int color = RGB565(255,0,178)Have fun 