Skip to content

Commit f6f54fd

Browse files
committed
Switch to ALL CAPS const values.
1 parent 5f5f670 commit f6f54fd

File tree

5 files changed

+42
-106
lines changed

5 files changed

+42
-106
lines changed

example-egl/main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ func main() {
109109
}
110110

111111
func initGL() {
112-
gl.Hint(gl.PerspectiveCorrectionHint, gl.Fastest)
113-
gl.Enable(gl.CullFace)
114-
gl.Disable(gl.DepthTest)
115-
gl.SetShadeModel(gl.Smooth)
112+
gl.Hint(gl.PERSPECTIVE_CORRECTION_HINT, gl.FASTEST)
113+
gl.Enable(gl.CULL_FACE)
114+
gl.Disable(gl.DEPTH_TEST)
115+
gl.ShadeModel(gl.SMOOTH)
116116
}
117117

118118
func draw(handle *DisplayHandle, x, y, z float32) {
119119
gl.ClearColor(x, y, z, 1)
120-
gl.ClearFunc(gl.ColorBufferBit)
120+
gl.Clear(gl.COLOR_BUFFER_BIT)
121121
egl.SwapBuffers(handle.display, handle.surface)
122122
}

gles.yml

+6-24
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,16 @@ TRANSLATOR:
3434
function:
3535
- {action: accept, from: ^gl}
3636
- {action: replace, from: ^gl}
37-
# avoid collision with param constants
38-
- {action: replace, from: LineWidth$, to: "SetLineWidth"}
39-
- {action: replace, from: PointSize$, to: "SetPointSize"}
40-
- {action: replace, from: ActiveTexture$, to: "SetActiveTexture"}
41-
- {action: replace, from: Clear$, to: "ClearFunc"}
42-
- {action: replace, from: ClientActiveTexture$, to: "SetClientActiveTexture"}
43-
- {action: replace, from: CullFace$, to: "SetCullFace"}
44-
- {action: replace, from: DepthFunc$, to: "SetDepthFunc"}
45-
- {action: replace, from: FrontFace$, to: "SetFrontFace"}
46-
- {action: replace, from: MatrixMode$, to: "SetMatrixMode"}
47-
- {action: replace, from: SampleCoverage$, to: "SetSampleCoverage"}
48-
- {action: replace, from: ShadeModel$, to: "SetShadeModel"}
49-
- {action: replace, from: StencilFunc$, to: "SetStencilFunc"}
50-
- {action: replace, from: Viewport$, to: "SetViewport"}
37+
- {transform: export}
5138
type:
5239
- {action: replace, from: "_t$"}
40+
- {transform: export}
41+
- {load: snakecase}
5342
const:
54-
- {action: replace, from: FLOAT$, to: FLOAT_TYPE}
55-
- {action: replace, from: BYTE$, to: BYTE_TYPE}
56-
- {action: replace, from: SHORT$, to: SHORT_TYPE}
57-
- {action: replace, from: FIXED$, to: FIXED_TYPE}
58-
- {transform: lower}
43+
- {action: replace, from: "^_"}
5944
private:
6045
- {transform: unexport}
46+
- {load: snakecase}
6147
post-global:
6248
- {action: doc, from: "^gl",
63-
to: "https://www.khronos.org/opengles/sdk/docs/man/xhtml/$name.xml"}
64-
- {transform: export}
65-
- {load: snakecase}
66-
67-
49+
to: "https://www.khronos.org/opengles/sdk/1.1/docs/man/$name.xml"}

gles2.yml

