lundi 10 février 2014

[Help] Non-zero reference count? topic




Hey guys!
Im currently playing a little bit around with D3D drawing and i got a little problem.

When i use this function to draw a diagonal:


Code:


void DrawLine(float x, float y, float x2, float y2, float width, D3DCOLOR color, LPDIRECT3DDEVICE9 pDevice)
{
        D3DXVECTOR2 vLine[2];

        D3DXCreateLine(pDevice, &pLine);

        pLine->SetWidth(width);
        pLine->SetAntialias(true);
        pLine->SetGLLines(true);

        vLine[0].x = x;
        vLine[0].y = y;
        vLine[1].x = x2;
        vLine[1].y = y2;

        pLine->Begin();
        pLine->Draw(vLine, 2, color);
        pLine->End();
} // crashes on appexit


and resize/close my dx9 app, i get following error:


This also happens when i try drawing a font, without checking if the font is loaded. (avoided this already with a simple check)
but how to avoid this error when drawing my diagonal?

thanks!
mac





Aucun commentaire:

Enregistrer un commentaire