Results 1 to 5 of 5

Thread: Report: DirectDraw in Managed DirectX9

Threaded View

  1. #1

    Thread Starter
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Report: DirectDraw in Managed DirectX9

    I took a look into Managed DirectX 9 with C#. I finally (after HOURS) managed to plot some lines via DirectDraw.

    I'm not asking any questions here, I'm just reporting what I observed.

    The documentation is non-existant. In order to know of what type collections that use the IEnumeration interface are you have to use:
    Code:
    if(en.MoveNext())
      Console.WriteLine(en.Current.GetType().FullNam);
    because the docs don't mention of which type the objects actually are.
    An example is the devices collection of DirectInput.

    This also means that I had many guesses and many exceptions before I found out how to correctly initialize DirectDraw.

    Then there is something I consider a bug in the Lock method. It returns a 2d byte array that represents the surface memory. This array has the same dimensions as the surface. This is nice if you are in 256-color mode. But in 16-, 24- or 32-bit modes where each pixel takes more than one byte this suddenly has the strange consequence that you can only access a part of the image!
    There is a workaround because you can replace that pointer with one of your own.

    The whole thing was awfully slow (with abot 5 fps) but that might have been my (very sloppily programmed) framework. I had to write it myself because the DX app wizard for C# doesn't work.

    Tomorrow I'm going to profile my framework and see where it eats the speed. Probably in the allocation of the surface memory every frame...

    Good job MS
    Last edited by CornedBee; Jan 16th, 2003 at 10:30 AM.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width