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

Get RGBA from DDS-file

Last post 29/06/2009 20:56 by legalize. 1 replies.
  • 11/03/2009 7:51

    Get RGBA from DDS-file

    Hello everyone~I am beginner of directX game program.
    I have a question for Directx , i what to get pre-pixel data form DDS-file.
    (like giving X,Y coordinates , then get r,g,b,a ).


    i what write a program to analysis displacement map ,to find where need more weight to subdivision  or less.

    http://sakmor.myweb.hinet.net/temp/SubDnDisplace
    ==============================================================================
    P.S.: sorry for my bad English Razz
  • 29/06/2009 20:56 In reply to

    Re: Get RGBA from DDS-file

    1. Use D3DXLoadSurfaceFromFile to load the DDS file into a surface (an offscreen plain surface in system memory is fine for this)
    2. Lock the surface
    3. Get the pixel data from the locked surface pointer
    4. Unlock the surface

    Locking and accessing surface data directly is covered in Chapter 4. 2D Applications of my book The Direct3D Graphics Pipeline.

Page 1 of 1 (2 items) Previous Next