mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
webgl: add BlendEquationSeparate and GetParameter4i
`GetParameter4i` can be used to retrieve the current scissor rect, or the curent viewport, which was previously impossible. Also adds `BlendEquationSeparate` which seemed to be missing. Also removes an instance of `do`.
This commit is contained in:
@@ -402,6 +402,9 @@ class WebGLInterface {
|
|||||||
BlendEquation: (mode) => {
|
BlendEquation: (mode) => {
|
||||||
this.ctx.blendEquation(mode);
|
this.ctx.blendEquation(mode);
|
||||||
},
|
},
|
||||||
|
BlendEquationSeparate: (modeRGB, modeAlpha) => {
|
||||||
|
this.ctx.blendEquationSeparate(modeRGB, modeAlpha);
|
||||||
|
},
|
||||||
BlendFunc: (sfactor, dfactor) => {
|
BlendFunc: (sfactor, dfactor) => {
|
||||||
this.ctx.blendFunc(sfactor, dfactor);
|
this.ctx.blendFunc(sfactor, dfactor);
|
||||||
},
|
},
|
||||||
@@ -633,6 +636,13 @@ class WebGLInterface {
|
|||||||
GetParameter: (pname) => {
|
GetParameter: (pname) => {
|
||||||
return this.ctx.getParameter(pname);
|
return this.ctx.getParameter(pname);
|
||||||
},
|
},
|
||||||
|
GetParameter4i: (pname, v0, v1, v2, v3) => {
|
||||||
|
const i4 = this.ctx.getParameter(pname);
|
||||||
|
this.mem.storeI32(v0, i4[0]);
|
||||||
|
this.mem.storeI32(v1, i4[1]);
|
||||||
|
this.mem.storeI32(v2, i4[2]);
|
||||||
|
this.mem.storeI32(v3, i4[3]);
|
||||||
|
},
|
||||||
GetProgramParameter: (program, pname) => {
|
GetProgramParameter: (program, pname) => {
|
||||||
return this.ctx.getProgramParameter(this.programs[program], pname)
|
return this.ctx.getProgramParameter(this.programs[program], pname)
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+2
@@ -54,6 +54,7 @@ foreign webgl {
|
|||||||
BindTexture :: proc(target: Enum, texture: Texture) ---
|
BindTexture :: proc(target: Enum, texture: Texture) ---
|
||||||
BlendColor :: proc(red, green, blue, alpha: f32) ---
|
BlendColor :: proc(red, green, blue, alpha: f32) ---
|
||||||
BlendEquation :: proc(mode: Enum) ---
|
BlendEquation :: proc(mode: Enum) ---
|
||||||
|
BlendEquationSeparate :: proc(modeRGB: Enum, modeAlpha: Enum) ---
|
||||||
BlendFunc :: proc(sfactor, dfactor: Enum) ---
|
BlendFunc :: proc(sfactor, dfactor: Enum) ---
|
||||||
BlendFuncSeparate :: proc(srcRGB, dstRGB, srcAlpha, dstAlpha: Enum) ---
|
BlendFuncSeparate :: proc(srcRGB, dstRGB, srcAlpha, dstAlpha: Enum) ---
|
||||||
|
|
||||||
@@ -113,6 +114,7 @@ foreign webgl {
|
|||||||
GetVertexAttribOffset :: proc(index: i32, pname: Enum) -> uintptr ---
|
GetVertexAttribOffset :: proc(index: i32, pname: Enum) -> uintptr ---
|
||||||
GetProgramParameter :: proc(program: Program, pname: Enum) -> i32 ---
|
GetProgramParameter :: proc(program: Program, pname: Enum) -> i32 ---
|
||||||
GetParameter :: proc(pname: Enum) -> i32 ---
|
GetParameter :: proc(pname: Enum) -> i32 ---
|
||||||
|
GetParameter4i :: proc(pname: Enum, v0, v1, v2, v4: ^i32) ---
|
||||||
|
|
||||||
Hint :: proc(target: Enum, mode: Enum) ---
|
Hint :: proc(target: Enum, mode: Enum) ---
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -29,7 +29,7 @@ CreateProgramFromStrings :: proc(vs_sources, fs_sources: []string) -> (program:
|
|||||||
}
|
}
|
||||||
|
|
||||||
program = CreateProgram()
|
program = CreateProgram()
|
||||||
defer if !ok do DeleteProgram(program)
|
defer if !ok { DeleteProgram(program) }
|
||||||
|
|
||||||
AttachShader(program, vs)
|
AttachShader(program, vs)
|
||||||
AttachShader(program, fs)
|
AttachShader(program, fs)
|
||||||
|
|||||||
Reference in New Issue
Block a user