Hi, yea SFML is cool. Its was certainly easier to compile the C/C++ sources vs the others I've tried. It coded/structured in a style similar to my own which makes it also easier for me to work with and way easier to import and use in my project. I am working on the examples, but having a bit of a problem with the event structure:
Code:
typedef union
{
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
sfEventType type; ///< Type of the event
sfSizeEvent size;
sfKeyEvent key;
sfTextEvent text;
sfMouseMoveEvent mouseMove;
sfMouseButtonEvent mouseButton;
sfMouseWheelEvent mouseWheel;
sfJoystickMoveEvent joystickMove;
sfJoystickButtonEvent joystickButton;
sfJoystickConnectEvent joystickConnect;
} sfEvent;
Here is the delphi version of this that I have:
Code:
{ TsfEvent }
TsfEvent = record
case Integer of
0: (cType : TsfEventType);
1: (size : TsfSizeEvent);
2: (key : TsfKeyEvent);
3: (text : TsfTextEvent);
4: (mouseMove : TsfMouseMoveEvent);
5: (mouseButton : TsfMouseButtonEvent);
6: (mouseWheel : TsfMouseWheelEvent);
7: (joystickMove : TsfJoystickMoveEvent);
8: (joystickButton : TsfJoystickButtonEvent);
9: (joystickConnect: TsfJoystickConnectEvent);
end;
ctype, and size are returning values, but for some reason key is not. I've checked and rechecked the structure, alignment, etc. Not sure what the problems is at the moment. key.code is always zero but the sfEvtKeyPressed event is returned, just not the key code value. Is there anything wrong with this structure?
Bookmarks