Original Post
🔒 Locked
Interrogating screen size
Advertisement
Hey - I may not be understanding your first question, but can''t you use IDirect3DDevice8::GetViewport? This will fill a viewport structure with, among other things, the width and height of the render target surface.
As for your second question, can''t you call IDirect3DTexture8::GetLevelDesc? This should fill a D3DSURFACE_DESC structure with, among other things, the width and height, of the texture.
All of the above is in the sdk documentation, but maybe I''m misunderstanding your question, and you''re trying to do something more complex.
Good luck.
bmoberly
As for your second question, can''t you call IDirect3DTexture8::GetLevelDesc? This should fill a D3DSURFACE_DESC structure with, among other things, the width and height, of the texture.
All of the above is in the sdk documentation, but maybe I''m misunderstanding your question, and you''re trying to do something more complex.
Good luck.
bmoberly
Thanks for the response.
When I try to use GetViewport with the following code:
I get a status back for "Invalid Call" which the docs says "D3DERR_INVALIDCALL is returned if the pViewport parameter is invalid."
Is there something I need to do to initialize the structure?
When I try to use GetViewport with the following code:
D3DVIEWPORT8 vp;
hr = m_pd3dDevice->GetViewport(&vp)
I get a status back for "Invalid Call" which the docs says "D3DERR_INVALIDCALL is returned if the pViewport parameter is invalid."
Is there something I need to do to initialize the structure?
I don''t think I can use GetSystemMetrics because I''m using a framework that sets up D3d for me based on optimum screen size. So if the desktop size is different from the d3ddevice size, won''t that cause a problem?
I tried to zero it out. Both by setting all the members to 0 and also using ZeroMemory(&vp, sizeof(D3DVIEWPORT8)). There is no size member.
I tried to zero it out. Both by setting all the members to 0 and also using ZeroMemory(&vp, sizeof(D3DVIEWPORT8)). There is no size member.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement