Surface Memory access

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Paul Gausden (Gausden_at_discussions.microsoft.com)
Date: 11/24/04

  • Next message: Phil Taylor: "Re: Surface Memory access"
    Date: Wed, 24 Nov 2004 09:41:07 -0800
    
    

    I'm still dabbling with VB6/DX8.1 after many years.

    I recently had a need to create a custom texture file format (for the Auran
    Jet 3D engine) from TGA or 2 BMP files (texture+mask)
    I managed this by loading textures and merging alpha channels etc using the
    LockRect methods on a surface.
    I then used loadsurfacefromsurface to create a mip mapped texture, the
    surfaces then get exported in my file format, again using a D3DLOCKEDRECT
    structure to get at the surface data.

    This works fine for uncompressed formats.

    The problem is working out the size and location of DXT compressed surfaces
    in the texture. The pitch value for the lockedrect structure (back in the
    days of DX6/7) used to reference the size of the whole DXT surface, but now
    it seems to have a much smaller value?

    It's a bit of a long shot as it's an obscure use, but does anyone know
    anything about accessing these surfaces in memory and what the pitch
    represents?
    e.g. for a DXT1 surface, 64x64 pixels, I get a pitch value of 128

    Thanks,

    Paul


  • Next message: Phil Taylor: "Re: Surface Memory access"

    Relevant Pages

    • Re: Surface Memory access
      ... > I then used loadsurfacefromsurface to create a mip mapped texture, ... > surfaces then get exported in my file format, ... The pitch value for the lockedrect structure (back in the ...
      (microsoft.public.vb.directx)
    • Re: Texture Problem
      ... > yes, pitch is always> width. ... the universe would not work properly ... Bare in mind that it is VERY format sensitive, ... > alpha texture from scratch. ...
      (microsoft.public.win32.programmer.directx.graphics)
    • Re: Texture Problem
      ... assuming you're talking about the Driving Directx ... As soon as I change to a 16bit depth buffer it goes away, ... > alpha texture from scratch. ... >> Right width is not pitch, ...
      (microsoft.public.win32.programmer.directx.graphics)
    • Re: Texture Problem
      ... Right width is not pitch, ... Robin ... >> Im having difficulties with a texture, I haven't used them that much so ... >> Then I lock it and fill it with Zeros... ...
      (microsoft.public.win32.programmer.directx.graphics)
    • Re: Texture Problem
      ... at least one of my MSDN articles (one of the alpha series) creates an ... alpha texture from scratch. ... >> pitch, ... >> I am always surprised people dont grep across the samples more. ...
      (microsoft.public.win32.programmer.directx.graphics)