Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Modifying a DXimagelist bitmap

  1. #11

    Modifying a DXimagelist bitmap

    Quote Originally Posted by Traveler
    No it is not possible, you can only create new surfaces during or after the onInitialize event.
    Thanks for your help, but can you help me with a new problem?

    When I change from windowed mode to fullscreen (during the game) or use ALT-TAB to switch applications, the surface seems to disappear completely.

    What's the correct way to handle that?

    TIA!

  2. #12

    Modifying a DXimagelist bitmap

    Alt tabbing has always been a bit of a pain in DelphiX. It is not impossible though. In one of the spritedemos (shootinggame iirc) there's samplecode of how to switch to fullscreen and/or return again.
    If I'm not mistaken it stops the timer, does a (re)storewindow call, sets fullscreenproperty and starts the timer again.

    Hope this works for you

  3. #13

    Modifying a DXimagelist bitmap

    This is code I used to deal with it. I don't know if it is well, but it work

    var
    bIniOnStart: Boolean;

    procedure TFmMain.FormCreate(Sender: TObject);
    begin
    bIniOnStart := True;
    end;

    procedure TFmMain.DXTimer1Deactivate(Sender: TObject);
    begin
    bIniOnStart := False;
    end;

    procedure TFmMain.DXTimer1Activate(Sender: TObject);
    begin
    if not bIniOnStart then begin
    DXDraw1.Initialize;
    end;
    end;

  4. #14

    Modifying a DXimagelist bitmap

    Quote Originally Posted by Traveler
    Alt tabbing has always been a bit of a pain in DelphiX. It is not impossible though. In one of the spritedemos (shootinggame iirc) there's samplecode of how to switch to fullscreen and/or return again.
    If I'm not mistaken it stops the timer, does a (re)storewindow call, sets fullscreenproperty and starts the timer again.

    Hope this works for you
    Thanks. I didn't make the problem very clear. I've managed to get the windowed/fullscreen changing okay but the contents of the radar surface (like in your example) seemed to disappear.

    So I had to put a new "radarImg.LoadFromGraphic..." into the dxdraw.onsurfacerestore

    Not sure if that's the correct thing to do but it works!

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •