CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    7

    Obtain de size of a IDirect3DSurface (x-y)

    Hello.

    My question is simple. I have an IDirect3DSurface9, and I need to get the size (with & height) in pixels of the surface. I don't see any method that directly get this information...

    How I can get this data?

    Thanks

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Obtain de size of a IDirect3DSurface (x-y)

    Is the surface representing a full screen or view port?
    Gort...Klaatu, Barada Nikto!

  3. #3
    Join Date
    Oct 2005
    Posts
    7

    Re: Obtain de size of a IDirect3DSurface (x-y)

    UPS!!!

    Sorry!... The object that I need to obtain the size is a IDirect3DTexture, not an IDirect3DSurface!

    The fact is that seems that the IDirect3DTEXTURE interface don't have a method to obtain the width & height of the texture... :P

    Thanks for your interest and sorry for the mistake!

  4. #4
    Join Date
    Apr 1999
    Posts
    3,585

    Re: Obtain de size of a IDirect3DSurface (x-y)

    I haven't tried this, but it seems like it should work...

    1. Call D3DXSaveTextureToFileInMemory() to save the texture to memory.
    2. Call D3DXGetImageInfoFromFileInMemory() to get the image dimensions.
    Gort...Klaatu, Barada Nikto!

  5. #5
    Join Date
    Oct 2005
    Posts
    7

    Re: Obtain de size of a IDirect3DSurface (x-y)

    Thanks Mike! I will do it in this manner...

    However, it's strange that this information (width, height) seems not accesible directly from the IDirect3DTexture :P...

    Thanks another time!

    Adri.

  6. #6
    Join Date
    May 2005
    Location
    United States
    Posts
    526

    Re: Obtain de size of a IDirect3DSurface (x-y)

    IDirect3DTexture9::GetLevelDesc() fills out a D3DSURFACE_DESC structure that contains all kinds of information about the specified level of a texture, including its dimensions.

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

Featured