File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change
1
+ import platform
1
2
import numpy as np
2
3
import pyray as rl
3
4
9
10
10
11
CONNECTION_RETRY_INTERVAL = 0.2 # seconds between connection attempts
11
12
12
- VERTEX_SHADER = """
13
+ VERSION = """
13
14
#version 300 es
15
+ precision mediump float;
16
+ """
17
+ if platform .system () == "Darwin" :
18
+ VERSION = """
19
+ #version 330 core
20
+ """
21
+
22
+
23
+ VERTEX_SHADER = VERSION + """
14
24
in vec3 vertexPosition;
15
25
in vec2 vertexTexCoord;
16
26
in vec3 vertexNormal;
40
50
}
41
51
"""
42
52
else :
43
- FRAME_FRAGMENT_SHADER = """
44
- #version 300 es
45
- precision mediump float;
53
+ FRAME_FRAGMENT_SHADER = VERSION + """
46
54
in vec2 fragTexCoord;
47
55
uniform sampler2D texture0;
48
56
uniform sampler2D texture1;
Original file line number Diff line number Diff line change
1
+ import platform
1
2
import pyray as rl
2
3
import numpy as np
3
4
from typing import Any
4
5
5
6
MAX_GRADIENT_COLORS = 15
6
7
7
- FRAGMENT_SHADER = """
8
+ VERSION = """
8
9
#version 300 es
9
10
precision mediump float;
11
+ """
12
+ if platform .system () == "Darwin" :
13
+ VERSION = """
14
+ #version 330 core
15
+ """
10
16
17
+ FRAGMENT_SHADER = VERSION + """
11
18
in vec2 fragTexCoord;
12
19
out vec4 finalColor;
13
20
111
118
"""
112
119
113
120
# Default vertex shader
114
- VERTEX_SHADER = """
115
- #version 300 es
121
+ VERTEX_SHADER = VERSION + """
116
122
in vec3 vertexPosition;
117
123
in vec2 vertexTexCoord;
118
124
out vec2 fragTexCoord;
You can’t perform that action at this time.
0 commit comments