Jump to content

  • Log In with Google      Sign In   
  • Create Account


ID3DXLine and LPD3DXFONT garbled in windowed mode fine in Fullscreen


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Dissipate   Members   -  Reputation: 279

Like
0Likes
Like

Posted 20 April 2013 - 11:41 AM

Hi all,

 

My text is displayed all garbled and my lines are all bitty. I think I understand why - I am creating a window 1280x720 with a 1920x1080 resolution and there aren't enough pixels (or whatever). Is there a solution to correctly display the lines and text created with ID3DXLine and LPD3DXFONT respectively?

 

Maybe recreate the objects in windowed mode then recreate again in fullscreen?



Sponsor:

#2 unbird   Crossbones+   -  Reputation: 4830

Like
0Likes
Like

Posted 20 April 2013 - 11:51 AM

Without seeing code or screenshots my guess is a mismatch of your backbuffer and windows client area size, which you (correctly) set at device creation or reset with the presentation parameters. The alternative is to fit your window to the resolution you desire with the help of AdjustWindowRect and SetWindowPos.

#3 Dissipate   Members   -  Reputation: 279

Like
0Likes
Like

Posted 20 April 2013 - 12:17 PM

Thanks for the super speedy reply.

I have squashed my fullscreen image into my windowed form. Which is what I wanted. Heres my code:

if(m_D3DPP.Windowed) 
	return;

RECT ClientRect = {0, 0, WINDOWED_WIDTH, WINDOWED_HEIGHT};
AdjustWindowRect(&ClientRect, WS_OVERLAPPEDWINDOW, false);
m_D3DPP.BackBufferFormat = D3DFMT_UNKNOWN;
m_D3DPP.BackBufferWidth  = FULLSCREEN_WIDTH;
m_D3DPP.BackBufferHeight = FULLSCREEN_HEIGHT;
m_D3DPP.Windowed         = true;
	
SetWindowLongPtr(m_hWindow, GWL_STYLE, WS_OVERLAPPEDWINDOW);

SetWindowPos(m_hWindow, HWND_TOP, 
			100, 100, 
			ClientRect.right, ClientRect.bottom, 
			SWP_NOZORDER | SWP_SHOWWINDOW | SWP_FRAMECHANGED);

Here is a partial shot of the problem:

2013-04-20_190313_zps2ad0b978.png

 

Am I windowing the correct way? It works though. I want to be keep showing the squashed screen in windowed form. Maybe I just have to put up with it? Or I could use my own bitmapped fonts...?



#4 unbird   Crossbones+   -  Reputation: 4830

Like
0Likes
Like

Posted 20 April 2013 - 01:23 PM

Careful: SetWindowPos wants width and height as the 5th and 6th parameter, not the bottom right. Also: I take it WINDOWED_WIDTH/HEIGHT are currently not equal to FULLSCREEN_WIDTH/HEIGHT. But they need to be to avoid the garble. Using a different font rendering won't help.

Why do you want to render at a higher resolution than you can display anyway ? Resolution independance ? Antialiasing ? You can do that, but you need a different approach: E.g. render to a higher texture/render target, and then display that texture with linear downsampling. Sort of super sampling. Or use multi sample anti aliasing, which is supported by D3D9. Not sure if the latter works with these D3DX helper objects, though, probably not.

Edit: Disclaimer: Since I'm not using C++, I might still miss something here (I use C#, WindowsForms and SlimDX).

Edited by unbird, 20 April 2013 - 01:34 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS