Archived

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

Xorcist

DelphiX Screen Resize Problems

Recommended Posts

Wondering if someone here might be able to lead me in the right direction, as the DelphiX help files haven''t. If I run my application and draw to the TDXDraw component, then resize the screen using standard windows Display settings, I lose not only the current on screen drawing, but also the ability to draw anything further, that is until I re-resize the screen back to it''s original resolution. Then the application continues to run normally. Does anyone know why this happens, and is there a way I can rectify it. Thanks in advance.

Share this post


Link to post
Share on other sites
I don''t really know if this will help or if you''ve tried it but first I would make sure your DXDraw containing form is set to a TDXForm and not a TForm (Theres more, but not much about that in the programming tips in the help file of delphix) and theres something about "Screen mode of TDXDraw is switched" in the programming tips bit of delphix too.


Hope that helps,


chk

Share this post


Link to post
Share on other sites
Yeah I gave that a shot, but it didn''t seem to change anything. That''s kinda what I meant about the help files not helping much. I believe they are actually talking about changing the Display setting for the TDXDraw object, which may or may not relate to changing the actual screen resolution in windows (via Display Properties). I''ve yet to find a sample, tutorial, or shareware delphi game that averts this problem, so it may just be a DelphiX bug. I''m going to look into it further, but if you come across any helpful info, please pass it my way. Thanks.

Xorcist@Mail-Me.com

Share this post


Link to post
Share on other sites
As an end-user, changing the display settings while a windowed DirectDraw application is running is simply asking for trouble. The display format changes, DirectDraw''s surfaces are no longer compatible with the primary surface, calls to the surface method Blt() start failing...

Your application can listen for the WM_DISPLAYCHANGE message. This message is sent by Windows to all windows when the display settings are changed. wParam gives you the bit depth, the low word of lParam gives you the width and the high word of lParam gives you the height.

Steve ''Sly'' Williams  Code Monkey  Krome Studios

Share this post


Link to post
Share on other sites
Okay... so basically it''s more a DirectX issue than a DelphiX issue. At least I know where I should be looking now. Thanks. Quick question though, when I get the WM_DISPLAYCHANGE message, will I be able to use the supplied information to alter the current DirectDraw specifics so the application will continue to run normally?

Share this post


Link to post
Share on other sites