Skip to content

Commit

Permalink
Git broke
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Jul 22, 2024
1 parent 659f9ca commit 80f3a49
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Go Format Check

on:
push:
branches:
- latest
- stable

pull_request:
branches:
- latest
- stable
jobs:
go-fmt-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'

- name: Check Go format
run: |
files=$(gofmt -l .)
if [ -n "$files" ]; then
echo "Following files arent formatted:"
echo "$files"
exit 1
else
echo "Everything is formatted."
fi
104 changes: 104 additions & 0 deletions internal/gl/legacy/legacy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package gl

/*
#cgo linux LDFLAGS: -lGL
#cgo darwin LDFLAGS: -framework OpenGL
#cgo windows LDFLAGS: -lopengl32
#include "../opengl/gl.h"
*/
import "C"
import "unsafe"

const (
TEXTURE_2D = uint32(C.GL_TEXTURE_2D)
TEXTURE_WRAP_S = uint32(C.GL_TEXTURE_WRAP_S)
TEXTURE_WRAP_T = uint32(C.GL_TEXTURE_WRAP_T)
TEXTURE_MIN_FILTER = uint32(C.GL_TEXTURE_MIN_FILTER)
TEXTURE_MAG_FILTER = uint32(C.GL_TEXTURE_MAG_FILTER)
CLAMP_TO_EDGE = uint32(C.GL_CLAMP_TO_EDGE)
LINEAR = uint32(C.GL_LINEAR)

LINES = uint32(C.GL_LINES)
QUADS = uint32(C.GL_QUADS)

RGBA = uint32(C.GL_RGBA)
UNSIGNED_BYTE = uint32(C.GL_UNSIGNED_BYTE)

SRC_ALPHA = uint32(C.GL_SRC_ALPHA)
ONE_MINUS_SRC_ALPHA = uint32(C.GL_ONE_MINUS_SRC_ALPHA)
BLEND = uint32(C.GL_BLEND)
DEPTH_BUFFER_BIT = uint32(C.GL_DEPTH_BUFFER_BIT)
COLOR_BUFFER_BIT = uint32(C.GL_COLOR_BUFFER_BIT)
)

func Begin(state uint32) {
C.glBegin(C.uint(state))
}

func End() {
C.glEnd()
}

func Color3f(r, g, b float32) {
C.glColor3f(C.float(r), C.float(g), C.float(b))
}

func Color4f(r, g, b, a float32) {
C.glColor4f(C.float(r), C.float(g), C.float(b), C.float(a))
}

func Vertex2f(x, y float32) {
C.glVertex2f(C.float(x), C.float(y))
}

func ClearColor(r, g, b, a float32) {
C.glClearColor(C.float(r), C.float(g), C.float(b), C.float(a))
}

func GenTextures(n int32, textures *uint32) {
C.glGenTextures(C.int(n), (*C.uint)(unsafe.Pointer(textures)))
}

func DeleteTextures(n int, textures *uint32) {
C.glDeleteTextures(C.int(n), (*C.uint)(unsafe.Pointer(textures)))
}

func BindTexture(target, texture uint32) {
C.glBindTexture(C.uint(target), C.uint(texture))
}

func TexParameteri(target, pname, param uint32) {
C.glTexParameteri(C.uint(target), C.uint(pname), C.int(param))
}

func TexCoord2f(s, t float32) {
C.glTexCoord2f(C.float(s), C.float(t))
}

func TexImage2D(target, level, internalFormat uint32, width, height int, border, format, typ uint32, pixels []byte) {
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))
}

func Clear(mask uint32) {
C.glClear(C.uint(mask))
}

func Enable(cap uint32) {
C.glEnable(C.uint(cap))
}

func BlendFunc(sfactor, dfactor uint32) {
C.glBlendFunc(C.uint(sfactor), C.uint(dfactor))
}

func Ortho(left, right, bottom, top, near, far float64) {
C.glOrtho(C.double(left), C.double(right), C.double(bottom), C.double(top), C.double(near), C.double(far))
}

func Viewport(x, y, width, height int) {
C.glViewport(C.int(x), C.int(y), C.int(width), C.int(height))
}

func LineWidth(width float32) {
C.glLineWidth(C.float(width))
}
27 changes: 27 additions & 0 deletions website/docs/developers/contribution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 📋 Contribution guidelines

## 📜 Rules
We are happy and welcome if you want to contribute to Vuelto. But please consider a few details before continuing:
1. Fork: Please before working, make sure you forked the repo and are working inside the fork
2. Branch: Please before working in your own fork, make sure you are in the `latest` branch.
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.
4. Test: Please test your code before even opening a new pull request. Make sure the CI doesnt fail.
5. Documentation: Please, if your adding something new, like a feature, please document everything.
6. Format: Please, run `make format` for formatting of the code. Without this we won't merge your code
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).

## ⚠️ Not following these rules
If we see a pull request that doesn't follow these rules, we will tell you that, and close the pull request.
We allow you to re-open a new pull request, but we expect you to have your code fixed.
So make sure that you followed the rules from above.

## 🔄 Pull Request
If you're ready with your changes, then you must follow a few steps before pull requesting.
First, run our make command to format your code:
```bash
make format
```

Then make sure your pull request code works without erroring and you followed the contribution rules from above.

After all of this, you can create a pull request and one of the maintainers will take a look at it. Please have patience.
5 changes: 5 additions & 0 deletions website/docs/developers/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 💻 Developers Guide
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?

## 📑 Table of contents
- [Contributing guidelines](contribution.md)
Empty file added website/docs/latest/audio.md
Empty file.
Empty file added website/docs/latest/math.md
Empty file.
Empty file added website/docs/latest/renderer.md
Empty file.
Empty file.

0 comments on commit 80f3a49

Please sign in to comment.