XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

SlimDx Query.GetData...not working

Last post 02/11/2009 22:41 by Glenn Wilson. 2 replies.
  • 02/11/2009 21:08

    SlimDx Query.GetData...not working

    Im trying to get a Occlusion Query to work in SlimDx Direct3D9Ex.
    Here is my code, but whenever I try to use "query.GetData" it only returns 0.

    Query query = new Query(Base.Device, QueryType.Occlusion);
    query.Issue(Issue.Begin);
    ...Render Stuff
    query.Issue(Issue.End);
    uint pixelCount = query.GetData<uint>(true);
  • 02/11/2009 21:27 In reply to

    Re: SlimDx Query.GetData...not working

    Answer
    Reply Quote
    Never mind I figured it out!
    you have to add this line of code before calling "query.GetData":: while(!query.CheckStatus(true));

    So for anyone having the same problem this is how the code would look::

    Query query = new Query(Base.Device, QueryType.Occlusion);
    query.Issue(Issue.Begin);
    ...Render Stuff
    query.Issue(Issue.End);
    while(!query.CheckStatus(true));
    uint pixelCount = query.GetData<uint>(true);
  • 02/11/2009 22:41 In reply to

    Re: SlimDx Query.GetData...not working


    With SlimDX you should really be following the support links from http://slimdx.org/support.php. You might find that you will get a better responce from those links.
Page 1 of 1 (3 items) Previous Next