mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
go fmt
This commit is contained in:
parent
e91ab21d8d
commit
6ed9102f01
@ -1,9 +1,9 @@
|
|||||||
package ebiten
|
package ebiten
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/go-ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
|
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Game interface {
|
type Game interface {
|
||||||
|
@ -15,14 +15,14 @@ package main
|
|||||||
//
|
//
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
|
"github.com/hajimehoshi/go-ebiten"
|
||||||
|
"github.com/hajimehoshi/go-ebiten/graphics"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
"github.com/hajimehoshi/go-ebiten"
|
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GlutUI struct {
|
type GlutUI struct {
|
||||||
@ -62,7 +62,7 @@ func (ui *GlutUI) Init() {
|
|||||||
ui.screenScale = 2
|
ui.screenScale = 2
|
||||||
|
|
||||||
C.glutInit(&cargc, &cargs[0])
|
C.glutInit(&cargc, &cargs[0])
|
||||||
C.glutInitDisplayMode(C.GLUT_RGBA);
|
C.glutInitDisplayMode(C.GLUT_RGBA)
|
||||||
C.glutInitWindowSize(
|
C.glutInitWindowSize(
|
||||||
C.int(ui.screenWidth*ui.screenScale),
|
C.int(ui.screenWidth*ui.screenScale),
|
||||||
C.int(ui.screenHeight*ui.screenScale))
|
C.int(ui.screenHeight*ui.screenScale))
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package graphics_test
|
package graphics_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
. "."
|
. "."
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setElements(matrix *AffineMatrix, elements [][]float64) {
|
func setElements(matrix *AffineMatrix, elements [][]float64) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package graphics_test
|
package graphics_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
. "."
|
. "."
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGeometryMatrixElements(t *testing.T) {
|
func TestGeometryMatrixElements(t *testing.T) {
|
||||||
|
@ -7,10 +7,10 @@ package opengl
|
|||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/hajimehoshi/go-ebiten/graphics"
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GraphicsContext struct {
|
type GraphicsContext struct {
|
||||||
@ -138,8 +138,7 @@ func (context *GraphicsContext) setOffscreenFramebuffer(framebuffer C.GLuint,
|
|||||||
C.glFlush()
|
C.glFlush()
|
||||||
|
|
||||||
C.glBindFramebuffer(C.GL_FRAMEBUFFER, framebuffer)
|
C.glBindFramebuffer(C.GL_FRAMEBUFFER, framebuffer)
|
||||||
if err := C.glCheckFramebufferStatus(C.GL_FRAMEBUFFER);
|
if err := C.glCheckFramebufferStatus(C.GL_FRAMEBUFFER); err != C.GL_FRAMEBUFFER_COMPLETE {
|
||||||
err != C.GL_FRAMEBUFFER_COMPLETE {
|
|
||||||
panic(fmt.Sprintf("glBindFramebuffer failed: %d", err))
|
panic(fmt.Sprintf("glBindFramebuffer failed: %d", err))
|
||||||
}
|
}
|
||||||
C.glEnable(C.GL_BLEND)
|
C.glEnable(C.GL_BLEND)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package opengl_test
|
package opengl_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
. "."
|
. "."
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestClp2(t *testing.T) {
|
func TestClp2(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user