tofu

Making something with OpenGL in Go
Log | Files | Refs

commit 58dfa4db77cc69654cded4da4554c84fee8f4c2a
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Wed, 16 Oct 2024 13:29:43 +0900

first

Diffstat:
Acmd/sample/main.go | 28++++++++++++++++++++++++++++
Adraw.go | 19+++++++++++++++++++
Ago.mod | 8++++++++
Ago.sum | 4++++
Atest.png | 0
5 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/cmd/sample/main.go b/cmd/sample/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "runtime" + "github.com/go-gl/glfw/v3.3/glfw" +) + +func init() { + runtime.LockOSThread() +} + +func main() { + err := glfw.Init() + if err != nil { + panic(err) + } + defer glfw.Terminate() + + window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil) + if err != nil { + panic(err) + } + window.MakeContextCurrent() + for !window.ShouldClose() { + window.SwapBuffers() + glfw.PollEvents() + } +} diff --git a/draw.go b/draw.go @@ -0,0 +1,19 @@ +package draw + +type Point struct { + X, Y int +} + +type Rectangle struct { + Min, Max Point +} + +type Display struct { + +} + +type Image struct { + Display *Display + R Rectangle + Clipr Rectangle +} diff --git a/go.mod b/go.mod @@ -0,0 +1,8 @@ +module git.mtkn.jp/draw + +go 1.23.1 + +require ( + github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect + github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect +) diff --git a/go.sum b/go.sum @@ -0,0 +1,4 @@ +github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 h1:5BVwOaUSBTlVZowGO6VZGw2H/zl9nrd3eCZfYV+NfQA= +github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a h1:vxnBhFDDT+xzxf1jTJKMKZw3H0swfWk9RpWbBbDK5+0= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/test.png b/test.png Binary files differ.