Results 1 to 10 of 15

Thread: Csfml.pas

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    So, quick update with everything working... Albeit with a bit of a kludge - if anyone has a way to do this properly please do chime in. What I've done is this:

    Header:
    Code:
    function  bad_sfRenderWindow_pollEvent(renderWindow: PsfRenderWindow; event: PsfEvent): Boolean; cdecl; external CSFML2_LIB_GRAPHICS; external name 'sfRenderWindow_pollEvent'; 
    function sfRenderWindow_pollEvent(renderWindow: PsfRenderWindow; event: PsfEvent): Boolean; Overload;
    And in the implementation section:
    Code:
    function  sfRenderWindow_pollEvent(renderWindow: PsfRenderWindow; event: PsfEvent): Boolean; 
       
    begin 
        sfRenderWindow_pollEvent := bad_sfRenderWindow_pollEvent(renderWindow, event); 
        event^.key.code := SwapEndian(event^.key.code) + 1; 
    end;
    And now the testbed works flawlessly on my system I've bundled it all up so if you're on a 64 bit linux system - see here: https://www.dropbox.com/s/a0x4krmxbd...rdfixed.tar.gz

    Having seen the testbed code - I'm quite tempted to pick this up as an API for some really quick n dirty development (ala ludum dare ) nice work piradyne

    Edit/Disclaimer: for my 'kludge' to work, 32 bit users may have to change from longword to a 32 bit equivalent. And systems with a different endian-ness may need to remove the swapendian call... But hey - I don't have my username for no reason at all
    Last edited by code_glitch; 05-07-2014 at 03:02 PM.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Tags for this Thread

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
  •