Original Post
Hello everyone, I have the following problem: as I rend a line, the color I specify (blue, but all other colors share the same faith) does not appear, and the line is red instead. I suspect the problem comes either from the D3DXRenderToSurface interface I use, or I do not set the render states correctly. Here is the exact procedure, that is used in the program, so you don't need to read 1000 pages code: -first set the render state and texture parameters: Device->SetTextureStageState( 0, D3DTSS_COLOROP , D3DTOP_SELECTARG1 ); Device->SetTextureStageState( 0, D3DTSS_COLORARG1 , D3DTA_TEXTURE ); Device->SetTextureStageState( 0, D3DTSS_ALPHAOP , D3DTOP_SELECTARG1 ); Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1 , D3DTA_TEXTURE ); Device->SetRenderState( D3DRS_ALPHABLENDENABLE, true ); Device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA ); Device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); -then rend some textures on the screen -create D3DXRenderToSurface object and begin scene -create vertex buffer and load vertex data -call SetStreamSource and SetVertexShader( D3DFVF_XYZRHW | D3DFVF_DIFFUSE ) -call to DrawPrimitive -release vertex buffer -end scene and present It would be really great if someone could help as the book I read about DirectX really sucks :( Should I somehow un-set the texture or render state? P.S. I mentioned, that if I comment the call to Device->SetTexture() while rendering textures, the problem disappears. Strange...