Results 1 to 3 of 3

Thread: Colors in DirectX7

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    2

    Post

    Hello,

    I Have a great little game I have been tinkering with for a few years now. the
    graphics in it though. run by VB and a little API have a tendancy to be rather slow
    with occasional flickers when working with the background and transparency.

    About 3 days ago I learned Dx7 offered VB support, got a copy of it and have
    been saturating myself in it. To date I have had increadable results. I have
    managed to redo my graphics engine so that Dx7 handles it completely and it
    works well at about 180 fps Except one problem I cant seem to find an answer
    too.

    I am using Bitmaps save in 24bits, I am quite certain my screen mode is set to
    16bits and the images apear to convert into 8bit!

    'Screen settings
    Call ddraw.SetCooperativeLevel(Me.hWnd, DDSCL_FULLSCREEN Or
    DDSCL_ALLOWMODEX Or DDSCL_EXCLUSIVE)
    ddraw.SetDisplayMode 1024, 768, 16, 0, DDSDM_DEFAULT

    'Primary Surface
    dPrim.lFlags = DDSD_CAPS
    dPrim.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
    Set primary = ddraw.CreateSurface(dPrim)

    'Clipper
    Set ddClipper = ddraw.CreateClipper(0)
    ddClipper.SetHWnd Picture1.hWnd
    primary.SetClipper ddClipper

    'backbuffer
    dBack.lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
    dBack.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or
    DDSCAPS_SYSTEMMEMORY
    dBack.lWidth = Picture1.Width
    dBack.lHeight = Picture1.Height
    Set backbuffer = ddraw.CreateSurface(dBack)
    backbuffer.SetFontTransparency True
    backbuffer.SetForeColor vbGreen

    'Example of where Im storeing images
    Dim key As DDCOLORKEY
    key.low = 0
    key.high = 0
    dGround(xx).lFlags = DDSD_CAPS
    dGround(xx).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN
    Set Ground(xx) = ddraw.CreateSurfaceFromFile(App.Path + "\data\Floors\" +
    floorfiles(xx) + ".bmp", dGround(xx))
    Ground(xx).SetColorKey DDCKEY_SRCBLT, key

    I belive I understand all the code here fully I just dont know what I missing...
    Perhaps, If there is a simple solution Im missing, you could offer me a bit of
    assistance.

    Thank you,
    LostShade


  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    2

    Post

    Ever feal like an idiot?

    After massive testing and experimenting... I found an answer... for anyone who would care not to make the same mistake here is what I did...

    I drew my images with my screen settings on 32bit true color. I saved as a 24bit BMP... so it DOES load a 16 bit image from it. just far from the 24-32bit image I thought I created...<smacks forhead> Somehow I just selected all the wrong colors

    anyhow anyone drawing some art I might suggest changing your screen settings to match the final programs results... saves a bit of frustration

    Dope~~~ <cringe>
    LostShade

  3. #3
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    lol
    the code looks fine though

    ------------------
    cintel rules
    www.cintelsoftware.co.uk

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