The following fragment of code is crashing after some cycles of display.All the code is not shown for proprietary reasons. Please suggest the possible causes for the problem.
<CODE>
While Not KeyDown(KEY_ESCAPE)
Cls()
BindTexture( texture )
DrawTexture( texture )
Flip( 1 )
Wend
Function DrawTexture( texture:IDirectDrawSurface7 )
'some vertex initialization code here and finally this fucntion is called
device.DrawPrimitive( D3DPT_TRIANGLEFAN, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1, vertData, numVerts, 0 )
End Function
Function BindTexture( texture:IDirectDrawSurface7 )
Local device:IDirect3DDevice7 = D3D7GraphicsDriver().Direct3DDevice7()
device.SetTexture( 0, texture )
device.SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE )
'.... some other SetTextureState calls here
End Function
</CODE>
<CODE>
While Not KeyDown(KEY_ESCAPE)
Cls()
BindTexture( texture )
DrawTexture( texture )
Flip( 1 )
Wend
Function DrawTexture( texture:IDirectDrawSurface7 )
'some vertex initialization code here and finally this fucntion is called
device.DrawPrimitive( D3DPT_TRIANGLEFAN, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1, vertData, numVerts, 0 )
End Function
Function BindTexture( texture:IDirectDrawSurface7 )
Local device:IDirect3DDevice7 = D3D7GraphicsDriver().Direct3DDevice7()
device.SetTexture( 0, texture )
device.SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE )
'.... some other SetTextureState calls here
End Function
</CODE>