My conclusion: DX9 does not support non-2 power-size textures, and the video card has the final say.

Source: Internet
Author: User
My point is based on the following:
If the video card does not support non-2 power textures, then:
1: If idirect3ddevice9: createtexture is used to create a non-2 power-size image
2: If d3dxcreatetexture is used to create a non-2 power image, it will be extended to the power of 2.
3: If d3dxcreatetexturefromfileinmemoryex is used to create a non-2 power image, it will be extended to the power of 2 (even if d3dx_default_nonpow2 is used)

Only one function is special: d3dxcreatetexturefromfileex. using it to create an image can perfectly support a non-2 power image, but this function is rarely used in actual games. Therefore, in general, create a non-2 power texture, or the video card has the final say, I did not find in addition to d3dxcreatetexturefromfileex, d3d will help you do compatible functions.
For 2D games, extending the texture to the power of 2 is a fatal blow, especially for people who use commercial resources to play games.
It is no wonder that the authors of Windows game programming masters also think that it is very troublesome to use d3d for 2D.
I think it should be the same to my friends who have used d3d for 2D games.

High finger missing.
Mark, why is d3dxcreatetexturefromfileex seldom used in the game? Is there a problem with this function?

Reference the reply from my8197933 on the second floor:

Why is d3dxcreatetexturefromfileex rarely used in actual games? Is there a problem with this function?

No one in professional games does not handle resource packets. Oh! Understand ~~~~~~ D3dxcreatetexturefromfileex will be different from DX

Generally, it uses device: createtexture to process = besides d3d, OpenGL is more troublesome and only supports three types of textures. (I don't know anything, please advise) In my opinion, DX9 is to directly convert the memory into a video card, or 3D, that is to say, unlike ddraw, he can define the surface size freely. Instead, the memory directly forces the storage with the power of 2 to unify the gameDevelopment3D, in fact, this is also a good understanding, after all, dx8 will be all for 3D services, and 3D games rely on graphics card.

The following are the test cases in my notebook (non-2 power images are not supported:
Create a comparison of 100 32-bit 600x600 TGA images (total volume: 137 MB:

1: [DX9] d3dxcreatetexturefromfileinmemoryex ()
Memory usage: 550 MB

2: [DX9] d3dxcreatetexture ()
Memory usage: 556 MB

3: [DX9] d3dxcreatetexturefromfileex ()
Memory usage: 149 MB

4: [ddraw] idirectdrawsurface7: createsurface ()
Memory usage: 145 m 5: [DX9] idirect3ddevice9: createtexture ()
Creation failed. You must manually adjust the parameter to the power of 2.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.