forked from joejulian/gio
gpu/internal/opengl,app/internal/wm: generalize desktop OpenGL support
This changes moves the macOS specific setup for desktop OpenGL to the portable opengl package. The opengl package already takes care of the desktop OpenGL setup for sRGB framebuffers, and by moving the code we avoid calling the wrong OpenGL functions in case both OpenGL.framework and ANGLE libGLESv2.dylib is linked into the program. Remove the interface casting expressions for gl.Functions; it wasn't worth the trouble to keep updated. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -93,6 +93,9 @@ func (f *Functions) BindTexture(target Enum, t Texture) {
|
||||
func (f *Functions) BindImageTexture(unit int, t Texture, level int, layered bool, layer int, access, format Enum) {
|
||||
panic("not implemented")
|
||||
}
|
||||
func (f *Functions) BindVertexArray(a VertexArray) {
|
||||
panic("not supported")
|
||||
}
|
||||
func (f *Functions) BlendEquation(mode Enum) {
|
||||
f.Ctx.Call("blendEquation", int(mode))
|
||||
}
|
||||
@@ -144,6 +147,9 @@ func (f *Functions) CreateShader(ty Enum) Shader {
|
||||
func (f *Functions) CreateTexture() Texture {
|
||||
return Texture(f.Ctx.Call("createTexture"))
|
||||
}
|
||||
func (f *Functions) CreateVertexArray() VertexArray {
|
||||
panic("not supported")
|
||||
}
|
||||
func (f *Functions) DeleteBuffer(v Buffer) {
|
||||
f.Ctx.Call("deleteBuffer", js.Value(v))
|
||||
}
|
||||
@@ -169,6 +175,9 @@ func (f *Functions) DeleteRenderbuffer(v Renderbuffer) {
|
||||
func (f *Functions) DeleteTexture(v Texture) {
|
||||
f.Ctx.Call("deleteTexture", js.Value(v))
|
||||
}
|
||||
func (f *Functions) DeleteVertexArray(a VertexArray) {
|
||||
panic("not implemented")
|
||||
}
|
||||
func (f *Functions) DepthFunc(fn Enum) {
|
||||
f.Ctx.Call("depthFunc", int(fn))
|
||||
}
|
||||
@@ -206,6 +215,9 @@ func (f *Functions) EndQuery(target Enum) {
|
||||
func (f *Functions) Finish() {
|
||||
f.Ctx.Call("finish")
|
||||
}
|
||||
func (f *Functions) Flush() {
|
||||
f.Ctx.Call("flush")
|
||||
}
|
||||
func (f *Functions) FramebufferRenderbuffer(target, attachment, renderbuffertarget Enum, renderbuffer Renderbuffer) {
|
||||
f.Ctx.Call("framebufferRenderbuffer", int(target), int(attachment), int(renderbuffertarget), js.Value(renderbuffer))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user