+11-23
Original file line numberDiff line numberDiff line change
@@ -37,45 +37,33 @@ TRANSLATOR:
3737
- {target: ^glGetProgramInfoLog$, tips: [0,size,ref,arr]}
3838
- {target: ^glGetShaderPrecisionFormat$, tips: [0,0,arr,ref]}
3939
- {target: ^glGetVertexAttribPointerv$, tips: [0,0,ref]}
40-
- {target: ^glUniformMatrix4fv$, tips: [0,0,0,ref]}
40+
# parameter at the end:
41+
- {target: ^glUniformMatrix, tips: [0,0,0,ref]}
42+
- {target: iv$, tips: [0,0,ref]}
43+
- {target: fv$, tips: [0,0,ref]}
44+
4145
TypeTips:
4246
function:
4347
# do not stick with GL types, use Go types for API instead
4448
- {target: ., self: plain, tips: [plain,plain,plain,plain,plain,plain,plain,plain,plain]}
45-
49+
4650
Rules:
4751
global:
4852
- {action: accept, from: "^GL"}
4953
- {action: replace, from: "^GL"}
5054
function:
5155
- {action: accept, from: ^gl}
5256
- {action: replace, from: ^gl}
53-
# avoid collision with param constants
54-
- {action: replace, from: ActiveTexture$, to: "SetActiveTexture"}
55-
- {action: replace, from: BlendColor$, to: "SetBlendColor"}
56-
- {action: replace, from: BlendEquation$, to: "SetBlendEquation"}
57-
- {action: replace, from: CullFace$, to: "SetCullFace"}
58-
- {action: replace, from: DepthFunc$, to: "SetDepthFunc"}
59-
- {action: replace, from: FrontFace$, to: "SetFrontFace"}
60-
- {action: replace, from: LineWidth$, to: "SetLineWidth"}
61-
- {action: replace, from: SampleCoverage$, to: "SetSampleCoverage"}
62-
- {action: replace, from: StencilFunc$, to: "SetStencilFunc"}
63-
- {action: replace, from: Viewport$, to: "SetViewport"}
57+
- {transform: export}
6458
type:
6559
- {action: replace, from: "_t$"}
60+
- {transform: export}
61+
- {load: snakecase}
6662
const:
67-
- {action: replace, from: FLOAT$, to: FLOAT_TYPE}
68-
- {action: replace, from: BYTE$, to: BYTE_TYPE}
69-
- {action: replace, from: SHORT$, to: SHORT_TYPE}
70-
- {action: replace, from: FIXED$, to: FIXED_TYPE}
71-
- {action: replace, from: INT$, to: INT_TYPE}
72-
- {transform: lower}
63+
- {action: replace, from: "^_"}
7364
private:
7465
- {transform: unexport}
66+
- {load: snakecase}
7567
post-global:
7668
- {action: doc, from: "^gl",
7769
to: "https://www.khronos.org/opengles/sdk/docs/man/xhtml/$name.xml"}
78-
- {transform: export}
79-
- {load: snakecase}
80-
81-

gles3.yml

+10-26
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ TRANSLATOR:
3737
- {target: ^glGetProgramInfoLog$, tips: [0,size,ref,arr]}
3838
- {target: ^glGetShaderPrecisionFormat$, tips: [0,0,arr,ref]}
3939
- {target: ^glGetVertexAttribPointerv$, tips: [0,0,ref]}
40-
- {target: ^glUniformMatrix4fv$, tips: [0,0,0,ref]}
40+
# parameter at the end:
41+
- {target: ^glUniformMatrix, tips: [0,0,0,ref]}
42+
- {target: iv$, tips: [0,0,ref]}
43+
- {target: fv$, tips: [0,0,ref]}
44+
4145
TypeTips:
4246
function:
4347
# do not stick with GL types, use Go types for API instead
@@ -50,36 +54,16 @@ TRANSLATOR:
5054
function:
5155
- {action: accept, from: ^gl}
5256
- {action: replace, from: ^gl}
53-
# avoid collision with param constants
54-
- {action: replace, from: ActiveTexture$, to: "SetActiveTexture"}
55-
- {action: replace, from: BlendColor$, to: "SetBlendColor"}
56-
- {action: replace, from: BlendEquation$, to: "SetBlendEquation"}
57-
- {action: replace, from: CullFace$, to: "SetCullFace"}
58-
- {action: replace, from: DepthFunc$, to: "SetDepthFunc"}
59-
- {action: replace, from: FrontFace$, to: "SetFrontFace"}
60-
- {action: replace, from: LineWidth$, to: "SetLineWidth"}
61-
- {action: replace, from: SampleCoverage$, to: "SetSampleCoverage"}
62-
- {action: replace, from: StencilFunc$, to: "SetStencilFunc"}
63-
- {action: replace, from: Viewport$, to: "SetViewport"}
64-
- {action: replace, from: ReadBuffer$, to: "SetReadBuffer"}
65-
- {action: replace, from: TransformFeedbackVaryings$, to: "SetTransformFeedbackVaryings"}
66-
- {action: replace, from: UniformBlockBinding$, to: "SetUniformBlockBinding"}
67-
57+
- {transform: export}
6858
type:
6959
- {action: replace, from: "_t$"}
60+
- {transform: export}
61+
- {load: snakecase}
7062
const:
71-
- {action: replace, from: FLOAT$, to: FLOAT_TYPE}
72-
- {action: replace, from: BYTE$, to: BYTE_TYPE}
73-
- {action: replace, from: SHORT$, to: SHORT_TYPE}
74-
- {action: replace, from: FIXED$, to: FIXED_TYPE}
75-
- {action: replace, from: INT$, to: INT_TYPE}
76-
- {transform: lower}
63+
- {action: replace, from: "^_"}
7764
private:
7865
- {transform: unexport}
66+
- {load: snakecase}
7967
post-global:
8068
- {action: doc, from: "^gl",
8169
to: "https://www.khronos.org/opengles/sdk/docs/man3/html/$name.xhtml"}
82-
- {transform: export}
83-
- {load: snakecase}
84-
85-

