Re: [PATCH 6/7] d3drm: Implement IDirect3DRMViewport*::Init. (v3)
On 27 June 2016 at 23:54, Aaryaman Vasishta <jem456.vasishta(a)gmail.com> wrote:
static HRESULT WINAPI d3drm_viewport1_Init(IDirect3DRMViewport *iface, IDirect3DRMDevice *device, IDirect3DRMFrame *camera, DWORD x, DWORD y, DWORD width, DWORD height) { - FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u stub!\n", - iface, device, camera, x, y, width, height); + struct d3drm_viewport *viewport = impl_from_IDirect3DRMViewport(iface); + struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(camera); Using impl_from_IDirect3DRMFrame() here is unusual.
+ if (!device || !camera) + return D3DRMERR_BADOBJECT; And note that this only works because of the d3drm_frame structure layout. You'll want to use unsafe_impl_from_IDirect3DRMFrame() if "camera" can be NULL.
participants (1)
-
Henri Verbeet