Mercurial > repos > tabletprog
annotate modules/sdl.tp @ 363:d949fe826e04
Unify il and backend labels
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 25 Apr 2015 20:56:02 -0700 |
parents | 6bbf12c203f7 |
children |
rev | line source |
---|---|
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 _helper <- #{ |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 llMessage: createWindow withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 title <- string ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 x <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 y <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 w <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 h <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 flags <- obj_uint32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 makeWindow <- lambda ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 windowOpaque <- cpointer ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 win <- object ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 } andCode: :title x y w h flags makeWindow { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 windowOpaque <- make_object: (addr_of: cpointer_meta) NULL 0 |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 windowOpaque val!: (SDL_CreateWindow: (title data) (x num) (y num) (w num) (h num) (flags num)) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 if: (windowOpaque val) { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 win <- ccall: makeWindow 1 (windowOpaque castTo: (object ptr)) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 mcall: value 2 option win |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } else: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 mcall: none 1 option |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 } |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
23 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
24 llMessage: createRenderer withVars: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
25 window <- cpointer ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
26 index <- obj_int32 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
27 flags <- obj_uint32 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
28 rendOpaque <- cpointer ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
29 rend <- object ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
30 makeRender <- lambda ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
31 } andCode: :window index flags makeRender { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
32 rendOpaque <- make_object: (addr_of: cpointer_meta) NULL 0 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
33 rendOpaque val!: (SDL_CreateRenderer: (window val) (index num) (flags num)) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
34 if: (rendOpaque val) { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
35 rend <- ccall: makeRender 1 (rendOpaque castTo: (object ptr)) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
36 mcall: value 2 option rend |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
37 } else: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
38 mcall: none 1 option |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
39 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
40 } |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
41 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
42 llMessage: loadBMP withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
43 filename <- string ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
44 makeSurface <- lambda ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
45 surfOpaque <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
46 surf <- object ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
47 } andCode: :filename makeSurface{ |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
48 surfOpaque <- make_object: (addr_of: cpointer_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
49 surfOpaque val!: (SDL_LoadBMP: (filename data)) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
50 if: (surfOpaque val) { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
51 surf <- ccall: makeSurface 1 (surfOpaque castTo: (object ptr)) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
52 mcall: value 2 option surf |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
53 } else: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
54 mcall: none 1 option |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
55 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
56 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
57 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
58 llMessage: createTextureFromSurface withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
59 rendOpaque <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
60 surfOpaque <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
61 makeTexture <- lambda ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
62 texOpaque <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
63 tex <- object ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
64 } andCode: :rendOpaque surfOpaque makeTexture { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
65 texOpaque <- make_object: (addr_of: cpointer_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
66 texOpaque val!: (SDL_CreateTextureFromSurface: (rendOpaque val) (surfOpaque val)) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
67 if: (texOpaque val) { |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
68 tex <- ccall: makeTexture 2 (rendOpaque castTo: (object ptr)) (texOpaque castTo: (object ptr)) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
69 mcall: value 2 option tex |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
70 } else: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
71 mcall: none 1 option |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
72 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
73 } |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
74 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
75 llMessage: createTexture withVars: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
76 rendOpaque <- cpointer ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
77 format <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
78 formatn <- obj_uint32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
79 access <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
80 accessn <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
81 w <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
82 wn <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
83 h <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
84 hn <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
85 makeTexture <- lambda ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
86 texOpaque <- cpointer ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
87 tex <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
88 } andCode: :rendOpaque format access w h makeTexture { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
89 formatn <- (mcall: uint32 1 format) castTo: (obj_uint32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
90 accessn <- (mcall: int32 1 access) castTo: (obj_int32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
91 wn <- (mcall: int32 1 w) castTo: (obj_int32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
92 hn <- (mcall: int32 1 h) castTo: (obj_int32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
93 texOpaque <- make_object: (addr_of: cpointer_meta) NULL 0 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
94 texOpaque val!: (SDL_CreateTexture: (rendOpaque val) (formatn num) (accessn num) (wn num) (hn num)) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
95 if: (texOpaque val) { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
96 tex <- ccall: makeTexture 2 (rendOpaque castTo: (object ptr)) (texOpaque castTo: (object ptr)) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
97 mcall: value 2 option tex |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
98 } else: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
99 mcall: none 1 option |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
100 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
101 } |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
102 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
103 llMessage: pollEvent withVars: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
104 constructor <- lambda ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
105 event <- SDL_Event |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
106 eventPtr <- cpointer ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
107 eventType <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
108 timeStampO <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
109 } andCode: :constructor { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
110 if: (SDL_PollEvent: (addr_of: event)) { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
111 eventType <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
112 timeStampO <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
113 eventType num!: ((addr_of: event) type) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
114 timeStampO num!: ((addr_of: ((addr_of: event) common)) timestamp) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
115 eventPtr <- make_object: (addr_of: cpointer_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
116 eventPtr val!: (addr_of: event) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
117 mcall: value 2 option (ccall: constructor 3 (eventType castTo: (object ptr)) ( |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
118 timeStampO castTo: (object ptr)) (eventPtr castTo: (object ptr))) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
119 } else: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
120 mcall: none 1 option |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
121 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
122 } |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
123 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
124 llMessage: waitEvent withVars: { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
125 constructor <- lambda ptr |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
126 event <- SDL_Event |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
127 eventPtr <- cpointer ptr |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
128 eventType <- obj_uint32 ptr |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
129 timeStampO <- obj_uint32 ptr |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
130 } andCode: :constructor { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
131 if: (SDL_WaitEvent: (addr_of: event)) { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
132 eventType <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
133 timeStampO <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
134 eventType num!: ((addr_of: event) type) |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
135 timeStampO num!: ((addr_of: ((addr_of: event) common)) timestamp) |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
136 eventPtr <- make_object: (addr_of: cpointer_meta) NULL 0 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
137 eventPtr val!: (addr_of: event) |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
138 mcall: value 2 option (ccall: constructor 3 (eventType castTo: (object ptr)) ( |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
139 timeStampO castTo: (object ptr)) (eventPtr castTo: (object ptr))) |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
140 } else: { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
141 mcall: none 1 option |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
142 } |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
143 } |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
144 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
145 llMessage: populateWindowEvent withVars: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
146 eventPtr <- cpointer ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
147 empty <- object ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
148 winEvent <- SDL_WindowEvent ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
149 ou32 <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
150 oi32 <- obj_int32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
151 } andCode: :eventPtr empty { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
152 winEvent <- eventPtr val |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
153 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
154 ou32 num!: (winEvent windowID) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
155 mcall: windowID! 2 empty ou32 |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
156 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
157 ou32 num!: (winEvent event) |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
158 mcall: event! 2 empty ou32 |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
159 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
160 oi32 num!: (winEvent data1) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
161 mcall: data1! 2 empty oi32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
162 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
163 oi32 num!: (winEvent data2) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
164 mcall: data2! 2 empty oi32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
165 empty |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
166 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
167 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
168 llMessage: populateKeyEvent withVars: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
169 eventPtr <- cpointer ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
170 empty <- object ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
171 keyEvent <- SDL_KeyboardEvent ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
172 ou32 <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
173 ou16 <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
174 ou8 <- obj_uint8 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
175 } andCode: :eventPtr empty { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
176 keyEvent <- eventPtr val |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
177 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
178 ou32 num!: (keyEvent windowID) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
179 mcall: windowID! 2 empty ou32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
180 if: (keyEvent state) = SDL_PRESSED { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
181 mcall: pressed?! 2 empty true |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
182 } else: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
183 mcall: pressed?! 2 empty false |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
184 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
185 ou8 <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
186 ou8 num!: (keyEvent repeat) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
187 mcall: repeat! 2 empty ou8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
188 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
189 ou32 num!: ((addr_of: (keyEvent keysym)) scancode) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
190 mcall: scanCode! 2 empty ou32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
191 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
192 ou32 num!: ((addr_of: (keyEvent keysym)) sym) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
193 mcall: keyCode! 2 empty ou32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
194 ou16 <- make_object: (addr_of: obj_uint16_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
195 ou16 num!: ((addr_of: (keyEvent keysym)) mod) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
196 mcall: mod! 2 empty ou16 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
197 empty |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
198 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
199 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
200 llMessage: populateMouseButtonEvent withVars: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
201 eventPtr <- cpointer ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
202 empty <- object ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
203 mouseButEvent <- SDL_MouseButtonEvent ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
204 ou32 <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
205 ou8 <- obj_uint8 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
206 oi32 <- obj_int32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
207 } andCode: :eventPtr empty { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
208 mouseButEvent <- eventPtr val |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
209 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
210 ou32 num!: (mouseButEvent windowID) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
211 mcall: windowID! 2 empty ou32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
212 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
213 ou32 num!: (mouseButEvent which) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
214 mcall: mouseID! 2 empty ou32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
215 ou8 <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
216 ou8 num!: (mouseButEvent button) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
217 mcall: button! 2 empty ou8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
218 if: (mouseButEvent state) = SDL_PRESSED { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
219 mcall: pressed?! 2 empty true |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
220 } else: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
221 mcall: pressed?! 2 empty false |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
222 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
223 ou8 <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
224 ou8 num!: (mouseButEvent clicks) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
225 mcall: clicks! 2 empty ou8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
226 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
227 oi32 num!: (mouseButEvent x) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
228 mcall: x! 2 empty oi32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
229 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
230 oi32 num!: (mouseButEvent y) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
231 mcall: y! 2 empty oi32 |
293
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
232 empty |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
233 } |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
234 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
235 llMessage: populateMouseMotionEvent withVars: { |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
236 eventPtr <- cpointer ptr |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
237 empty <- object ptr |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
238 mouseMotEvent <- SDL_MouseMotionEvent ptr |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
239 ou32 <- obj_uint32 ptr |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
240 oi32 <- obj_int32 ptr |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
241 } andCode: :eventPtr empty { |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
242 mouseMotEvent <- eventPtr val |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
243 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
244 ou32 num!: (mouseMotEvent windowID) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
245 mcall: windowID! 2 empty ou32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
246 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
247 ou32 num!: (mouseMotEvent which) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
248 mcall: mouseID! 2 empty ou32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
249 ou32 <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
250 ou32 num!: (mouseMotEvent state) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
251 mcall: buttonState! 2 empty ou32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
252 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
253 oi32 num!: (mouseMotEvent x) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
254 mcall: x! 2 empty oi32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
255 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
256 oi32 num!: (mouseMotEvent y) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
257 mcall: y! 2 empty oi32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
258 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
259 oi32 num!: (mouseMotEvent xrel) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
260 mcall: xRel! 2 empty oi32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
261 oi32 <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
262 oi32 num!: (mouseMotEvent yrel) |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
263 mcall: yRel! 2 empty oi32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
264 empty |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
265 } |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
266 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
267 |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
268 _constant <- macro: :name cname { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
269 quote: (llMessage: name withVars: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
270 uintret <- obj_uint32 ptr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
271 } andCode: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
272 uintret <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
273 uintret num!: cname |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
274 uintret |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
275 }) |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
276 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
277 _subsystems <- #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
278 _constant: timer SDL_INIT_TIMER |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
279 _constant: audio SDL_INIT_AUDIO |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
280 _constant: video SDL_INIT_VIDEO |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
281 _constant: joystick SDL_INIT_JOYSTICK |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
282 _constant: haptic SDL_INIT_HAPTIC |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
283 _constant: gameController SDL_INIT_GAMECONTROLLER |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
284 _constant: events SDL_INIT_EVENTS |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
285 _constant: everything SDL_INIT_EVERYTHING |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
286 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
287 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
288 _windowOpts <- #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
289 _constant: fullscreen SDL_WINDOW_FULLSCREEN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
290 _constant: fullscreenDesktop SDL_WINDOW_FULLSCREEN_DESKTOP |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
291 _constant: opengl SDL_WINDOW_OPENGL |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
292 _constant: hidden SDL_WINDOW_HIDDEN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
293 _constant: borderless SDL_WINDOW_BORDERLESS |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
294 _constant: minimized SDL_WINDOW_MINIMIZED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
295 _constant: maximized SDL_WINDOW_MAXIMIZED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
296 _constant: inputGrabbed SDL_WINDOW_INPUT_GRABBED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
297 _constant: allowHighDPI SDL_WINDOW_ALLOW_HIGHDPI |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
298 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
299 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
300 _renderOpts <- #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
301 _constant: software SDL_RENDERER_SOFTWARE |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
302 _constant: accelerated SDL_RENDERER_ACCELERATED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
303 _constant: presentVSYNC SDL_RENDERER_PRESENTVSYNC |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
304 _constant: targetTexture SDL_RENDERER_TARGETTEXTURE |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
305 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
306 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
307 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
308 _events <- #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
309 _constant: quit SDL_QUIT |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
310 _constant: window SDL_WINDOWEVENT |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
311 _constant: sysWM SDL_SYSWMEVENT |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
312 _constant: keyDown SDL_KEYDOWN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
313 _constant: keyUp SDL_KEYUP |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
314 _constant: textEditing SDL_TEXTEDITING |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
315 _constant: textInput SDL_TEXTINPUT |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
316 _constant: mouseMotion SDL_MOUSEMOTION |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
317 _constant: mouseDown SDL_MOUSEBUTTONDOWN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
318 _constant: mouseUp SDL_MOUSEBUTTONUP |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
319 _constant: mouseWheel SDL_MOUSEWHEEL |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
320 _constant: joyAxis SDL_JOYAXISMOTION |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
321 _constant: joyBall SDL_JOYBALLMOTION |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
322 _constant: joyHat SDL_JOYHATMOTION |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
323 _constant: joyDown SDL_JOYBUTTONDOWN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
324 _constant: joyUp SDL_JOYBUTTONUP |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
325 _constant: joyDeviceAdded SDL_JOYDEVICEADDED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
326 _constant: joyDeviceRemoved SDL_JOYDEVICEREMOVED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
327 _constant: controllerAxis SDL_CONTROLLERAXISMOTION |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
328 _constant: controllerDown SDL_CONTROLLERBUTTONDOWN |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
329 _constant: controllerUp SDL_CONTROLLERBUTTONUP |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
330 _constant: controllerDeviceAdded SDL_CONTROLLERDEVICEADDED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
331 _constant: controllerDeviceRemoved SDL_CONTROLLERDEVICEREMOVED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
332 _constant: controllerDeviceRemapped SDL_CONTROLLERDEVICEREMAPPED |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
333 _constant: dropFile SDL_DROPFILE |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
334 //TODO: Add mobile/touch/gesture events |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
335 } |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
336 |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
337 _windowEvents <- #{ |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
338 _constant: shown SDL_WINDOWEVENT_SHOWN |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
339 _constant: hidden SDL_WINDOWEVENT_HIDDEN |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
340 _constant: exposed SDL_WINDOWEVENT_EXPOSED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
341 _constant: moved SDL_WINDOWEVENT_MOVED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
342 _constant: resized SDL_WINDOWEVENT_RESIZED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
343 _constant: sizeChanged SDL_WINDOWEVENT_SIZE_CHANGED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
344 _constant: minimized SDL_WINDOWEVENT_MINIMIZED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
345 _constant: maximized SDL_WINDOWEVENT_MAXIMIZED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
346 _constant: restored SDL_WINDOWEVENT_RESTORED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
347 _constant: enter SDL_WINDOWEVENT_ENTER |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
348 _constant: leave SDL_WINDOWEVENT_LEAVE |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
349 _constant: focusGained SDL_WINDOWEVENT_FOCUS_GAINED |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
350 _constant: focusLost SDL_WINDOWEVENT_FOCUS_LOST |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
351 _constant: close SDL_WINDOWEVENT_CLOSE |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
352 } |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
353 |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
354 _textureAccess <- #{ |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
355 _constant: static SDL_TEXTUREACCESS_STATIC |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
356 _constant: streaming SDL_TEXTUREACCESS_STREAMING |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
357 _constant: target SDL_TEXTUREACCESS_TARGET |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
358 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
359 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
360 _pixelFormats <- #{ |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
361 _constant: unknown SDL_PIXELFORMAT_UNKNOWN |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
362 _constant: index1LSB SDL_PIXELFORMAT_INDEX1LSB |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
363 _constant: index1MSB SDL_PIXELFORMAT_INDEX1MSB |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
364 _constant: index4LSB SDL_PIXELFORMAT_INDEX4LSB |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
365 _constant: index4MSB SDL_PIXELFORMAT_INDEX4MSB |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
366 _constant: index8 SDL_PIXELFORMAT_INDEX8 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
367 _constant: rgb332 SDL_PIXELFORMAT_RGB332 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
368 _constant: rgb444 SDL_PIXELFORMAT_RGB444 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
369 _constant: rgb555 SDL_PIXELFORMAT_RGB555 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
370 _constant: bgr555 SDL_PIXELFORMAT_BGR555 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
371 _constant: argb4444 SDL_PIXELFORMAT_ARGB4444 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
372 _constant: bgra4444 SDL_PIXELFORMAT_BGRA4444 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
373 _constant: argb1555 SDL_PIXELFORMAT_ARGB1555 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
374 _constant: rgba5551 SDL_PIXELFORMAT_RGBA5551 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
375 _constant: abgr1555 SDL_PIXELFORMAT_ABGR1555 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
376 _constant: bgra5551 SDL_PIXELFORMAT_BGRA5551 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
377 _constant: rgb565 SDL_PIXELFORMAT_RGB565 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
378 _constant: bgr565 SDL_PIXELFORMAT_BGR565 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
379 _constant: rgb24 SDL_PIXELFORMAT_RGB24 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
380 _constant: bgr24 SDL_PIXELFORMAT_BGR24 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
381 _constant: rgb888 SDL_PIXELFORMAT_RGB888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
382 _constant: rgbx8888 SDL_PIXELFORMAT_RGBX8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
383 _constant: bgr888 SDL_PIXELFORMAT_BGR888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
384 _constant: bgrx8888 SDL_PIXELFORMAT_BGRX8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
385 _constant: argb8888 SDL_PIXELFORMAT_ARGB8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
386 _constant: rgba8888 SDL_PIXELFORMAT_RGBA8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
387 _constant: abgr8888 SDL_PIXELFORMAT_ABGR8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
388 _constant: bgra8888 SDL_PIXELFORMAT_BGRA8888 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
389 _constant: argb2101010 SDL_PIXELFORMAT_ARGB2101010 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
390 _constant: yv12 SDL_PIXELFORMAT_YV12 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
391 _constant: iyuv SDL_PIXELFORMAT_IYUV |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
392 _constant: yuy2 SDL_PIXELFORMAT_YUY2 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
393 _constant: uyvy SDL_PIXELFORMAT_UYVY |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
394 _constant: yvyu SDL_PIXELFORMAT_YVYU |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
395 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
396 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
397 _blendModes <- #{ |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
398 _constant: none SDL_BLENDMODE_NONE |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
399 _constant: blend SDL_BLENDMODE_BLEND |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
400 _constant: add SDL_BLENDMODE_ADD |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
401 _constant: mod SDL_BLENDMODE_MOD |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
402 } |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
403 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
404 _eventConstructors <- dict hash |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
405 _eventConstructors set: (_events window) :typ tstamp eventPtr { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
406 _helper populateWindowEvent: eventPtr #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
407 type <- typ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
408 timeStamp <- tstamp |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
409 windowID <- 0u32 |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
410 event <- 0u32 |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
411 data1 <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
412 data2 <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
413 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
414 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
415 keyEvent <- :typ tstamp eventPtr { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
416 _helper populateKeyEvent: eventPtr #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
417 type <- typ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
418 timeStamp <- tstamp |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
419 windowID <- 0u32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
420 pressed? <- false |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
421 repeat <- 0u8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
422 scanCode <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
423 keyCode <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
424 mod <- 0u16 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
425 _constant: scanCodeMask SDLK_SCANCODE_MASK |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
426 keyChar <- { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
427 if: (keyCode and (self scanCodeMask)) = 0 { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
428 keyCode utf8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
429 } else: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
430 "" |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
431 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
432 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
433 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
434 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
435 _eventConstructors set: (_events keyDown) keyEvent |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
436 _eventConstructors set: (_events keyUp) keyEvent |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
437 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
438 mouseButtonEvent <- :typ tstamp eventPtr { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
439 _helper populateMouseButtonEvent: eventPtr #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
440 type <- typ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
441 timeStamp <- tstamp |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
442 windowID <- 0u32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
443 mouseID <- 0u32 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
444 button <- 0u8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
445 pressed? <- false |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
446 clicks <- 0u8 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
447 x <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
448 y <- 0 |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
449 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
450 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
451 _eventConstructors set: (_events mouseDown) mouseButtonEvent |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
452 _eventConstructors set: (_events mouseUp) mouseButtonEvent |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
453 |
293
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
454 _eventConstructors set: (_events mouseMotion) :typ tstamp eventPtr { |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
455 _helper populateMouseMotionEvent: eventPtr #{ |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
456 type <- typ |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
457 timeStamp <- tstamp |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
458 windowID <- 0u32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
459 mouseID <- 0u32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
460 buttonState <- 0u32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
461 x <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
462 y <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
463 xRel <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
464 yRel <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
465 } |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
466 } |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
467 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
468 /* |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
469 _eventConstructors set: (_events mouseWheel) :type tstamp eventPtr { |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
470 _helper populateMouseWheelEvent: eventPtr #{ |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
471 type <- typ |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
472 timeStamp <- tstamp |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
473 windowID <- 0u32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
474 mouseID <- 0u32 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
475 x <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
476 y <- 0 |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
477 } |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
478 } |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
479 */ |
2b045d5b673b
Add binding for sdl mouse motion event
Michael Pavone <pavone@retrodev.com>
parents:
291
diff
changeset
|
480 |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
481 _makeTexture <- :rendptr texptr { |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
482 #{ |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
483 includeSystemHeader: "SDL.h" |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
484 llProperty: renderer withType: (SDL_Renderer ptr) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
485 llProperty: texture withType: (SDL_Texture ptr) |
334
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
486 llProperty: _width withType: int32_t |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
487 llProperty: _height withType: int32_t |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
488 llProperty: _format withType: uint32_t |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
489 llProperty: _access withType: int32_t |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
490 llMessage: opaque withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
491 ptr <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
492 } andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
493 ptr <- make_object: (addr_of: cpointer_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
494 ptr val!: texture |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
495 ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
496 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
497 llMessage: _ptr_init withVars: { |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
498 rendptr <- cpointer ptr |
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
499 texptr <- cpointer ptr |
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
500 } andCode: :rendptr texptr{ |
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
501 renderer <- rendptr val |
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
502 texture <- texptr val |
334
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
503 SDL_QueryTexture: texture (addr_of: _format) (addr_of: _access) (addr_of: _width) (addr_of: _height) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
504 self |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
505 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
506 |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
507 llMessage: copy withVars: { |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
508 intret <- obj_int32 ptr |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
509 } andCode: { |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
510 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
511 intret num!: (SDL_RenderCopy: renderer texture NULL NULL) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
512 intret |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
513 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
514 |
283
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
515 llMessage: copyTo withVars: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
516 dst <- object ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
517 dstOpaque <- cpointer ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
518 intret <- obj_int32 ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
519 } andCode: :dst { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
520 dstOpaque <- (mcall: _rectPointer 1 dst) castTo: (cpointer ptr) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
521 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
522 intret num!: (SDL_RenderCopy: renderer texture NULL (dstOpaque val)) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
523 intret |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
524 } |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
525 |
284
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
526 llMessage: copyRect:To withVars: { |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
527 src <- object ptr |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
528 dst <- object ptr |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
529 srcOpaque <- cpointer ptr |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
530 dstOpaque <- cpointer ptr |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
531 intret <- obj_int32 ptr |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
532 } andCode: :src :dst { |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
533 srcOpaque <- (mcall: _rectPointer 1 src) castTo: (cpointer ptr) |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
534 dstOpaque <- (mcall: _rectPointer 1 dst) castTo: (cpointer ptr) |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
535 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
536 intret num!: (SDL_RenderCopy: renderer texture (srcOpaque val) (dstOpaque val)) |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
537 intret |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
538 } |
99c18127da04
Add another SDL_RenderCopy binding in the form of copyRect:To
Michael Pavone <pavone@retrodev.com>
parents:
283
diff
changeset
|
539 |
287
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
540 llMessage: copyTo:rotated withVars: { |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
541 dst <- object ptr |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
542 angle <- object ptr |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
543 dstOpaque <- cpointer ptr |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
544 anglef <- obj_float32 ptr |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
545 intret <- obj_int32 ptr |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
546 } andCode: :dst :angle { |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
547 anglef <- (mcall: f32 1 angle) castTo: (obj_float32 ptr) |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
548 dstOpaque <- (mcall: _rectPointer 1 dst) castTo: (cpointer ptr) |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
549 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
550 intret num!: (SDL_RenderCopyEx: renderer texture NULL (dstOpaque val) (anglef num) NULL SDL_FLIP_NONE) |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
551 intret |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
552 } |
b01d7c1b4edd
Add binding for simple form of SDL_RenderCopyEx
Michael Pavone <pavone@retrodev.com>
parents:
285
diff
changeset
|
553 |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
554 llMessage: lockRect:with withVars: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
555 fun <- lambda ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
556 rectOpaque <- cpointer ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
557 pitch <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
558 bufsize <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
559 height <- obj_int32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
560 pixels <- cpointer ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
561 bytearr <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
562 rect <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
563 result <- int32_t |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
564 ret <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
565 } andCode: :rect fun { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
566 rectOpaque <- (mcall: _rectPointer 1 rect) castTo: (cpointer ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
567 pitch <- make_object: (addr_of: obj_int32_meta) NULL 0 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
568 pixels <- make_object: (addr_of: cpointer_meta) NULL 0 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
569 //TODO: Check return value |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
570 result <- SDL_LockTexture: texture (rectOpaque val) (addr_of: (pixels val)) (addr_of: (pitch num)) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
571 if: result = 0 { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
572 height <- (mcall: h 1 rect) castTo: (obj_int32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
573 bufsize <- make_object: (addr_of: obj_int32_meta) NULL 0 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
574 bufsize num!: (pitch num) * (height num) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
575 bytearr <- mcall: fromOpaque:withSize 3 bytearray pixels bufsize |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
576 ret <- ccall: fun 2 bytearr pitch |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
577 SDL_UnlockTexture: texture |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
578 //TODO: Return value? |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
579 } else: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
580 ret <- false |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
581 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
582 ret |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
583 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
584 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
585 llMessage: blendMode! withVars: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
586 omode <- object ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
587 mode <- obj_uint32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
588 } andCode: :omode { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
589 mode <- (mcall: uint32 1 omode) castTo: (obj_uint32 ptr) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
590 SDL_SetTextureBlendMode: texture (mode num) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
591 self |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
592 } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
593 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
594 llMessage: blendMode withVars: { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
595 mode <- obj_uint32 ptr |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
596 } andCode: { |
333
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
597 mode <- make_object: (addr_of: obj_uint32_meta) NULL 0 |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
598 SDL_GetTextureBlendMode: texture (addr_of: (mode num)) |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
599 mode |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
600 } |
333
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
601 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
602 llMessage: colorMod! withVars: { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
603 color <- object ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
604 tmp <- object ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
605 r <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
606 g <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
607 b <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
608 intret <- obj_int32 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
609 } andCode: :color { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
610 tmp <- mcall: r 1 color |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
611 r <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
612 tmp <- mcall: g 1 color |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
613 g <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
614 tmp <- mcall: b 1 color |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
615 b <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
616 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
617 intret num!: (SDL_SetTextureColorMod: texture (r num) (g num) (b num)) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
618 intret |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
619 } |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
620 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
621 llMessage: colorMod withVars: { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
622 color <- object ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
623 r <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
624 g <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
625 b <- obj_uint8 ptr |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
626 rescode <- int32_t |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
627 } andCode: { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
628 r <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
629 g <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
630 b <- make_object: (addr_of: obj_uint8_meta) NULL 0 |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
631 rescode <- SDL_GetTextureColorMod: texture (addr_of: (r num)) (addr_of: (g num)) (addr_of: (b num)) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
632 if: rescode { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
633 mcall: none 1 option |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
634 } else: { |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
635 mcall: value 2 option (mcall: r:g:b 4 sdl r g b) |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
636 } |
577406b25f89
Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
Michael Pavone <pavone@retrodev.com>
parents:
332
diff
changeset
|
637 } |
334
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
638 |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
639 llMessage: width withVars: { |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
640 intret <- obj_int32 ptr |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
641 } andCode: { |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
642 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
643 intret num!: _width |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
644 intret |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
645 } |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
646 |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
647 llMessage: height withVars: { |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
648 intret <- obj_int32 ptr |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
649 } andCode: { |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
650 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
651 intret num!: _height |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
652 intret |
98534108b854
Add width and height accessors to texture objects in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
333
diff
changeset
|
653 } |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
654 |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
655 llMessage: destroy withVars: {} andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
656 SDL_DestroyTexture: texture |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
657 true |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
658 } |
279
eb83863fd33e
Store renderer pointer in texture object since the texture can only be used with the renderer it was created with
Michael Pavone <pavone@retrodev.com>
parents:
278
diff
changeset
|
659 } _ptr_init: rendptr texptr |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
660 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
661 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
662 _makeSurface <- :ptr { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
663 #{ |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
664 includeSystemHeader: "SDL.h" |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
665 llProperty: surface withType: (SDL_Surface ptr) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
666 llMessage: opaque withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
667 ptr <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
668 } andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
669 ptr <- make_object: (addr_of: cpointer_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
670 ptr val!: surface |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
671 ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
672 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
673 llMessage: _ptr_init withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
674 ptr <- cpointer ptr |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
675 } andCode: :ptr { |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
676 surface <- ptr val |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
677 self |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
678 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
679 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
680 asTexture <- :renderer { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
681 _helper createTextureFromSurface: (renderer opaque) opaque _makeTexture |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
682 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
683 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
684 llMessage: free withVars: {} andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
685 SDL_FreeSurface: surface |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
686 true |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
687 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
688 } _ptr_init: ptr |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
689 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
690 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
691 #{ |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
692 includeSystemHeader: "SDL.h" |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
693 includeSystemHeader: "stdlib.h" |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
694 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
695 llMessage: init withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
696 flags <- obj_uint32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
697 intret <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
698 } andCode: :flags { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
699 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
700 intret num!: (SDL_Init: (flags num)) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
701 if: (intret num) { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
702 atexit: SDL_Quit |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
703 } |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
704 intret |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
705 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
706 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
707 llMessage: initSubSystem withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
708 flags <- obj_uint32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
709 intret <- obj_int32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
710 } andCode: :flags { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
711 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
712 intret num!: (SDL_InitSubSystem: (flags num)) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
713 intret |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
714 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
715 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
716 llMessage: quitSubSystem withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
717 flags <- obj_uint32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
718 } andCode: :flags { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
719 SDL_QuitSubSystem: (flags num) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
720 true |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
721 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
722 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
723 r:g:b:a <- :rc :gc :bc :ac { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
724 #{ |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
725 r <- rc |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
726 g <- gc |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
727 b <- bc |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
728 a <- ac |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
729 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
730 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
731 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
732 r:g:b <- :r :g :b { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
733 r: r g: g b: b a: 255u8 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
734 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
735 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
736 createWindow:pos:size:flags <- :title :x y :w h :flags{ |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
737 _helper createWindow: title x y w h flags :ptr { |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
738 print: (string: ptr) . "\n" |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
739 #{ |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
740 includeSystemHeader: "SDL.h" |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
741 llProperty: window withType: (SDL_Window ptr) |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
742 llMessage: opaque withVars: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
743 op <- cpointer ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
744 } andCode: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
745 op <- make_object: (addr_of: cpointer_meta) NULL 0 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
746 op val!: window |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
747 op |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
748 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
749 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
750 llMessage: _ptr_init withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
751 ptr <- cpointer ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
752 } andCode: :ptr { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
753 window <- ptr val |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
754 self |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
755 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
756 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
757 renderOpts <- { _renderOpts } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
758 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
759 createRenderer:flags <- :index :flags { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
760 _helper createRenderer: (self opaque) index flags :ptr { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
761 #{ |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
762 includeSystemHeader: "SDL.h" |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
763 llProperty: renderer withType: (SDL_Renderer ptr) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
764 llMessage: opaque withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
765 op <- cpointer ptr |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
766 } andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
767 op <- make_object: (addr_of: cpointer_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
768 op val!: renderer |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
769 op |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
770 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
771 llMessage: _ptr_init withVars: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
772 ptr <- cpointer ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
773 } andCode: :ptr { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
774 renderer <- ptr val |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
775 self |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
776 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
777 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
778 llMessage: drawColor! withVars: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
779 color <- object ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
780 rc <- obj_uint8 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
781 gc <- obj_uint8 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
782 bc <- obj_uint8 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
783 ac <- obj_uint8 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
784 intret <- obj_int32 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
785 } andCode: :color { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
786 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
787 rc <- (mcall: r 1 color) castTo: (obj_uint8 ptr) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
788 gc <- (mcall: g 1 color) castTo: (obj_uint8 ptr) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
789 bc <- (mcall: b 1 color) castTo: (obj_uint8 ptr) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
790 ac <- (mcall: a 1 color) castTo: (obj_uint8 ptr) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
791 intret num!: (SDL_SetRenderDrawColor: renderer (rc num) (gc num) (bc num) (ac num)) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
792 intret |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
793 } |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
794 |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
795 createTexture:access:width:height <- :format :access :w :h { |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
796 _helper createTexture: opaque format access w h _makeTexture |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
797 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
798 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
799 llMessage: clear withVars: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
800 intret <- obj_int32 ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
801 } andCode: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
802 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
803 intret num!: (SDL_RenderClear: renderer) |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
804 intret |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
805 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
806 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
807 llMessage: present withVars: {} andCode: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
808 SDL_RenderPresent: renderer |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
809 true |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
810 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
811 |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
812 llMessage: destroy withVars: {} andCode: { |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
813 SDL_DestroyRenderer: renderer |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
814 true |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
815 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
816 } _ptr_init: ptr |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
817 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
818 } |
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
819 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
820 llMessage: destroy withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
821 } andCode: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
822 SDL_DestroyWindow: window |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
823 true |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
824 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
825 } _ptr_init: ptr |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
826 } |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
827 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
828 |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
829 loadBMP <- :filename { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
830 _helper loadBMP: filename _makeSurface |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
831 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
832 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
833 llMessage: delay withVars: { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
834 ms <- obj_uint32 ptr |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
835 } andCode: :ms { |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
836 SDL_Delay: (ms num) |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
837 true |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
838 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
839 |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
840 llMessage: clearError withVars: {} andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
841 SDL_ClearError: |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
842 true |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
843 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
844 |
283
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
845 rect:size <- :x y :w h { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
846 getter <- macro: :propName { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
847 quote: (llMessage: propName withVars: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
848 intret <- obj_int32 ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
849 } andCode: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
850 intret <- make_object: (addr_of: obj_int32_meta) NULL 0 |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
851 intret num!: ((addr_of: rect) propName) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
852 intret |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
853 }) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
854 } |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
855 setter <- macro: :propName { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
856 quote: (llMessage: propName withVars: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
857 v <- obj_int32 ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
858 } andCode: :v { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
859 (addr_of: rect) propName: (v num) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
860 self |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
861 }) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
862 } |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
863 (((#{ |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
864 llProperty: rect withType: SDL_Rect |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
865 getter: x |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
866 setter: x! |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
867 getter: y |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
868 setter: y! |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
869 getter: w |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
870 setter: w! |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
871 getter: h |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
872 setter: h! |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
873 llMessage: _rectPointer withVars: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
874 retptr <- cpointer ptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
875 } andCode: { |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
876 retptr <- make_object: (addr_of: cpointer_meta) NULL 0 |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
877 retptr val!: (addr_of: (self rect)) |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
878 retptr |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
879 } |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
880 } x!: x) y!: y) w!: w) h!: h |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
881 } |
0ec4f1b68a38
Add copyTo method to texture that allows copying to a rectangular region on the renderer rather than stretching to fit the entire renderer
Michael Pavone <pavone@retrodev.com>
parents:
279
diff
changeset
|
882 |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
883 llMessage: getError withVars: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
884 str <- string ptr |
285
bb1539decd62
Fix const warning in sdl module
Michael Pavone <pavone@retrodev.com>
parents:
284
diff
changeset
|
885 rawstr <- const: (char ptr) |
278
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
886 } andCode: { |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
887 rawstr <- SDL_GetError: |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
888 str <- make_object: (addr_of: string_meta) NULL 0 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
889 str bytes!: (strlen: rawstr) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
890 str len!: (str bytes) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
891 str data!: (GC_MALLOC: (str bytes) + 1) |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
892 memcpy: (str data) rawstr (str bytes) + 1 |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
893 str |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
894 } |
1205c7a43cb4
Add bindings for SDL_ClearError, SDL_GetError, SDL_LoadBMP, SDL_CreateTextureFromSurface and a partial binding for SDL_RendererCopy
Michael Pavone <pavone@retrodev.com>
parents:
277
diff
changeset
|
895 |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
896 pollEvent <- { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
897 _helper pollEvent: :typ tstamp eventPtr { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
898 _eventConstructors ifget: typ :handler { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
899 handler: typ tstamp eventPtr |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
900 } else: { |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
901 //fallback event |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
902 #{ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
903 type <- typ |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
904 timeStamp <- tstamp |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
905 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
906 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
907 } |
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
908 } |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
909 |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
910 waitEvent <- { |
345
6bbf12c203f7
Actually call SDL_WaitEvent rather than SDL_PollEvent in the waitEvent method
Michael Pavone <pavone@retrodev.com>
parents:
334
diff
changeset
|
911 _helper waitEvent: :typ tstamp eventPtr { |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
912 _eventConstructors ifget: typ :handler { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
913 handler: typ tstamp eventPtr |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
914 } else: { |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
915 //fallback event |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
916 #{ |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
917 type <- typ |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
918 timeStamp <- tstamp |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
919 } |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
920 } |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
921 } |
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
922 } |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
923 |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
924 subsystems <- { _subsystems } |
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
925 windowOpts <- { _windowOpts } |
291
38bbbf74b735
Initial work on event support in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
287
diff
changeset
|
926 eventTypes <- { _events } |
332
ead24192ed45
Initial work on a UI module
Michael Pavone <pavone@retrodev.com>
parents:
318
diff
changeset
|
927 windowEventTypes <- { _windowEvents } |
318
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
928 textureAccess <- { _textureAccess } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
929 pixelFormats <- { _pixelFormats } |
4c669942c30d
Add bindings for SDL_CreateTexture, SDL_LockTexture, SDL_SetBlendMode and SDL_GetBlendMode in SDL module
Michael Pavone <pavone@retrodev.com>
parents:
293
diff
changeset
|
930 blendModes <- { _blendModes } |
274
a923b5b7da3d
Initial work on an SDL2 binding
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
931 } |
277
2b58eafa360b
Add SDL bindings for creating a renderer, clearing it, presenting it and destroying it
Michael Pavone <pavone@retrodev.com>
parents:
274
diff
changeset
|
932 } |