Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DirectX + MFC 'auto filter'

This topic is 5508 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well I am working on a level editor, and the DX 8.1 + MFC combination went flawlessly. Now it is a 4 pane window and 1 window is a DX (while the other are tree and two rich text). The problem I am comming into is the game is 2D, so I am using Surfaces and going that method. Now the issue is.. when I resize the window the surface does too.. for example if I init() it with a 300x200 window to begin with, that''s how big the surface is... however I can''t seem to either 1) resize the back buffer on a WM_SIZE or 2) make a larger off-screen buffer and just present a rect from it the size of the window. I also don''t like how it ''blends'' when you resize the window to make it look ''clean''. Anyone have any idea''s?

Share this post

Link to post
Share on other sites
I found this in Direct3D examples and it seems to work for me:

RECT rcClientOld = m_rcWindowClient;

if( m_pd3dDevice != NULL && GetSafeHwnd() != NULL )
GetClientRect( &m_rcWindowClient );
if( rcClientOld.right - rcClientOld.left !=
m_rcWindowClient.right - m_rcWindowClient.left ||
rcClientOld.bottom - rcClientOld.top !=
m_rcWindowClient.bottom - m_rcWindowClient.top)
// If client is too small, don''t try to Reset until it gets bigger
if( m_rcWindowClient.right - m_rcWindowClient.left > 4 &&
m_rcWindowClient.bottom - m_rcWindowClient.top > 4 )
// A new window size will require a new backbuffer
// size, so the 3D structures must be changed accordingly.
Pause( true );
m_d3dpp.BackBufferWidth = m_rcWindowClient.right -
m_d3dpp.BackBufferHeight = m_rcWindowClient.bottom -

// Reset the 3D environment
if( FAILED( Reset3DEnvironment() ) )
Pause( false );

do this when the window resizes

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!