Results 1 to 6 of 6

Thread: Using UndelphiX again.

  1. #1

    Using UndelphiX again.

    Decided to crack open Delphi again and UnDelphiX was always the easiest to use and seems to be the only thing updated recently lol.

    I have a bit of an odd problem, an old game I made with it (recompiled with newer version) works just as it did previously. My new one however, which
    only draws some tiles and text overlay is borked. When it first starts up, my FPS overlay says FPS: 0....... unless I click away from the screen and then
    select it again it will not update, at all. If I move the screen it will black out as well until I click away and back onto it.

    I checked the dxDraw, dxTimer, Main Form properties/settings as well as how I drew things in the timer event in the old game and they appear to be identical.

  2. #2
    Post some code, without it we can't really help you, only make guesses.

  3. #3
    The only code is enable timer on init and draw an image in the
    timer event. Inclusion or lack of begin/end scene or drawing fps
    makes no difference.

  4. #4
    Have you enabled the timer? Do you see any animation on screen if you try?

    edit: Oh you said you did. Need more actual source code or something more to give more hints then.

    Also the way i used DelphiX back then was with DXImagelist1.Items.Find('mytexture').Draw(Surface, X, Y, pattern); (might have forgotten the syntax). So you could say nxpascal is a predecessor to it in a sense. Now i do the same with:
    tex.SetByName('mytexture');
    nx.Draw(X, Y, pattern);

    So if you're looking for something modern, and much faster than DelphiX, you can give it a try
    Last edited by User137; 03-06-2013 at 12:02 PM.

  5. #5
    Are you sure you are using OnTimer event of DXTimer.
    DXTimer component has three different events OnActivate, OnDeactivate, and OnTimer.
    When you doubleclick on component it creates OnActivate even reference and not OnTimer event reference as it is with Delphi default TTimer component.

    That might explain why your game updates only by activating your application

    PS I expirienced such problem a while ago myself
    Last edited by SilverWarior; 03-06-2013 at 01:00 PM.

  6. #6
    Wow SilverWarrior, right on the mark. As soon as I read your reply I thought to myself "I have never done that before, but it has been awhile since I used Delphi....", sure enough it is indeed the timers activate event.

    As far as what I use for drawing I am open to suggestions. I am only using dxDraw, dxImageList and dxTimer components, I intend on using BASS for audio as I have in the past and everything else I program myself. I
    picked up UnDelphiX again because generally speaking I have never had an issue in using it and it has been updated recently, where as with other alternatives seemed overly complex to do something simple like draw an image to the screen or the result
    was undesirable.

    Anything similar with all the drawing features I would definitely try out. (I'm using Delphi XE2). Apparently they are up to XE4 now! :|

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
  •