Reading the Viewport

Started by
2 comments, last by sdoherty55 22 years, 3 months ago
I am getting strange results (very large numbers) when I try to read the viewport in the ResoreDeviceObjectMethod()? Anyone have any problems with reading the viewport under XP and 8.1?
  
	D3DVIEWPORT8 Viewport;
	pd3dDevice->GetViewport(&Viewport);
	cvIceSpriteVertices[0].y  = (float) Viewport.Height - 1;
	cvIceSpriteVertices[2].y  = (float) Viewport.Height - 1;
	cvIceSpriteVertices[2].x  = (float) Viewport.Width - 1;
	cvIceSpriteVertices[3].x  = (float) Viewport.Width - 1;
  
Thanks
Advertisement
Has anyone had this problem?
With further debuging it seems that I am getting the following error when I call GetViewport:

  Direct3D8: (INFO) :======================= Hal HWVP Pure device selectedDirect3D8: :DoneExclusiveModeDirect3D8: (INFO) :HalDevice Driver Style 7Direct3D8: (ERROR) :GetViewport does not work in pure-device...Error:  Get Viewport failed - Invalidcall  


Does this mean that my driver is not supporting the call to GetViewport. If I switch to REF mode it seems to work. I am running Windows XP and a Radeon VIVO 64 Meg?

Thanks
You shouldn''t set the D3DCREATE_PUREDEVICE flag when you call CreateDevice() if you intend reading anything back.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement