-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshape.js
More file actions
33 lines (28 loc) · 773 Bytes
/
shape.js
File metadata and controls
33 lines (28 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const {
e,
Union,
en,
push_export
} = require('./api');
e.SDL_NONSHAPEABLE_WINDOW = -1;
e.SDL_INVALID_SHAPE_ARGUMENT = -2;
e.SDL_WINDOW_LACKS_SHAPE = -3;
e.ShapeModeDefault = en(0);
e.ShapeModeBinarizeAlpha = en();
e.ShapeModeReverseBinarizeAlpha = en();
e.ShapeModeColorKey = en();
e.SDL_SHAPEMODEALPHA = function(mode) {
return mode == e.ShapeModeDefault || mode == e.ShapeModeBinarizeAlpha || mode == e.ShapeModeReverseBinarizeAlpha;
}
e.SDL_WindowShapeParams = Union({
binarizationCutoff: 'Uint8',
colorKey: e.SDL_Color
});
e.SDL_WindowShapeMode = Union({
mode: 'int',
parameters: e.SDL_WindowShapeParams
});
push_export({
'SDL_SetWindowShape': ['int', ['void*', 'void*', 'void*']],
'SDL_GetShapedWindowMode': ['int', ['void*', 'void*']]
});