This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Builder = @import("std").build.Builder; | |
pub fn build(b: *Builder) void { | |
const mode = b.standardReleaseOptions(); | |
const exe = b.addExecutable("sdl-zig-demo", "src/main.zig"); | |
exe.setBuildMode(mode); | |
exe.linkSystemLibrary("SDL2"); | |
exe.linkSystemLibrary("c"); | |
exe.install(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: all build compile clean | |
all: build compile | |
build: | |
go build -buildmode=c-shared -o libhello.so libhello.go | |
compile: | |
cc -o hello hello.c libhello.so | |
clean: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
_ "image/png" | |
"time" | |
"github.com/adamstimb/nimgobus" | |
"github.com/hajimehoshi/ebiten" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package acnl | |
import ( | |
"bytes" | |
"encoding/binary" | |
"image" | |
"image/color" | |
"io" | |
"io/ioutil" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"net/http" | |
"net/url" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"bytes" | |
"image/color" | |
"image/draw" | |
"net/http" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"image" | |
"image/color" | |
"time" | |
"github.com/peterhellberg/gfx" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"image" | |
"image/draw" | |
"time" | |
"github.com/peterhellberg/gfx" | |
"github.com/peterhellberg/gui" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/peterhellberg/gfx" | |
var ( | |
p = gfx.PaletteAmmo8 | |
dst = gfx.NewImage(256, 256, p[1]) | |
p0 = gfx.V(16, 192) | |
p1 = gfx.V(32, 8) | |
p2 = gfx.V(192, 244) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"image" | |
"io" | |
"math" | |
"os" | |
"strings" |