Results 1 to 6 of 6

Thread: Loading LOTS of sprites into DirectDraw

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    115
    Ok. I have my directX surfaces, I can write my text and draw my circles and so on, but heres what I need to know: HOW DO I LOAD 10000+ BITMAPS INTO DIRECTDRAW, AND BLIT ONE ON COMMAND? I need to simply be able to load LOTS of bitmaps, regardless of size (though they can be arranged in groups of same-size bitmaps, and are all average 50x50x16), and then be able to just blit any one to a directdraw surface whenever I want.

    ANOTHER THING I NEED IS PIXEL GETTING AND SETTING! How can I go through the pixels in my surface and if some of them are a certain color replace them?

    So there you go. I've looked, but NOWHERE do they go beyond simple making a surface. And no, I don't have a good enough connection to d/l the sdk. So there. THANK YOU IF YOU CAN FIND THAT!
    Vuen

  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    you may want to post this in the Games / Graphics programming area.

    The experts on this topic are more likely to look there
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  3. #3
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457

    Cool Yo man

    Ok, I know you weren't nice to the other people, but hey, I'm gonna answer anyway:

    Go to http://www.planet-source-code.com , then look for the Visual Basic section, and make a search on DX Plug. It's an excellent submission with many stuff for game developers, but somehow didn't get many votes

    It doesn't have the Get/SetPixel functions for surfaces. If you ever manage to do that, please e-mail, I've been looking for them for ages!

    Bye,

    -Jotaf98

    [email protected] - ICQ#60784495 - http://jotaf98.cjb.net

  4. #4
    Guest

    Talking

    I haven't used DirectX for quite a while, but I think I remember.
    To set a pixel's color:
    Code:
    ddsMySurface.Lock
    For Y = 1 To MaxY
        For X = 1 To MaxX
            lngCurColor = ddsMySurface.GetLockedPixel(X, Y)
            If lngCurColor = TheColorYouWantToReplace Then
                ddsMySurface.SetLockedPixel X, Y, TheColorYouWantToReplaceWith
            End If
        Next X
    Next Y
    ddsMySurface.Unlock
    [Edited by Sc0rp on 10-03-2000 at 11:33 AM]

  5. #5
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457

    Wink

    Thanks!

    I think I'm gonna make a .bas file with a Blt function that uses translucency in two ways: addition (explosions/special effects that ADD ON TO EACH OTHER) and alpha blending (the translucency you're used to).

    After all, I've done it before with Set/GetPixel (in Planet Source Code, look for Translucency and Light Effects)

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    115
    CRAP I can't beleive I forgot to post in games/graphics prog!

    Oh and THANK YOU FOR THE PIXELSETTING!
    Vuen

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