slifer 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +70 -70
- package/index.ts +13 -11
- package/main.exe +0 -0
- package/package.json +1 -1
- package/single.png +0 -0
- package/src/download.ts +48 -27
- package/src/engine/audio.ts +23 -23
- package/src/engine/color.ts +14 -14
- package/src/engine/cursor.ts +17 -0
- package/src/engine/font.ts +16 -16
- package/src/engine/image.ts +42 -23
- package/src/engine/rectangle.ts +31 -31
- package/src/engine/render.ts +15 -19
- package/src/engine/vector2.ts +25 -25
- package/src/engine/window.ts +62 -52
- package/src/engine.ts +30 -30
- package/src/ffi.ts +275 -316
- package/src/global.ts +10 -10
- package/src/modules/graphics.ts +66 -100
- package/src/modules/keyboard.ts +100 -96
- package/src/modules/mouse.ts +76 -76
- package/src/slifer.test.ts +43 -43
- package/src/slifer.ts +92 -87
- package/tsconfig.json +28 -28
- package/.npmignore +0 -139
- package/bun.lockb +0 -0
- package/src/engine/canvas.ts +0 -58
package/src/modules/graphics.ts
CHANGED
@@ -1,100 +1,66 @@
|
|
1
|
-
import Vector2 from "../engine/vector2";
|
2
|
-
import { libsdl, libttf } from "../ffi";
|
3
|
-
import { ptr } from 'bun:ffi';
|
4
|
-
import Font from '../engine/font';
|
5
|
-
import type Image from "../engine/image";
|
6
|
-
import Render from "../engine/render";
|
7
|
-
import Window from '../engine/window';
|
8
|
-
import type Color from "../engine/color";
|
9
|
-
import Rectangle from "../engine/rectangle";
|
10
|
-
import
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
destArray[
|
34
|
-
destArray[
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
libttf.symbols.TTF_SizeText(
|
69
|
-
(font as any).pointer,
|
70
|
-
//@ts-expect-error
|
71
|
-
Buffer.from(text+"\x00"),
|
72
|
-
ptr(wArr),
|
73
|
-
ptr(hArr)
|
74
|
-
);
|
75
|
-
|
76
|
-
const _col = ((color.r << 16) + (color.g << 8) + (color.b << 0));
|
77
|
-
|
78
|
-
const surface = libttf.symbols.TTF_RenderText_Solid(
|
79
|
-
(font as any).pointer,
|
80
|
-
//@ts-expect-error
|
81
|
-
Buffer.from(text+'\x00'),
|
82
|
-
_col
|
83
|
-
);
|
84
|
-
if (surface == null) throw `Rendering text failed`;
|
85
|
-
|
86
|
-
const destRect = new Uint32Array(4);
|
87
|
-
destRect[0] = x;
|
88
|
-
destRect[1] = y;
|
89
|
-
destRect[2] = wArr[0];
|
90
|
-
destRect[3] = hArr[0];
|
91
|
-
|
92
|
-
libsdl.symbols.SDL_UpperBlit(
|
93
|
-
surface,
|
94
|
-
null,
|
95
|
-
Render.surface,
|
96
|
-
ptr(destRect)
|
97
|
-
);
|
98
|
-
|
99
|
-
}
|
100
|
-
}
|
1
|
+
import Vector2 from "../engine/vector2";
|
2
|
+
import { libsdl, libttf } from "../ffi";
|
3
|
+
import { ptr } from 'bun:ffi';
|
4
|
+
import Font from '../engine/font';
|
5
|
+
import type Image from "../engine/image";
|
6
|
+
import Render from "../engine/render";
|
7
|
+
import Window from '../engine/window';
|
8
|
+
import type Color from "../engine/color";
|
9
|
+
import Rectangle from "../engine/rectangle";
|
10
|
+
import Cursor from '../engine/cursor';
|
11
|
+
|
12
|
+
type Drawable = Image;
|
13
|
+
|
14
|
+
/** @internal */
|
15
|
+
export default class Graphics {
|
16
|
+
public render() {
|
17
|
+
libsdl.symbols.SDL_RenderPresent(Render.pointer);
|
18
|
+
}
|
19
|
+
|
20
|
+
public draw(drawable: Drawable, x: number, y: number) {
|
21
|
+
(drawable as any).destArray[0] = x;
|
22
|
+
(drawable as any).destArray[1] = y;
|
23
|
+
|
24
|
+
libsdl.symbols.SDL_RenderCopy(
|
25
|
+
Render.pointer,
|
26
|
+
(drawable as any).pointer,
|
27
|
+
null,
|
28
|
+
ptr((drawable as any).destArray)
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
public drawScaled(drawable: Drawable, x: number, y: number, xscale: number, yscale: number) {
|
33
|
+
(drawable as any).destArray[0] = x;
|
34
|
+
(drawable as any).destArray[1] = y;
|
35
|
+
(drawable as any).destArray[2] = drawable.width * xscale;
|
36
|
+
(drawable as any).destArray[3] = drawable.height * yscale;
|
37
|
+
|
38
|
+
libsdl.symbols.SDL_RenderCopy(
|
39
|
+
Render.pointer,
|
40
|
+
(drawable as any).pointer,
|
41
|
+
null,
|
42
|
+
ptr((drawable as any).destArray)
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
private setColor(color: Color) {
|
47
|
+
libsdl.symbols.SDL_SetRenderDrawColor(Render.pointer, color.r, color.g, color.b, color.a);
|
48
|
+
}
|
49
|
+
|
50
|
+
public setBackground(color: Color) {
|
51
|
+
this.setColor(color);
|
52
|
+
libsdl.symbols.SDL_RenderClear(Render.pointer);
|
53
|
+
}
|
54
|
+
|
55
|
+
public drawRect(rectangle: Rectangle, color: Color) {
|
56
|
+
this.setColor(color);
|
57
|
+
|
58
|
+
const rect = new Uint32Array(4);
|
59
|
+
rect[0] = rectangle.position.x;
|
60
|
+
rect[1] = rectangle.position.y;
|
61
|
+
rect[2] = rectangle.size.x;
|
62
|
+
rect[3] = rectangle.size.y;
|
63
|
+
|
64
|
+
libsdl.symbols.SDL_RenderFillRect(Render.pointer, ptr(rect));
|
65
|
+
}
|
66
|
+
}
|
package/src/modules/keyboard.ts
CHANGED
@@ -1,96 +1,100 @@
|
|
1
|
-
import { libsdl } from "../ffi";
|
2
|
-
import { toArrayBuffer } from "bun:ffi";
|
3
|
-
|
4
|
-
/** @internal */
|
5
|
-
export default class Keyboard {
|
6
|
-
|
7
|
-
public static keyMap = new Map<string, number>();
|
8
|
-
|
9
|
-
private static convertScancodeToKey(scancode: number): string {
|
10
|
-
const keyFromScancode = libsdl.symbols.SDL_GetKeyFromScancode(scancode);
|
11
|
-
const keyName = libsdl.symbols
|
12
|
-
.SDL_GetKeyName(keyFromScancode)
|
13
|
-
.toString()
|
14
|
-
.toLocaleLowerCase();
|
15
|
-
|
16
|
-
return keyName;
|
17
|
-
}
|
18
|
-
|
19
|
-
public static handleStates() {
|
20
|
-
const keyState = libsdl.symbols.SDL_GetKeyboardState(null);
|
21
|
-
if (keyState == null) throw `Keyboard state returned null.`;
|
22
|
-
const keyDV = new DataView(toArrayBuffer(keyState, 0,
|
23
|
-
for (let kn = 0; kn <
|
24
|
-
if (keyDV.getUint8(kn) == 1) {
|
25
|
-
const keyName = this.convertScancodeToKey(kn);
|
26
|
-
const kmGet = this.keyMap.get(keyName);
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
this.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
return
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
return
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
| "
|
56
|
-
| "
|
57
|
-
| "
|
58
|
-
| "
|
59
|
-
| "
|
60
|
-
| "
|
61
|
-
| "
|
62
|
-
| "
|
63
|
-
| "
|
64
|
-
| "
|
65
|
-
| "
|
66
|
-
| "
|
67
|
-
| "
|
68
|
-
| "
|
69
|
-
| "
|
70
|
-
| "
|
71
|
-
| "
|
72
|
-
| "
|
73
|
-
| "
|
74
|
-
| "
|
75
|
-
| "
|
76
|
-
| "
|
77
|
-
| "
|
78
|
-
| "
|
79
|
-
| "
|
80
|
-
| "
|
81
|
-
| "
|
82
|
-
| "
|
83
|
-
| "
|
84
|
-
| "
|
85
|
-
| "
|
86
|
-
| "
|
87
|
-
| "
|
88
|
-
| "
|
89
|
-
| "
|
90
|
-
| "
|
91
|
-
| "
|
92
|
-
| "
|
93
|
-
| "
|
94
|
-
| "
|
95
|
-
| "
|
96
|
-
| "
|
1
|
+
import { libsdl } from "../ffi";
|
2
|
+
import { toArrayBuffer } from "bun:ffi";
|
3
|
+
|
4
|
+
/** @internal */
|
5
|
+
export default class Keyboard {
|
6
|
+
|
7
|
+
public static keyMap = new Map<string, number>();
|
8
|
+
|
9
|
+
private static convertScancodeToKey(scancode: number): string {
|
10
|
+
const keyFromScancode = libsdl.symbols.SDL_GetKeyFromScancode(scancode);
|
11
|
+
const keyName = libsdl.symbols
|
12
|
+
.SDL_GetKeyName(keyFromScancode)
|
13
|
+
.toString()
|
14
|
+
.toLocaleLowerCase();
|
15
|
+
|
16
|
+
return keyName;
|
17
|
+
}
|
18
|
+
|
19
|
+
public static handleStates() {
|
20
|
+
const keyState = libsdl.symbols.SDL_GetKeyboardState(null);
|
21
|
+
if (keyState == null) throw `Keyboard state returned null.`;
|
22
|
+
const keyDV = new DataView(toArrayBuffer(keyState, 0, 128));
|
23
|
+
for (let kn = 0; kn < 128; kn++) {
|
24
|
+
if (keyDV.getUint8(kn) == 1) {
|
25
|
+
const keyName = this.convertScancodeToKey(kn);
|
26
|
+
const kmGet = this.keyMap.get(keyName);
|
27
|
+
|
28
|
+
|
29
|
+
if (kmGet == undefined || kmGet == 0) {
|
30
|
+
this.keyMap.set(keyName, 1);
|
31
|
+
} else if (kmGet == 1) {
|
32
|
+
this.keyMap.set(keyName, 2);
|
33
|
+
}
|
34
|
+
} else if (keyDV.getUint8(kn) == 0) {
|
35
|
+
const keyName = this.convertScancodeToKey(kn);
|
36
|
+
this.keyMap.set(keyName, 0);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
public isPressed(key: keys) : boolean {
|
42
|
+
const kmGet = Keyboard.keyMap.get(key);
|
43
|
+
if (kmGet == 1) return true;
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
|
47
|
+
public isDown(key: keys) : boolean {
|
48
|
+
const kmGet = Keyboard.keyMap.get(key);
|
49
|
+
if (kmGet == 1 || kmGet == 2) return true;
|
50
|
+
return false;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
export type keys =
|
55
|
+
| "a"
|
56
|
+
| "b"
|
57
|
+
| "c"
|
58
|
+
| "d"
|
59
|
+
| "e"
|
60
|
+
| "f"
|
61
|
+
| "g"
|
62
|
+
| "h"
|
63
|
+
| "i"
|
64
|
+
| "j"
|
65
|
+
| "k"
|
66
|
+
| "l"
|
67
|
+
| "m"
|
68
|
+
| "n"
|
69
|
+
| "o"
|
70
|
+
| "p"
|
71
|
+
| "q"
|
72
|
+
| "r"
|
73
|
+
| "s"
|
74
|
+
| "t"
|
75
|
+
| "u"
|
76
|
+
| "v"
|
77
|
+
| "w"
|
78
|
+
| "x"
|
79
|
+
| "y"
|
80
|
+
| "z"
|
81
|
+
| "1"
|
82
|
+
| "2"
|
83
|
+
| "3"
|
84
|
+
| "4"
|
85
|
+
| "5"
|
86
|
+
| "6"
|
87
|
+
| "7"
|
88
|
+
| "8"
|
89
|
+
| "9"
|
90
|
+
| "0"
|
91
|
+
| "space"
|
92
|
+
| "caps lock"
|
93
|
+
| "tab"
|
94
|
+
| "left shift"
|
95
|
+
| "right shift"
|
96
|
+
| "left ctrl"
|
97
|
+
| "escape"
|
98
|
+
| "backspace"
|
99
|
+
| "."
|
100
|
+
| "return";
|
package/src/modules/mouse.ts
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
import { libsdl } from "../ffi";
|
2
|
-
import { ptr } from "bun:ffi";
|
3
|
-
import Vector2 from "../engine/vector2";
|
4
|
-
|
5
|
-
/** @internal */
|
6
|
-
class Mouse {
|
7
|
-
private static x: number;
|
8
|
-
private static y: number;
|
9
|
-
|
10
|
-
private static buttonMap = new Map<number, number>();
|
11
|
-
|
12
|
-
static onRelease(button: number) {
|
13
|
-
this.buttonMap.set(button, 0);
|
14
|
-
}
|
15
|
-
|
16
|
-
static onMove(x: number, y: number) {
|
17
|
-
this.x = x;
|
18
|
-
this.y = y;
|
19
|
-
}
|
20
|
-
|
21
|
-
static handleState() {
|
22
|
-
const xArr = new Uint32Array(1);
|
23
|
-
const yArr = new Uint32Array(1);
|
24
|
-
const down = libsdl.symbols.SDL_GetMouseState(ptr(xArr), ptr(yArr));
|
25
|
-
const bmGet = this.buttonMap.get(down);
|
26
|
-
|
27
|
-
if (bmGet == undefined || bmGet == 0) {
|
28
|
-
this.buttonMap.set(down, 1);
|
29
|
-
} else if (bmGet == 1) {
|
30
|
-
this.buttonMap.set(down, 2);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
private static getPressMap(button: number) {
|
35
|
-
const bmGet = this.buttonMap.get(button);
|
36
|
-
if (bmGet == 1) return true;
|
37
|
-
return false;
|
38
|
-
}
|
39
|
-
|
40
|
-
private static getDownMap(button: number) {
|
41
|
-
const bmGet = this.buttonMap.get(button);
|
42
|
-
if (bmGet == 1 || bmGet == 2) return true;
|
43
|
-
return false;
|
44
|
-
}
|
45
|
-
|
46
|
-
isPressed(button: buttons): boolean {
|
47
|
-
switch (button) {
|
48
|
-
case "left":
|
49
|
-
return Mouse.getPressMap(1);
|
50
|
-
case "middle":
|
51
|
-
return Mouse.getPressMap(2);
|
52
|
-
case "right":
|
53
|
-
return Mouse.getPressMap(3);
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
isDown(button: buttons): boolean {
|
58
|
-
switch (button) {
|
59
|
-
case "left":
|
60
|
-
return Mouse.getDownMap(1);
|
61
|
-
case "middle":
|
62
|
-
return Mouse.getDownMap(2);
|
63
|
-
case "right":
|
64
|
-
return Mouse.getDownMap(3);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
getPosition(): Vector2 {
|
69
|
-
return new Vector2(Mouse.x, Mouse.y);
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
type buttons = "left" | "middle" | "right";
|
74
|
-
|
75
|
-
/** @internal */
|
76
|
-
export default Mouse;
|
1
|
+
import { libsdl } from "../ffi";
|
2
|
+
import { ptr } from "bun:ffi";
|
3
|
+
import Vector2 from "../engine/vector2";
|
4
|
+
|
5
|
+
/** @internal */
|
6
|
+
class Mouse {
|
7
|
+
private static x: number;
|
8
|
+
private static y: number;
|
9
|
+
|
10
|
+
private static buttonMap = new Map<number, number>();
|
11
|
+
|
12
|
+
static onRelease(button: number) {
|
13
|
+
this.buttonMap.set(button, 0);
|
14
|
+
}
|
15
|
+
|
16
|
+
static onMove(x: number, y: number) {
|
17
|
+
this.x = x;
|
18
|
+
this.y = y;
|
19
|
+
}
|
20
|
+
|
21
|
+
static handleState() {
|
22
|
+
const xArr = new Uint32Array(1);
|
23
|
+
const yArr = new Uint32Array(1);
|
24
|
+
const down = libsdl.symbols.SDL_GetMouseState(ptr(xArr), ptr(yArr));
|
25
|
+
const bmGet = this.buttonMap.get(down);
|
26
|
+
|
27
|
+
if (bmGet == undefined || bmGet == 0) {
|
28
|
+
this.buttonMap.set(down, 1);
|
29
|
+
} else if (bmGet == 1) {
|
30
|
+
this.buttonMap.set(down, 2);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
private static getPressMap(button: number) {
|
35
|
+
const bmGet = this.buttonMap.get(button);
|
36
|
+
if (bmGet == 1) return true;
|
37
|
+
return false;
|
38
|
+
}
|
39
|
+
|
40
|
+
private static getDownMap(button: number) {
|
41
|
+
const bmGet = this.buttonMap.get(button);
|
42
|
+
if (bmGet == 1 || bmGet == 2) return true;
|
43
|
+
return false;
|
44
|
+
}
|
45
|
+
|
46
|
+
isPressed(button: buttons): boolean {
|
47
|
+
switch (button) {
|
48
|
+
case "left":
|
49
|
+
return Mouse.getPressMap(1);
|
50
|
+
case "middle":
|
51
|
+
return Mouse.getPressMap(2);
|
52
|
+
case "right":
|
53
|
+
return Mouse.getPressMap(3);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
isDown(button: buttons): boolean {
|
58
|
+
switch (button) {
|
59
|
+
case "left":
|
60
|
+
return Mouse.getDownMap(1);
|
61
|
+
case "middle":
|
62
|
+
return Mouse.getDownMap(2);
|
63
|
+
case "right":
|
64
|
+
return Mouse.getDownMap(3);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
getPosition(): Vector2 {
|
69
|
+
return new Vector2(Mouse.x, Mouse.y);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
type buttons = "left" | "middle" | "right";
|
74
|
+
|
75
|
+
/** @internal */
|
76
|
+
export default Mouse;
|
package/src/slifer.test.ts
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
2
|
-
import { initSDL, initSDLImage, initSDLTypeFont, initSDLMixer } from "./engine";
|
3
|
-
import Vector2 from "./engine/vector2";
|
4
|
-
import Render from "./engine/render";
|
5
|
-
import Window from "./engine/window";
|
6
|
-
|
7
|
-
describe("Initializing SDL ", () => {
|
8
|
-
it("Should initialize without error ", () => {
|
9
|
-
expect(() => initSDL()).not.toThrow(Error);
|
10
|
-
});
|
11
|
-
});
|
12
|
-
|
13
|
-
describe("Initializing SDL Image ", () => {
|
14
|
-
it("Should initialize without error ", () => {
|
15
|
-
expect(() => initSDLImage()).not.toThrow(Error);
|
16
|
-
});
|
17
|
-
});
|
18
|
-
|
19
|
-
describe("Initializing SDL TTF ", () => {
|
20
|
-
it("Should initialize without error ", () => {
|
21
|
-
expect(() => initSDLTypeFont()).not.toThrow(Error);
|
22
|
-
});
|
23
|
-
});
|
24
|
-
|
25
|
-
describe("Initializing SDL Mixer ", () => {
|
26
|
-
it("Should initialize without error ", () => {
|
27
|
-
expect(() => initSDLMixer()).not.toThrow(Error);
|
28
|
-
});
|
29
|
-
});
|
30
|
-
|
31
|
-
describe("Window Creation ", () => {
|
32
|
-
it("Should create window without error", () => {
|
33
|
-
expect(() =>
|
34
|
-
Window.createWindow("Game",
|
35
|
-
).not.toThrow(Error);
|
36
|
-
});
|
37
|
-
});
|
38
|
-
|
39
|
-
describe("Renderer Creation ", () => {
|
40
|
-
it("Should create renderer without error", () => {
|
41
|
-
expect(() => Render.createRenderer()).not.toThrow(Error);
|
42
|
-
});
|
43
|
-
});
|
1
|
+
import { describe, expect, it } from "bun:test";
|
2
|
+
import { initSDL, initSDLImage, initSDLTypeFont, initSDLMixer } from "./engine";
|
3
|
+
import Vector2 from "./engine/vector2";
|
4
|
+
import Render from "./engine/render";
|
5
|
+
import Window from "./engine/window";
|
6
|
+
|
7
|
+
describe("Initializing SDL ", () => {
|
8
|
+
it("Should initialize without error ", () => {
|
9
|
+
expect(() => initSDL()).not.toThrow(Error);
|
10
|
+
});
|
11
|
+
});
|
12
|
+
|
13
|
+
describe("Initializing SDL Image ", () => {
|
14
|
+
it("Should initialize without error ", () => {
|
15
|
+
expect(() => initSDLImage()).not.toThrow(Error);
|
16
|
+
});
|
17
|
+
});
|
18
|
+
|
19
|
+
describe("Initializing SDL TTF ", () => {
|
20
|
+
it("Should initialize without error ", () => {
|
21
|
+
expect(() => initSDLTypeFont()).not.toThrow(Error);
|
22
|
+
});
|
23
|
+
});
|
24
|
+
|
25
|
+
describe("Initializing SDL Mixer ", () => {
|
26
|
+
it("Should initialize without error ", () => {
|
27
|
+
expect(() => initSDLMixer()).not.toThrow(Error);
|
28
|
+
});
|
29
|
+
});
|
30
|
+
|
31
|
+
describe("Window Creation ", () => {
|
32
|
+
it("Should create window without error", () => {
|
33
|
+
expect(() =>
|
34
|
+
Window.createWindow("Game", 1, 1)
|
35
|
+
).not.toThrow(Error);
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
describe("Renderer Creation ", () => {
|
40
|
+
it("Should create renderer without error", () => {
|
41
|
+
expect(() => Render.createRenderer(1, 1)).not.toThrow(Error);
|
42
|
+
});
|
43
|
+
});
|