updated go-gl, imgui-go and go-sdl2

go-gl update fixes https://github.com/JetSetIlly/Gopher2600/issues/7
This commit is contained in:
JetSetIlly 2021-05-09 07:28:46 +01:00
parent be5c27231e
commit a3e398b6bd
5 changed files with 17 additions and 11 deletions

View file

@ -1,9 +1,10 @@
compileFlags = '-c 3 -B -wb=false'
#profilingRom = roms/Homebrew/CDF/galaga_dmo_v2_NTSC.bin
#profilingRom = roms/Homebrew/DPC+ARM/ZaxxonHDDemo_150927_NTSC.bin
profilingRom = roms/Rsboxing.bin
#profilingRom = roms/Rsboxing.bin
#profilingRom = "test_roms/plusrom/sokoboo Plus.bin"
#profilingRom = "roms/starpath/02 - Communist Mutants From Space (Ntsc).mp3"
profilingRom = roms/Pitfall.bin
.PHONY: all clean tidy generate check_lint lint check_glsl glsl_validate check_pandoc readme_spell test race profile build_assertions build check_upx release release_statsview cross_windows cross_windows_statsview binaries check_gotip build_with_gotip
@ -58,7 +59,8 @@ test:
race: generate test
# disable checkptr because the opengl implementation will trigger it and cause
# a lot of output noise
go run -race -gcflags=all=-d=checkptr=0 gopher2600.go $(profilingRom)
# go run -race -gcflags=all=-d=checkptr=0 gopher2600.go $(profilingRom)
go run -race gopher2600.go $(profilingRom)
profile: generate test
go build -gcflags $(compileFlags)

6
go.mod
View file

@ -11,9 +11,9 @@ require (
github.com/go-audio/audio v1.0.0
github.com/go-audio/wav v1.0.0
github.com/go-echarts/statsview v0.3.1
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa
github.com/hajimehoshi/go-mp3 v0.3.1
github.com/inkyblackness/imgui-go/v4 v4.1.1-0.20210318203605-5b07f5877b09
github.com/inkyblackness/imgui-go/v4 v4.2.0
github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942
github.com/veandco/go-sdl2 v0.4.4
github.com/veandco/go-sdl2 v0.4.5
)

6
go.sum
View file

@ -27,6 +27,8 @@ github.com/go-echarts/statsview v0.3.1 h1:yKuOnxezlyjcBjwa3yrbClLlHWrbV5EGLriay/
github.com/go-echarts/statsview v0.3.1/go.mod h1:AehKjL9cTFMeIo5QdV8sQO43vFmfY65X5GMWa3XMciY=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa h1:yiL6tST9ZuWBXiymIdM0j6yeLwMVGXDoybpXqnbJpCk=
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
github.com/hajimehoshi/go-mp3 v0.3.1 h1:pn/SKU1+/rfK8KaZXdGEC2G/KCB2aLRjbTCrwKcokao=
github.com/hajimehoshi/go-mp3 v0.3.1/go.mod h1:qMJj/CSDxx6CGHiZeCgbiq2DSUkbK0UbtXShQcnfyMM=
github.com/hajimehoshi/oto v0.6.1 h1:7cJz/zRQV4aJvMSSRqzN2TImoVVMpE0BCY4nrNJaDOM=
@ -37,6 +39,8 @@ github.com/inkyblackness/imgui-go/v4 v4.0.2-0.20210227151036-ebf5e2d398c1 h1:Rwv
github.com/inkyblackness/imgui-go/v4 v4.0.2-0.20210227151036-ebf5e2d398c1/go.mod h1:g8SAGtOYUP7rYaOB2AsVKCEHmPMDmJKgt4z6d+flhb0=
github.com/inkyblackness/imgui-go/v4 v4.1.1-0.20210318203605-5b07f5877b09 h1:kfAMZNZD16CAz/nfreSaziA9qflIGKI80z+AR3l7qjc=
github.com/inkyblackness/imgui-go/v4 v4.1.1-0.20210318203605-5b07f5877b09/go.mod h1:g8SAGtOYUP7rYaOB2AsVKCEHmPMDmJKgt4z6d+flhb0=
github.com/inkyblackness/imgui-go/v4 v4.2.0 h1:5MuhU1tocnrHDZHyHTArzYr1X0+oA3ITleEwgx9juQ4=
github.com/inkyblackness/imgui-go/v4 v4.2.0/go.mod h1:g8SAGtOYUP7rYaOB2AsVKCEHmPMDmJKgt4z6d+flhb0=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
@ -58,6 +62,8 @@ github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgh
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/veandco/go-sdl2 v0.4.4 h1:coOJGftOdvNvGoUIZmm4XD+ZRQF4mg9ZVHmH3/42zFQ=
github.com/veandco/go-sdl2 v0.4.4/go.mod h1:FB+kTpX9YTE+urhYiClnRzpOXbiWgaU3+5F2AB78DPg=
github.com/veandco/go-sdl2 v0.4.5 h1:GFIjMabK7y2XWpr9sGvN7RDKHt7vrA7XPTUW60eOw+Y=
github.com/veandco/go-sdl2 v0.4.5/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067 h1:KYGJGHOQy8oSi1fDlSpcZF0+juKwk/hEMv5SiwHogR0=

View file

@ -17,7 +17,6 @@ package sdlimgui
import (
"fmt"
"unsafe"
"github.com/go-gl/gl/v3.2-core/gl"
"github.com/inkyblackness/imgui-go/v4"
@ -253,7 +252,7 @@ func (rnd *glsl) render() {
}
env.draw = func() {
gl.DrawElements(gl.TRIANGLES, int32(cmd.ElementCount()), uint32(drawType), unsafe.Pointer(indexBufferOffset))
gl.DrawElementsWithOffset(gl.TRIANGLES, int32(cmd.ElementCount()), uint32(drawType), indexBufferOffset)
}
// set attributes for the selected shader

View file

@ -18,7 +18,6 @@ package sdlimgui
import (
"strings"
"time"
"unsafe"
"github.com/go-gl/gl/v3.2-core/gl"
"github.com/inkyblackness/imgui-go/v4"
@ -98,9 +97,9 @@ func (sh *shader) setAttributes(env shaderEnvironment) {
gl.EnableVertexAttribArray(uint32(sh.color))
vertexSize, vertexOffsetPos, vertexOffsetUv, vertexOffsetCol := imgui.VertexBufferLayout()
gl.VertexAttribPointer(uint32(sh.uv), 2, gl.FLOAT, false, int32(vertexSize), unsafe.Pointer(uintptr(vertexOffsetUv)))
gl.VertexAttribPointer(uint32(sh.position), 2, gl.FLOAT, false, int32(vertexSize), unsafe.Pointer(uintptr(vertexOffsetPos)))
gl.VertexAttribPointer(uint32(sh.color), 4, gl.UNSIGNED_BYTE, true, int32(vertexSize), unsafe.Pointer(uintptr(vertexOffsetCol)))
gl.VertexAttribPointerWithOffset(uint32(sh.uv), 2, gl.FLOAT, false, int32(vertexSize), uintptr(vertexOffsetUv))
gl.VertexAttribPointerWithOffset(uint32(sh.position), 2, gl.FLOAT, false, int32(vertexSize), uintptr(vertexOffsetPos))
gl.VertexAttribPointerWithOffset(uint32(sh.color), 4, gl.UNSIGNED_BYTE, true, int32(vertexSize), uintptr(vertexOffsetCol))
}
// compile and link shader programs