Re: d3dx9/tests: Add DDS pixel format tests for D3DXGetImageInfoFromFileInMemory.

2012-04-19 Thread Józef Kucia
On Thu, Apr 19, 2012 at 9:22 PM, Stefan Dösinger  wrote:
> Am Donnerstag, 19. April 2012, 20:23:36 schrieb Matteo Bruni:
>> I'm not sure that's a good idea. ddraw.h is not included in recent
>> DirectX SDKs and the relevant definitions are "gone", as far as I
>> know. So I think d3dx9 or its tests should not depend on that header.
> Furthermore the ddraw.h types do not support volume textures, but d3dx9's .dds
> support does. So one more reason to declare your own structures.
>

Yes, the DDS header has a field named dwDepth in place of dwBackBufferCount.




Re: d3dx9/tests: Add DDS pixel format tests for D3DXGetImageInfoFromFileInMemory.

2012-04-19 Thread Józef Kucia
On Thu, Apr 19, 2012 at 8:23 PM, Matteo Bruni  wrote:
> Il 19 aprile 2012 19:37, Józef Kucia  ha scritto:
>> ---
>>  dlls/d3dx9_36/tests/surface.c |   65 
>> +
>>  1 files changed, 65 insertions(+), 0 deletions(-)
>>
>> diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
>> index 87aa03e..51d6ebd 100644
>> --- a/dlls/d3dx9_36/tests/surface.c
>> +++ b/dlls/d3dx9_36/tests/surface.c
>> @@ -22,6 +22,8 @@
>>  #include "wine/test.h"
>>  #include "d3dx9tex.h"
>>  #include "resources.h"
>> +#undef MAKE_DDHRESULT
>> +#include "ddraw.h"
>>
>
> I'm not sure that's a good idea. ddraw.h is not included in recent
> DirectX SDKs and the relevant definitions are "gone", as far as I
> know. So I think d3dx9 or its tests should not depend on that header.
>
> I'd just (re)declare the stuff you need privately in the test source
> file instead. You don't even need to use the same
> types/defines/variables names as those from ddraw.h, you just have to
> keep them compatible.
>
> On that point, I see that MSDN mentions the equivalent DDS_HEADER and
> DDS_PIXELFORMAT structures
> (http://msdn.microsoft.com/en-us/library/windows/desktop/bb943991%28v=vs.85%29.aspx),
> except those don't seem to be defined in the MS headers either. I
> guess you are free to use whatever names you like...

I also had doubts about including ddraw.h but I was reluctant to
duplicate the code. Thanks.




Re: d3dx9/tests: Add DDS pixel format tests for D3DXGetImageInfoFromFileInMemory.

2012-04-19 Thread Stefan Dösinger
Am Donnerstag, 19. April 2012, 20:23:36 schrieb Matteo Bruni:
> I'm not sure that's a good idea. ddraw.h is not included in recent
> DirectX SDKs and the relevant definitions are "gone", as far as I
> know. So I think d3dx9 or its tests should not depend on that header.
Furthermore the ddraw.h types do not support volume textures, but d3dx9's .dds 
support does. So one more reason to declare your own structures.





Re: d3dx9/tests: Add DDS pixel format tests for D3DXGetImageInfoFromFileInMemory.

2012-04-19 Thread Matteo Bruni
Il 19 aprile 2012 19:37, Józef Kucia  ha scritto:
> ---
>  dlls/d3dx9_36/tests/surface.c |   65 
> +
>  1 files changed, 65 insertions(+), 0 deletions(-)
>
> diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
> index 87aa03e..51d6ebd 100644
> --- a/dlls/d3dx9_36/tests/surface.c
> +++ b/dlls/d3dx9_36/tests/surface.c
> @@ -22,6 +22,8 @@
>  #include "wine/test.h"
>  #include "d3dx9tex.h"
>  #include "resources.h"
> +#undef MAKE_DDHRESULT
> +#include "ddraw.h"
>

I'm not sure that's a good idea. ddraw.h is not included in recent
DirectX SDKs and the relevant definitions are "gone", as far as I
know. So I think d3dx9 or its tests should not depend on that header.

I'd just (re)declare the stuff you need privately in the test source
file instead. You don't even need to use the same
types/defines/variables names as those from ddraw.h, you just have to
keep them compatible.

On that point, I see that MSDN mentions the equivalent DDS_HEADER and
DDS_PIXELFORMAT structures
(http://msdn.microsoft.com/en-us/library/windows/desktop/bb943991%28v=vs.85%29.aspx),
except those don't seem to be defined in the MS headers either. I
guess you are free to use whatever names you like...