gles31.yml

+10-28
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ TRANSLATOR:
3737
- {target: ^glGetProgramInfoLog$, tips: [0,size,ref,arr]}
3838
- {target: ^glGetShaderPrecisionFormat$, tips: [0,0,arr,ref]}
3939
- {target: ^glGetVertexAttribPointerv$, tips: [0,0,ref]}
40-
- {target: ^glUniformMatrix4fv$, tips: [0,0,0,ref]}
40+
# parameter at the end:
41+
- {target: ^glUniformMatrix, tips: [0,0,0,ref]}
42+
- {target: iv$, tips: [0,0,ref]}
43+
- {target: fv$, tips: [0,0,ref]}
44+
4145
TypeTips:
4246
function:
4347
# do not stick with GL types, use Go types for API instead
@@ -50,38 +54,16 @@ TRANSLATOR:
5054
function:
5155
- {action: accept, from: ^gl}
5256
- {action: replace, from: ^gl}
53-
# avoid collision with param constants
54-
- {action: replace, from: ActiveTexture$, to: "SetActiveTexture"}
55-
- {action: replace, from: BlendColor$, to: "SetBlendColor"}
56-
- {action: replace, from: BlendEquation$, to: "SetBlendEquation"}
57-
- {action: replace, from: CullFace$, to: "SetCullFace"}
58-
- {action: replace, from: DepthFunc$, to: "SetDepthFunc"}
59-
- {action: replace, from: FrontFace$, to: "SetFrontFace"}
60-
- {action: replace, from: LineWidth$, to: "SetLineWidth"}
61-
- {action: replace, from: SampleCoverage$, to: "SetSampleCoverage"}
62-
- {action: replace, from: StencilFunc$, to: "SetStencilFunc"}
63-
- {action: replace, from: Viewport$, to: "SetViewport"}
64-
- {action: replace, from: ReadBuffer$, to: "SetReadBuffer"}
65-
- {action: replace, from: TransformFeedbackVaryings$, to: "SetTransformFeedbackVaryings"}
66-
- {action: replace, from: UniformBlockBinding$, to: "SetUniformBlockBinding"}
67-
- {action: replace, from: VertexAttribBinding$, to: "SetVertexAttribBinding"}
68-
- {action: replace, from: VertexBindingDivisor$, to: "SetVertexBindingDivisor"}
69-
57+
- {transform: export}
7058
type:
7159
- {action: replace, from: "_t$"}
60+
- {transform: export}
61+
- {load: snakecase}
7262
const:
73-
- {action: replace, from: FLOAT$, to: FLOAT_TYPE}
74-
- {action: replace, from: BYTE$, to: BYTE_TYPE}
75-
- {action: replace, from: SHORT$, to: SHORT_TYPE}
76-
- {action: replace, from: FIXED$, to: FIXED_TYPE}
77-
- {action: replace, from: INT$, to: INT_TYPE}
78-
- {transform: lower}
63+
- {action: replace, from: "^_"}
7964
private:
8065
- {transform: unexport}
66+
- {load: snakecase}
8167
post-global:
8268
- {action: doc, from: "^gl",
8369
to: "https://www.khronos.org/opengles/sdk/docs/man31/html/$name.xhtml"}
84-
- {transform: export}
85-
- {load: snakecase}
86-
87-

0 commit comments

Comments
 (0)