mrvux / FeralTic

Small utilities wrapper for SlimDX / Direct3D11
5 stars 18 forks source link

WriteDataPitch syntax #8

Open elliotwoods opened 11 years ago

elliotwoods commented 11 years ago

on https://github.com/mrvux/FeralTic/blob/master/Core/DX11/Resources/Textures/2d/DX11DynamicTexture2D.cs#L55

you've got:

 public void WriteDataPitch(IntPtr ptr, int len, int rowsize = 4)

just a matter of opinion, but i think the syntax would be better as

 public void WriteDataPitch(IntPtr ptr, int stride, int rows)

where 'stride' is the stride of the input data

rowsize is a little ambiguous, and the input data might have a non 'integer * width' stride, (e.g. 'integer * width + integer').

elliotwoods commented 11 years ago

of course, the biggest issue with this change, is that it's pretty difficult to track down changes since both function names would have the same syntax.

elliotwoods commented 11 years ago

also currently, len isn't used inside the function. is it the length of the input array, length in rows, etc?

mrvux commented 11 years ago

I'll change function names to fix all that, with few other improvements