New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: fix x/mobile/gl just like c opengl or go-gl #19777

Open
fastfading opened this Issue Mar 30, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@fastfading

fastfading commented Mar 30, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.7

What operating system and processor architecture are you using (go env)?

mac os

What did you do?

migrate a program from pc to mobile
go get -u github.com/go-gl/glfw/v3.2/glfw --> golang.org/x/mobile/app
go get -u github.com/go-gl/gl/v2.1/gl --> golang.org/x/mobile/gl
go get -u github.com/timshannon/go-openal/openal --> golang.org/x/mobile/exp/audio/al
I wish to do the above change

What did you expect to see?

[golang.org/x/mobile/gl] act just like [github.com/go-gl/gl/v2.1/gl ]

What did you see instead?

There is lot of differences ,

//not implemented
gl.TexImage1D
gl.Begin(gl.TRIANGLE_STRIP)
gl.End()
gl.PushMatrix()
gl.PopMatrix()
gl.MatrixMode(gl.PROJECTION)
gl.TexCoord2f(1, 1)
gl.Vertex2f(x2, y2)
gl.Color4f(r, g, b, a)
gl.LoadIdentity()
gl.Ortho(0, float64(sys.scrrect[2]), 0, float64(sys.scrrect[3]), -1, 1)
gl.Translated(0, float64(sys.scrrect[3]), 0)

//interface/behaviour change
gl.GenTextures(1, &paltex) -->CreateTexture
gl.DeleteTextures(1, &paltex) --> DeleteTexture

//unclear
gl.Str(src) -->GetString(pname Enum) string ???
gl.DeleteObjectARB(fragObj) --> DeleteShader ????
gl.GetInfoLogARB -->GetProgramInfoLog| GetShaderInfoLog ????

@gopherbot gopherbot added this to the Unreleased milestone Mar 30, 2017

@strangebug

This comment has been minimized.

strangebug commented Apr 2, 2017

Hello,

The name of the package might be misleading, 'golang.org/x/mobile/gl' is built upon OpenGL ES 2.0 (w/ optional support for OpenGL 3.0) not the "desktop" OpenGL. OpenGL ES 2.0 dropped the support for the fixed pipeline so porting your code will a bit harder.

My two cents

@bradfitz bradfitz added the mobile label Jul 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment