Results 1 to 10 of 31

Thread: Game Developement

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Method ExtractFilePath does include the TrailingPathDelimiter character so you don't need to add it in your string. This means that instead of

    Code:
    <path name>+'\data\file.bmp'


    you would use

    Code:
    <path name>+'data\file.bmp'


    As for the string type returned it is same string type that is the default string type of your development environment (AnsiString in Delphi 7, Unicode string in Delphi 2009 and newer, not sure for FPC/Lazarus thou).

    As for you being sorry about your lack of knowledge. Don't be. We all have been in your position once but we learned and so will you.
    Just don't be afraid to ask. The main purpose of this community is to help each other.

  2. #2
    Ok, it seems that my brain let me down. I simply can't figure out how to use the instruction. Can you give a concerete example if i need to get the path of file 'graphics.exe'?

  3. #3
    Is graphics.exe the executable of your application?

  4. #4
    Yes, an executable application has been build when i compiled the program, i presume that should be the executable from which i need to extract the path.

  5. #5
    That is correct. Adn you get full finelane (path of your file + filename) of your executable with

    Code:
    Application.ExeName

  6. #6
    My comment was very brief, to show very basic example of profiling.

    I'm not sure that GetTickCount actually gets a value from a hardware tick counter directly. At least in Delphi for Windows it is alias for WinApi function GetTickCount (https://msdn.microsoft.com/en-us/library/aa915056.aspx this is for windows mobile, because the original help is somehow unavailable, but i think its the same of desktop windows), which is stated to return "milliseconds until windows has started". And if you run windows for a while this value will reset, since it is wrapper by max value of DWORD/Cardinal. Well of course it is not very precise, actually it seems it is update by over 16 milliseconds.

    I havent used LclIntf.GetTickCount in Lazarus but I think it will have the same behavior as Winapi.

    if posible I tend to repeat certain procedure multiple times and check how much time is taken for that
    Yes i think this is very effective approach
    Last edited by Anton; 25-03-2015 at 07:06 AM.

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
  •