Archived

This topic is now archived and is closed to further replies.

DirectDraw Flicking :(

This topic is 6017 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

Hello, I use the code below : g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER , D3DCOLOR_XRGB(125,125,125), 1.0f, 0 ); g_pd3dDevice->BeginScene(); g_pd3dDevice->SetVertexShader(D3D8T_CUSTOMVERTEX); g_pd3dDevice->SetStreamSource(0,g_vb,sizeof(simple_point)); index=0; for (geomobjectnb=0; geomobjectnb < geomobject; geomobjectnb++) { temp=objetinfotable[geomobjectnb][0]; // number of faces of the object. The number of objects is contained in geomobject. materialnb=objetinfotable[geomobjectnb][1]; // material to use for this material if (materialnb>-1) // if there's a material to use g_pd3dDevice->SetTexture( 0, g_texture[materialnb] ); else // no material g_pd3dDevice->SetTexture( 0, 0 ); // the problem is probably here, I would to trace only the Faces of this object, no more so on the list from 'index' to 'temp' g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST,index,temp); index=index+temp*3; // 1 Face has got 3 points } g_pd3dDevice->EndScene(); g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); But there's a problem, with this code the screen flicked Some maps are applied to undesired objects. Have you got any idea where it could come from please? Thanks. Lucien Edited by - Lucien on June 24, 2001 1:45:23 PM

Share this post


Link to post
Share on other sites
I''m not completely sure if this would make a difference, but you could try it:

The line of code:

g_pd3dDevice->SetTexture( 0, 0 );

Shouldn''t it be:

g_pd3dDevice->SetTexture( 0, NULL );


It could possibly make a difference, since it may see the 0 as an address or something.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
    g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER , D3DCOLOR_XRGB(125,125,125), 1.0f, 0 );

g_pd3dDevice->BeginScene();
g_pd3dDevice->SetVertexShader(D3D8T_CUSTOMVERTEX);
g_pd3dDevice->SetStreamSource(0,g_vb,sizeof(simple_point));

index=0;
for (geomobjectnb=0; geomobjectnb < geomobject; geomobjectnb++)
{
temp=objetinfotable[geomobjectnb][0]; // number of faces of the object. The number of objects is contained in geomobject.
materialnb=objetinfotable[geomobjectnb][1]; // material to use for this material
if (materialnb>-1) // if there''s a material to use
g_pd3dDevice->SetTexture( 0, g_texture[materialnb] );
else // no material
g_pd3dDevice->SetTexture( 0, 0 );

// the problem is probably here, I would to trace only the Faces of this object, no more so on the list from ''index'' to ''temp''
g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST,index,temp);
index=index+temp*3; // 1 Face has got 3 points
}
g_pd3dDevice->EndScene();
g_pd3dDevice->Present( NULL, NULL, NULL, NULL );

Share this post


Link to post
Share on other sites