Skip to content

Commit 86d8f0a

Browse files
authored
Merge pull request #75 from dertseha/upgrade
use checkptr safe functions, general upgrade
2 parents b38b3a6 + 998dead commit 86d8f0a

File tree

9 files changed

+70
-33
lines changed

9 files changed

+70
-33
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: golangci-lint
2+
on: [push, pull_request]
3+
jobs:
4+
golangci:
5+
name: lint
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Install libraries
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install -y mesa-utils mesa-common-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libxxf86vm-dev libglfw3-dev
13+
14+
- name: golangci-lint
15+
uses: golangci/[email protected]
16+
with:
17+
version: v1.39.0

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Main
2+
on: [push, pull_request]
3+
jobs:
4+
5+
tests:
6+
name: ${{matrix.go-version}} ${{matrix.os}}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
go-version: [1.14, 1.16]
11+
os: [macos-latest, windows-latest, ubuntu-latest]
12+
steps:
13+
- name: Install dependencies (linux)
14+
if: ${{ matrix.os == 'ubuntu-latest' }}
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y mesa-utils mesa-common-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libxxf86vm-dev libglfw3-dev
18+
- name: Set up Go
19+
uses: actions/setup-go@v1
20+
with:
21+
go-version: ${{matrix.go-version}}
22+
- name: Print go version
23+
run: go version
24+
- name: Check out module
25+
uses: actions/checkout@v1
26+
with:
27+
fetch-depth: 1
28+
- name: Run tests
29+
run: go test -v -race ./...

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
run:
2+
deadline: 5m
3+
4+
issues:
5+
exclude-use-default: false # disable filtering of defaults for better zero-issue policy
6+
max-per-linter: 0 # disable limit; report all issues of a linter
7+
max-same-issues: 0 # disable limit; report all issues of the same issue

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# go-gl Examples [![Build Status](https://travis-ci.org/go-gl/example.svg?branch=master)](https://travis-ci.org/go-gl/example) [![GoDoc](https://godoc.org/github.com/go-gl/example?status.svg)](https://godoc.org/github.com/go-gl/example)
1+
# go-gl Examples [![Build Status](https://github.com/go-gl/example/actions/workflows/main.yml/badge.svg)](https://github.com/go-gl/example/actions/workflows/main.yml)
22

33
Basic Usage
44
-----------

gl21-cube/cube.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ func setupScene() {
123123
gl.LoadIdentity()
124124
}
125125

126-
func destroyScene() {
127-
}
128-
129126
func drawScene() {
130127
gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
131128

gl41core-cube/cube.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ func main() {
9797

9898
vertAttrib := uint32(gl.GetAttribLocation(program, gl.Str("vert\x00")))
9999
gl.EnableVertexAttribArray(vertAttrib)
100-
gl.VertexAttribPointer(vertAttrib, 3, gl.FLOAT, false, 5*4, gl.PtrOffset(0))
100+
gl.VertexAttribPointerWithOffset(vertAttrib, 3, gl.FLOAT, false, 5*4, 0)
101101

102102
texCoordAttrib := uint32(gl.GetAttribLocation(program, gl.Str("vertTexCoord\x00")))
103103
gl.EnableVertexAttribArray(texCoordAttrib)
104-
gl.VertexAttribPointer(texCoordAttrib, 2, gl.FLOAT, false, 5*4, gl.PtrOffset(3*4))
104+
gl.VertexAttribPointerWithOffset(texCoordAttrib, 2, gl.FLOAT, false, 5*4, 3*4)
105105

106106
// Configure global settings
107107
gl.Enable(gl.DEPTH_TEST)

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module github.com/go-gl/example
33
go 1.14
44

55
require (
6-
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
7-
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2
6+
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa
7+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb
8+
github.com/go-gl/mathgl v1.0.0
9+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
810
)

go.sum

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
2-
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
3-
github.com/go-gl/glfw v0.0.0-20200707082815-5321531c36a2 h1:tCvD9jzwA40XAvO3wIhY748dWrXyNJ0mDQ3pTvlHlXQ=
4-
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2 h1:Ac1OEHHkbAZ6EUnJahF0GKcU0FjPc/V8F1DvjhKngFE=
5-
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
1+
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa h1:yiL6tST9ZuWBXiymIdM0j6yeLwMVGXDoybpXqnbJpCk=
2+
github.com/go-gl/gl v0.0.0-20210426225639-a3bfa832c8aa/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
3+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw=
4+
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
5+
github.com/go-gl/mathgl v1.0.0 h1:t9DznWJlXxxjeeKLIdovCOVJQk/GzDEL7h/h+Ro2B68=
6+
github.com/go-gl/mathgl v1.0.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ=
7+
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
8+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk=
9+
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
10+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 commit comments

Comments
 (0)