Skip to content

Commit 80f3a49

Browse files
committed
Git broke
1 parent 659f9ca commit 80f3a49

File tree

8 files changed

+172
-0
lines changed

8 files changed

+172
-0
lines changed

.github/workflows/format.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Go Format Check
2+
3+
on:
4+
push:
5+
branches:
6+
- latest
7+
- stable
8+
9+
pull_request:
10+
branches:
11+
- latest
12+
- stable
13+
jobs:
14+
go-fmt-check:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v3
23+
with:
24+
go-version: '1.22'
25+
26+
- name: Check Go format
27+
run: |
28+
files=$(gofmt -l .)
29+
if [ -n "$files" ]; then
30+
echo "Following files arent formatted:"
31+
echo "$files"
32+
exit 1
33+
else
34+
echo "Everything is formatted."
35+
fi
36+

internal/gl/legacy/legacy.go

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package gl
2+
3+
/*
4+
#cgo linux LDFLAGS: -lGL
5+
#cgo darwin LDFLAGS: -framework OpenGL
6+
#cgo windows LDFLAGS: -lopengl32
7+
#include "../opengl/gl.h"
8+
*/
9+
import "C"
10+
import "unsafe"
11+
12+
const (
13+
TEXTURE_2D = uint32(C.GL_TEXTURE_2D)
14+
TEXTURE_WRAP_S = uint32(C.GL_TEXTURE_WRAP_S)
15+
TEXTURE_WRAP_T = uint32(C.GL_TEXTURE_WRAP_T)
16+
TEXTURE_MIN_FILTER = uint32(C.GL_TEXTURE_MIN_FILTER)
17+
TEXTURE_MAG_FILTER = uint32(C.GL_TEXTURE_MAG_FILTER)
18+
CLAMP_TO_EDGE = uint32(C.GL_CLAMP_TO_EDGE)
19+
LINEAR = uint32(C.GL_LINEAR)
20+
21+
LINES = uint32(C.GL_LINES)
22+
QUADS = uint32(C.GL_QUADS)
23+
24+
RGBA = uint32(C.GL_RGBA)
25+
UNSIGNED_BYTE = uint32(C.GL_UNSIGNED_BYTE)
26+
27+
SRC_ALPHA = uint32(C.GL_SRC_ALPHA)
28+
ONE_MINUS_SRC_ALPHA = uint32(C.GL_ONE_MINUS_SRC_ALPHA)
29+
BLEND = uint32(C.GL_BLEND)
30+
DEPTH_BUFFER_BIT = uint32(C.GL_DEPTH_BUFFER_BIT)
31+
COLOR_BUFFER_BIT = uint32(C.GL_COLOR_BUFFER_BIT)
32+
)
33+
34+
func Begin(state uint32) {
35+
C.glBegin(C.uint(state))
36+
}
37+
38+
func End() {
39+
C.glEnd()
40+
}
41+
42+
func Color3f(r, g, b float32) {
43+
C.glColor3f(C.float(r), C.float(g), C.float(b))
44+
}
45+
46+
func Color4f(r, g, b, a float32) {
47+
C.glColor4f(C.float(r), C.float(g), C.float(b), C.float(a))
48+
}
49+
50+
func Vertex2f(x, y float32) {
51+
C.glVertex2f(C.float(x), C.float(y))
52+
}
53+
54+
func ClearColor(r, g, b, a float32) {
55+
C.glClearColor(C.float(r), C.float(g), C.float(b), C.float(a))
56+
}
57+
58+
func GenTextures(n int32, textures *uint32) {
59+
C.glGenTextures(C.int(n), (*C.uint)(unsafe.Pointer(textures)))
60+
}
61+
62+
func DeleteTextures(n int, textures *uint32) {
63+
C.glDeleteTextures(C.int(n), (*C.uint)(unsafe.Pointer(textures)))
64+
}
65+
66+
func BindTexture(target, texture uint32) {
67+
C.glBindTexture(C.uint(target), C.uint(texture))
68+
}
69+
70+
func TexParameteri(target, pname, param uint32) {
71+
C.glTexParameteri(C.uint(target), C.uint(pname), C.int(param))
72+
}
73+
74+
func TexCoord2f(s, t float32) {
75+
C.glTexCoord2f(C.float(s), C.float(t))
76+
}
77+
78+
func TexImage2D(target, level, internalFormat uint32, width, height int, border, format, typ uint32, pixels []byte) {
79+
C.glTexImage2D(C.uint(target), C.int(level), C.int(internalFormat), C.int(width), C.int(height), C.int(border), C.uint(format), C.uint(typ), C.CBytes(pixels))
80+
}
81+
82+
func Clear(mask uint32) {
83+
C.glClear(C.uint(mask))
84+
}
85+
86+
func Enable(cap uint32) {
87+
C.glEnable(C.uint(cap))
88+
}
89+
90+
func BlendFunc(sfactor, dfactor uint32) {
91+
C.glBlendFunc(C.uint(sfactor), C.uint(dfactor))
92+
}
93+
94+
func Ortho(left, right, bottom, top, near, far float64) {
95+
C.glOrtho(C.double(left), C.double(right), C.double(bottom), C.double(top), C.double(near), C.double(far))
96+
}
97+
98+
func Viewport(x, y, width, height int) {
99+
C.glViewport(C.int(x), C.int(y), C.int(width), C.int(height))
100+
}
101+
102+
func LineWidth(width float32) {
103+
C.glLineWidth(C.float(width))
104+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 📋 Contribution guidelines
2+
3+
## 📜 Rules
4+
We are happy and welcome if you want to contribute to Vuelto. But please consider a few details before continuing:
5+
1. Fork: Please before working, make sure you forked the repo and are working inside the fork
6+
2. Branch: Please before working in your own fork, make sure you are in the `latest` branch.
7+
3. Explain: Please explain why this should be considered and merged. That can increase he chance for us to merge and will safe the maintainers time.
8+
4. Test: Please test your code before even opening a new pull request. Make sure the CI doesnt fail.
9+
5. Documentation: Please, if your adding something new, like a feature, please document everything.
10+
6. Format: Please, run `make format` for formatting of the code. Without this we won't merge your code
11+
7. CI: We cannot merge if the CI fails. Incase that it fails, please fix your code or fix the CI (only incase of breaking changes or improvements).
12+
13+
## ⚠️ Not following these rules
14+
If we see a pull request that doesn't follow these rules, we will tell you that, and close the pull request.
15+
We allow you to re-open a new pull request, but we expect you to have your code fixed.
16+
So make sure that you followed the rules from above.
17+
18+
## 🔄 Pull Request
19+
If you're ready with your changes, then you must follow a few steps before pull requesting.
20+
First, run our make command to format your code:
21+
```bash
22+
make format
23+
```
24+
25+
Then make sure your pull request code works without erroring and you followed the contribution rules from above.
26+
27+
After all of this, you can create a pull request and one of the maintainers will take a look at it. Please have patience.

website/docs/developers/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 💻 Developers Guide
2+
Hey and welcome to the developers part of the docs! This part is focused on people who want to contribute or develop Vuelto. Here you will find couple of things that guide you through how you can help vuelto, how you could setup your development enviorment and the Vuelto codebase structure. Also here you could go through couple of contributing guidelines that you should read before contributing. Not following these, a maintainer has the right to close/not-accept the pull request. Anyways, lets get to work, shall we?
3+
4+
## 📑 Table of contents
5+
- [Contributing guidelines](contribution.md)

website/docs/latest/audio.md

Whitespace-only changes.

website/docs/latest/math.md

Whitespace-only changes.

website/docs/latest/renderer.md

Whitespace-only changes.

website/docs/latest/windowing.md

Whitespace-only changes.

0 commit comments

Comments
 (0)