-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSFML.xs
60 lines (45 loc) · 1.3 KB
/
SFML.xs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Perl Headers
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#ifdef __cplusplus
}
#endif
//Remove name clash:
#undef do_open
#undef do_close
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <vector>
#include <string>
using std::string;
#define ARG_P_BEGIN for(int arg_p_n = 1; arg_p_n < items; arg_p_n++){
#define ARG_P_OPTION(x) if(strcmp(SvPV_nolen(ST(arg_p_n)),(x)) == 0){ arg_p_n++; if(arg_p_n >= items) break;
#define ARG_P (ST(arg_p_n))
#define ARG_P_OPTION_END continue; }
#define ARG_P_END }
#define STACK_DUMP { \
fprintf(stderr, "Items: %i\n", items); \
for(int i = 0; i < items; i ++){ \
fprintf(stderr, "ST(%i):\n", i); \
sv_dump(ST(i)); \
}}
using namespace sf;
typedef Event::SizeEvent SizeEvent;
typedef Event::KeyEvent KeyEvent;
typedef Event::TextEvent TextEvent;
typedef Event::MouseMoveEvent MouseMoveEvent;
typedef Event::MouseButtonEvent MouseButtonEvent;
typedef Event::MouseWheelEvent MouseWheelEvent;
typedef Event::JoystickMoveEvent JoystickMoveEvent;
typedef Event::JoystickButtonEvent JoystickButtonEvent;
typedef Event::JoystickConnectEvent JoystickConnectEvent;
MODULE = SFML PACKAGE = SFML
PROTOTYPES: ENABLE
INCLUDE: xsrc/Window.xs
INCLUDE: xsrc/Graphics.xs