Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: Jedi-SDL & FPC

  1. #21

    Jedi-SDL & FPC

    Well, after hours of trying I finally found out what my mistake was. In fact, the solution has been quite easy, I only had to delete the {$mode objfpc} statement and it compiled without problems

    Meanwhile I also tried out Open Kylix 3, which unfortunaltey crashes whenever I compile a program without errors .

  2. #22

    Getting Lazarus' code insight to work with Jedi-SDL

    I have to make an addition to my previous post, as the removal {$mode objfpc} did not solve all problems. While the program could compile without problems, Lazarus' code insight did not work with serveral types of the Jedi-SDL.

    Code:
    screen_ : PSDL_Surface;
    screen_.format.BitsPerPixel
    Above, you can see a code fragment, where the code completion of Lazarus fails.
    If you would write
    Code:
    screen_.
    and call the code completion, Lazarus would add
    Code:
    screen_.PSDL_Surface;
    The last few days I spent some time searching for the solution, and after the hours I spent with this problem I wished that it would have been a more complex one.

    Types of Jedi-SDL starting with the prefix P (like PSDL_Surface or PSDL_SysWMmsg) are pointer. If you want to access the members of the type the pointer is referencing to, you have to dereference it first. To make the above code work with code insight you have to dereference the pointer:
    Code:
    screen_^.format^.BitsPerPixel;
    This is a problem you will not experience with Delphi, as it automatically dereferences pointer. FreePascal does not allow this unless you use the -Sd switch when compiling. Unfortunatley, Lazarus' code insight does not have a delphi mode (as far as i know) and thus does not accept the delphi syntax but if you dereference the pointer manually everything works fine.


    Michael

  3. #23

    Jedi-SDL & FPC

    Thanks for pointing it out.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 3 of 3 FirstFirst 123

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
  •