Skip to content

Commit

Permalink
Add GL_LUMINANCE and PixelStorei to gl_mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed Feb 14, 2023
1 parent fabea23 commit 572fa6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/driver/mobile/gl/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const (
UnsignedByte = 0x1401
Float = 0x1406
RGBA = 0x1908
LUMINANCE = 0x1909

Nearest = 0x2600
Linear = 0x2601
Expand Down
1 change: 1 addition & 0 deletions internal/driver/mobile/gl/fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const (
glfnGetTexParameteriv
glfnGetUniformLocation
glfnLinkProgram
glfnPixelStorei
glfnReadPixels
glfnScissor
glfnShaderSource
Expand Down
10 changes: 10 additions & 0 deletions internal/driver/mobile/gl/gl.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,16 @@ func (ctx *context) LinkProgram(p Program) {
})
}

func (ctx *context) PixelStorei(pname Enum, param int32) {
ctx.enqueue(call{
args: fnargs{
fn: glfnPixelStorei,
a0: pname.c(),
a2: uintptr(param),
},
})
}

func (ctx *context) ReadPixels(dst []byte, x, y, width, height int, format, ty Enum) {
ctx.enqueue(call{
args: fnargs{
Expand Down
2 changes: 1 addition & 1 deletion internal/painter/gl/gl_gomobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (c *mobileContext) LinkProgram(program Program) {
}

func (c *mobileContext) PixelStorei(pname uint32, param int32) {
gl.PixelStorei(pname, param)
c.glContext.PixelStorei(pname, param)
}

func (c *mobileContext) ReadBuffer(_ uint32) {
Expand Down

0 comments on commit 572fa6b

Please sign in to comment.