code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bind import ( "fmt" "go/token" "log" "golang.org/x/tools/go/types" ) type goGen struct { *printer fset *token.FileSet pkg *types.Package err...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bind import ( "bytes" "fmt" "go/token" "io" "regexp" "unicode" "unicode/utf8" "golang.org/x/tools/go/types" ) // TODO(crawshaw): disallow bas...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package java //#cgo LDFLAGS: -llog //#include <android/log.h> //#include <stdint.h> //#include <string.h> //#include "seq_android.h" import "C" import ( "fmt"...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //+build ignore package main import ( "golang.org/x/mobile/app" _ "golang.org/x/mobile/bind/java" _ "golang.org/x/mobile/bind/java/testpkg/go_testpkg" ) ...
Go
// Package testpkg contains bound functions for testing the cgo-JNI interface. package testpkg import ( "fmt" "runtime" "time" ) type I interface { F() } func Call(i I) { i.F() } var keep []I func Keep(i I) { keep = append(keep, i) } var numSCollected int type S struct { // *S already has a finalizer, so ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq //#cgo LDFLAGS: -llog //#include <android/log.h> //#include <string.h> //import "C" import ( "fmt" "sync" ) // refs stores Go objects that have...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq import ( "fmt" "unicode/utf16" "unsafe" ) // Based heavily on package unicode/utf16 from the Go standard library. const ( replacementChar = '...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq import ( "bytes" "fmt" "runtime" "unsafe" ) // Buffer is a set of arguments or return values from a function call // across the language bound...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !android package app import ( "os" "path/filepath" ) // Logic shared by desktop debugging implementations. func openAsset(name string) (ReadSeek...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,!android package app /* Simple on-screen app debugging for X11. Not an officially supported development target for apps, as screens with mice ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package app // Simple on-screen app debugging for OS X. Not an officially supported // development target for apps, as screens with mice are ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app import ( "io" "golang.org/x/mobile/event" ) // Run starts the app. // // It must be called directly from from the main function and will // blo...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app // Android redirects stdout and stderr to /dev/null. // As these are common debugging utilities in Go, // we redirect them to logcat. // // Unfortu...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build android // Go runtime entry point for apps running on android. // Sets up everything the runtime needs and exposes // the entry point to JNI. packag...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app /* #cgo android LDFLAGS: -llog -landroid -lEGL -lGLESv2 #include <android/log.h> #include <android/native_activity.h> #include <android/input.h> #i...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package app lets you write Apps for Android (and eventually, iOS). There are two ways to use Go in an Android App. The first is as a library called from Jav...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // A Mat3 is a 3x3 matrix of float32 values. // Elements are indexed first by row then column, i.e. m[row][column]. type Mat3 [3]Vec3...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" type Vec3 [3]float32 func (v Vec3) String() string { return fmt.Sprintf("Vec3[% 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2]) } func (...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // An Affine is a 3x3 matrix of float32 values for which the bottom row is // implicitly always equal to [0 0 1]. // Elements are ind...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main /* This program generates table.go. Invoke it as: go run gen.go -output table.go */ import ( "bytes" "flag" "fmt" "go/forma...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go -output table.go // Package f32 implements some linear algebra and GL helpers for float32s. // // Types defined in this package hav...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" type Vec4 [4]float32 func (v Vec4) String() string { return fmt.Sprintf("Vec4[% 0.3f, % 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2], v...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // A Mat4 is a 4x4 matrix of float32 values. // Elements are indexed first by row then column, i.e. m[row][column]. type Mat4 [4]Vec4...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "go/build" "log" "os" ) var lang = flag.String("lang", "java", "target language for bindings, either java or go") va...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "os" "path/filepath" "go/ast" "go/build" "go/parser" "go/scanner" "go/token" "golang.org/x/mobile/bind" "golang.org/x/tools/g...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Gobind generates language bindings that make it possible to call Go code and pass objects from Java. Using gobind Gobind takes a Go package and generates ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package geom defines a two-dimensional coordinate system. The coordinate system is based on an left-handed Cartesian plane. That is, X increases to the righ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package event defines user input events. package event /* The best source on android input events is the NDK: include/android/input.h iOS event handling gu...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package glsprite blah blah blah TODO. package glsprite import ( "image" "image/draw" "golang.org/x/mobile/f32" "golang.org/x/mobile/geom" "golang.org/...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package sprite provides a 2D scene graph for rendering and animation. // // A tree of nodes is drawn by a rendering Engine, provided by another // package. T...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package portable implements a sprite Engine using the image package. // // It is intended to serve as a reference implementation for testing // other sprite ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/draw" "golang.org/x/mobile/f32" ) // affine draws each pixel of dst using bilinear interpolation of the // affine...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/color" "math" ) func bilinear(src image.Image, x, y float32) color.Color { switch src := src.(type) { case *imag...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package clock provides a clock and time functions for a sprite engine. package clock // A Time represents an instant in sprite time. // // The application u...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package clock // Standard tween functions. // // Easing means a slowing near the timing boundary, as defined by // a cubic bezier curve. Exact parameters match...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl // TODO(crawshaw): build on more host platforms (makes it easier to gobind). // TODO(crawshaw): expand to cover OpenGL ES 3. //...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package glutil implements OpenGL utility functions. package glutil import ( "fmt" "golang.org/x/mobile/gl" ) // CreateProgram creates, compiles, and lin...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package glutil import ( "encoding/binary" "image" "sync" "golang.org/x/mobile/f32" "golang.org/x/mobile/geom" "golang.org/x/mobile/gl" ) var glimage st...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,!android package glutil /* #cgo LDFLAGS: -lEGL #include <EGL/egl.h> #include <stdio.h> #include <stdlib.h> void createContext(EGLDisplay *out...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package glutil // TODO(crawshaw): Only used in glutil tests for now (cgo is not support in _test.go files). // TODO(crawshaw): Export some ki...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <GLES2/gl2.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLclampf { return C.GLclampf(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <OpenGL/gl3.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLfloat { return C.GLfloat(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl /* #cgo darwin LDFLAGS: -framework OpenGL #cgo linux LDFLAGS: -lGLESv2 #cgo darwin CFLAGS: -DGOOS_darwin #cgo linux CFLAG...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // The gendebug program takes gl.go and generates a version of it // where each function includes tracing code that writes its arguments // t...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build gldebug package gl // Alternate versions of the types defined in types.go with extra // debugging information attached. For documentation, see type...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl /* Partially generated from the Khronos OpenGL API specification in XML format, which is covered by the license: Copyright (c) 2013-2014 The Khro...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl // This file contains GL Types and their methods that are independent of the // "gldebug" build tag. import "golang.org/x/mobile/f32" // WriteAff...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gl implements Go bindings for OpenGL ES 2. The bindings are deliberately minimal, staying as close the C API as possible. The semantics of each fun...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // An app that draws a green triangle on a red background. package main import ( "encoding/binary" "log" "golang.org/x/mobile/app" "golang.org/x/mobile/ap...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This example program compiles to a gojni.so shared library, that can be loaded from an android application. Build it by configuring a cross compiler (see go....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main // #cgo LDFLAGS: -llog // #include <android/log.h> // #include <string.h> import "C" import ( "fmt" "unsafe" ) //export LogHello func LogHello(...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "image" "log" "math" "os" "time" _ "image/jpeg" "golang.org/x/mobile/app" "golang.org/x/mobile/app/debug" "golang.org/x/mobile...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This is the Go entry point for the libhello app. // It is invoked from Java. // // See README for details. package main import ( "golang.org/x/mobile/app" ...
Go
// Package hi provides a function for saying hello. package hi import "fmt" func Hello(name string) { fmt.Printf("Hello, %s!\n", name) }
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bind import ( "bytes" "fmt" ) type printer struct { buf *bytes.Buffer indentEach []byte indentText []byte needIndent bool } func (p *pri...
Go
package bind import ( "fmt" "golang.org/x/tools/go/types" ) // seqType returns a string that can be used for reading and writing a // type using the seq library. func seqType(t types.Type) string { if isErrorType(t) { return "UTF16" } switch t := t.(type) { case *types.Basic: switch t.Kind() { case types...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package bind implements a code generator for gobind. // // See the documentation on the gobind command for usage details. package bind // TODO(crawshaw): sl...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bind import ( "fmt" "go/token" "log" "golang.org/x/tools/go/types" ) type goGen struct { *printer fset *token.FileSet pkg *types.Package err...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package bind import ( "bytes" "fmt" "go/token" "io" "regexp" "unicode" "unicode/utf8" "golang.org/x/tools/go/types" ) // TODO(crawshaw): disallow bas...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package java //#cgo LDFLAGS: -llog //#include <android/log.h> //#include <stdint.h> //#include <string.h> //#include "seq_android.h" import "C" import ( "fmt"...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //+build ignore package main import ( "golang.org/x/mobile/app" _ "golang.org/x/mobile/bind/java" _ "golang.org/x/mobile/bind/java/testpkg/go_testpkg" ) ...
Go
// Package testpkg contains bound functions for testing the cgo-JNI interface. package testpkg import ( "fmt" "runtime" "time" ) type I interface { F() } func Call(i I) { i.F() } var keep []I func Keep(i I) { keep = append(keep, i) } var numSCollected int type S struct { // *S already has a finalizer, so ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq //#cgo LDFLAGS: -llog //#include <android/log.h> //#include <string.h> //import "C" import ( "fmt" "sync" ) // refs stores Go objects that have...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq import ( "fmt" "unicode/utf16" "unsafe" ) // Based heavily on package unicode/utf16 from the Go standard library. const ( replacementChar = '...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package seq import ( "bytes" "fmt" "runtime" "unsafe" ) // Buffer is a set of arguments or return values from a function call // across the language bound...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !android package app import ( "os" "path/filepath" ) // Logic shared by desktop debugging implementations. func openAsset(name string) (ReadSeek...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,!android package app /* Simple on-screen app debugging for X11. Not an officially supported development target for apps, as screens with mice ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package app // Simple on-screen app debugging for OS X. Not an officially supported // development target for apps, as screens with mice are ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app import ( "io" "golang.org/x/mobile/event" ) // Run starts the app. // // It must be called directly from from the main function and will // blo...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app // Android redirects stdout and stderr to /dev/null. // As these are common debugging utilities in Go, // we redirect them to logcat. // // Unfortu...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build android // Go runtime entry point for apps running on android. // Sets up everything the runtime needs and exposes // the entry point to JNI. packag...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app /* #cgo android LDFLAGS: -llog -landroid -lEGL -lGLESv2 #include <android/log.h> #include <android/native_activity.h> #include <android/input.h> #i...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package app lets you write Apps for Android (and eventually, iOS). There are two ways to use Go in an Android App. The first is as a library called from Jav...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // A Mat3 is a 3x3 matrix of float32 values. // Elements are indexed first by row then column, i.e. m[row][column]. type Mat3 [3]Vec3...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" type Vec3 [3]float32 func (v Vec3) String() string { return fmt.Sprintf("Vec3[% 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2]) } func (...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // An Affine is a 3x3 matrix of float32 values for which the bottom row is // implicitly always equal to [0 0 1]. // Elements are ind...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main /* This program generates table.go. Invoke it as: go run gen.go -output table.go */ import ( "bytes" "flag" "fmt" "go/forma...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate go run gen.go -output table.go // Package f32 implements some linear algebra and GL helpers for float32s. // // Types defined in this package hav...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" type Vec4 [4]float32 func (v Vec4) String() string { return fmt.Sprintf("Vec4[% 0.3f, % 0.3f, % 0.3f, % 0.3f]", v[0], v[1], v[2], v...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "fmt" // A Mat4 is a 4x4 matrix of float32 values. // Elements are indexed first by row then column, i.e. m[row][column]. type Mat4 [4]Vec4...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "go/build" "log" "os" ) var lang = flag.String("lang", "java", "target language for bindings, either java or go") va...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "os" "path/filepath" "go/ast" "go/build" "go/parser" "go/scanner" "go/token" "golang.org/x/mobile/bind" "golang.org/x/tools/g...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Gobind generates language bindings that make it possible to call Go code and pass objects from Java. Using gobind Gobind takes a Go package and generates ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package geom defines a two-dimensional coordinate system. The coordinate system is based on an left-handed Cartesian plane. That is, X increases to the righ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package event defines user input events. package event /* The best source on android input events is the NDK: include/android/input.h iOS event handling gu...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package glsprite blah blah blah TODO. package glsprite import ( "image" "image/draw" "golang.org/x/mobile/f32" "golang.org/x/mobile/geom" "golang.org/...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package sprite provides a 2D scene graph for rendering and animation. // // A tree of nodes is drawn by a rendering Engine, provided by another // package. T...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package portable implements a sprite Engine using the image package. // // It is intended to serve as a reference implementation for testing // other sprite ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/draw" "golang.org/x/mobile/f32" ) // affine draws each pixel of dst using bilinear interpolation of the // affine...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/color" "math" ) func bilinear(src image.Image, x, y float32) color.Color { switch src := src.(type) { case *imag...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package clock provides a clock and time functions for a sprite engine. package clock // A Time represents an instant in sprite time. // // The application u...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package clock // Standard tween functions. // // Easing means a slowing near the timing boundary, as defined by // a cubic bezier curve. Exact parameters match...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl // TODO(crawshaw): build on more host platforms (makes it easier to gobind). // TODO(crawshaw): expand to cover OpenGL ES 3. //...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package glutil implements OpenGL utility functions. package glutil import ( "fmt" "golang.org/x/mobile/gl" ) // CreateProgram creates, compiles, and lin...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package glutil import ( "encoding/binary" "image" "sync" "golang.org/x/mobile/f32" "golang.org/x/mobile/geom" "golang.org/x/mobile/gl" ) var glimage st...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,!android package glutil /* #cgo LDFLAGS: -lEGL #include <EGL/egl.h> #include <stdio.h> #include <stdlib.h> void createContext(EGLDisplay *out...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package glutil // TODO(crawshaw): Only used in glutil tests for now (cgo is not support in _test.go files). // TODO(crawshaw): Export some ki...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <GLES2/gl2.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLclampf { return C.GLclampf(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <OpenGL/gl3.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLfloat { return C.GLfloat(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl /* #cgo darwin LDFLAGS: -framework OpenGL #cgo linux LDFLAGS: -lGLESv2 #cgo darwin CFLAGS: -DGOOS_darwin #cgo linux CFLAG...
Go