graphics

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package graphics represents a low layer for graphics using OpenGL.

Index

Constants

View Source
const MaxImageSize = defaultViewportSize

MaxImageSize is the maximum of width/height of an image.

Variables

This section is empty.

Functions

func FlushCommands

func FlushCommands() error

FlushCommands flushes the command queue.

func QuadVertexSizeInBytes

func QuadVertexSizeInBytes() int

QuadVertexSizeInBytes returns the size in bytes of vertices for a quadrangle.

func ResetGLState

func ResetGLState() error

ResetGLState resets or initializes the current OpenGL state.

Types

type Filter

type Filter int
const (
	FilterNone Filter = iota
	FilterNearest
	FilterLinear
)

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image represents an image that is implemented with OpenGL.

func NewImage

func NewImage(width, height int, filter Filter) *Image

func NewImageFromImage

func NewImageFromImage(img *image.RGBA, width, height int, filter Filter) *Image

func NewScreenFramebufferImage

func NewScreenFramebufferImage(width, height int, offsetX, offsetY float64) *Image

func (*Image) Dispose

func (i *Image) Dispose()

func (*Image) DrawImage

func (i *Image) DrawImage(src *Image, vertices []float32, clr *affine.ColorM, mode opengl.CompositeMode)

func (*Image) Fill

func (i *Image) Fill(r, g, b, a uint8)

func (*Image) IsInvalidated

func (i *Image) IsInvalidated() bool

func (*Image) Pixels

func (i *Image) Pixels() ([]byte, error)

func (*Image) ReplacePixels

func (i *Image) ReplacePixels(p []byte)

func (*Image) Size

func (i *Image) Size() (int, int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL