Results 1 to 6 of 6

Thread: DDraw surface creation

  1. #1

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    DDraw surface creation

    I need to have many images cached in memory so I can blt them with high performance. Currently they're held in DCs.

    I have to decode these images manually. So would editing the memory of the surface directly, then having memory-based surfaces as caches, instead of DC's be better?

    I don't see how blting the DC to the surface, then to the primary would be faster.

    Wouldn't I also have to do memory checks to see how much I can store in memory?

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Posts
    192
    It is fastest to let the API decode. I found this out with a recent project that I pasted some CreateDibSection code in. There is a CreateBitmap function that sets up information for bitblt, and it is very fast. I am a 'fan' of manipulating my own data directly, but I wonder how direct it is, or I wonder if the data access allowed by APIs moves image information to a slower section of memory, perhaps in RAM, which is different from video memory. Basically what happened in this one project is that everything was blitting about 112 fps, and then I added CreateDibSection 'so I could have direct access', and the framerate dropped to 35fps average max. It's closer to 15 fps. I have not yet accessed any information. This is working with 32 bit data on a 900mhz system w/ a g-force 2 and a backbuffer of 640 x 480.

  3. #3

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    The image format is custom. There is no API to create it for me.

    It's rather irrelevant at the moent as my function decodes them insanely fast using a decode to DIB then to DC method. The problem is all the blting, with transparency and translucency.

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Posts
    192
    I may have just had an insight. Device-dependent bitmaps. I don't know much about ddbs so 'permit me' to do some research.

  5. #5

    Thread Starter
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    My images are currently in DDBs.

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Posts
    192
    ok. thanks, and sorry I couldn't help ya.

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