The MASM Forum

General => The Campus => Topic started by: Zen on November 02, 2014, 07:46:50 AM

Title: Indicating Size of Array
Post by: Zen on November 02, 2014, 07:46:50 AM
I'm converting DirectX 11 COM interfaces to MASM compatible structures, and, I'm stumped by what syntax the following ID3D11DeviceContext interface method should be:

;        C-style vtbl definition from Windows Seven SDK   
;         void ( STDMETHODCALLTYPE *OMSetBlendState )(
;             ID3D11DeviceContext * This,
;             /* [annotation] */
;             __in_opt  ID3D11BlendState *pBlendState,
;             /* [annotation] */
;             __in_opt  const FLOAT BlendFactor[ 4 ],   
;             /* [annotation] */
;             __in  UINT SampleMask);


Here is MSDN DirectX 11 documentation: ID3D11DeviceContext::OMSetBlendState method, MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/ff476462(v=vs.85).aspx)

Here's what I have:

      METHOD(OMSetBlendState, _this:PVOID, pBlendState:DWORD, BlendFactor:REAL4, SampleMask:UINT)


The mystery is the third parameter: BlendFactor, which is optional, and an [in] parameter, defined as a array of 4 FLOATS.
What I'd like to indicate, is the size of the array. Would it be, BlendFactor:REAL4[4] ??? (This can't be right,...)
...Or,...would it be: BlendFactor:REAL4[] ??? (This doesn't seem right, either,...)
Title: Re: Indicating Size of Array
Post by: habran on November 02, 2014, 12:56:33 PM
LOCAL BlendFactor[4] :REAL4
Title: Re: Indicating Size of Array
Post by: qWord on November 02, 2014, 07:24:10 PM
Arrays are passed as pointer =>
.., BlendFactor: ptr REAL4,...
Title: Re: Indicating Size of Array
Post by: Zen on November 04, 2014, 06:00:20 AM
QWORD,
Thanks. That's something that I should have known,...but, I thought I'd ask anyway,...