g5

package module
v0.0.0-...-e2fbd68 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: MIT Imports: 13 Imported by: 2

README

Package g5

g5 graphics library implemented over chsc/gogl/gl33

Main contribution of this g5 is Canvas

Installation

go get -u github.com/amortaza/go-g5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Const_3Ones = []float32{1, 1, 1}
View Source
var Const_3Zeroes = []float32{0, 0, 0}
View Source
var Const_4Ones = []float32{1, 1, 1, 1}
View Source
var Const_4Zeroes = []float32{0, 0, 0, 0}

Functions

func Clear

func Clear(red, green, blue float32)

func DrawCanvasRect

func DrawCanvasRect(
	canvas *Canvas,
	left, top, width, height int,
	alphas []float32)

func DrawColorRect1v

func DrawColorRect1v(
	left, top, width, height int,
	color []float32)

func DrawColorRect3f

func DrawColorRect3f(
	left, top, width, height int,
	r, g, b float32)

func DrawColorRect4f

func DrawColorRect4f(
	left, top, width, height int,
	r, g, b, a float32)

func ClearRect(

	width, height int,
	red, green, blue float32 ) {

	g_colorRect.DrawSolid(0, 0, width, height, red, green, blue, (*gl.Float)(&g_projection[0]))
}

func DrawColorRect4v

func DrawColorRect4v(
	left, top, width, height int,
	leftTopColor []float32,
	rightTopColor []float32,
	rightBottomColor []float32,
	leftBottomColor []float32)

func DrawTextureRect

func DrawTextureRect(
	texture *Texture,
	left, top, width, height int,
	alphas []float32)

func DrawTextureRectUpsideDown

func DrawTextureRectUpsideDown(
	texture *Texture,
	left, top, width, height int,
	alphas []float32)

func Init

func Init()

func PopOrtho

func PopOrtho()

func PopView

func PopView()

func PopViewport

func PopViewport()

func PushOrtho

func PushOrtho(width, height int)

func PushView

func PushView(width, height int)

func PushViewport

func PushViewport(width, height int)

func Uninit

func Uninit()

Types

type Canvas

type Canvas struct {
	Width, Height int
	// contains filtered or unexported fields
}

func NewCanvas

func NewCanvas(width, height int) *Canvas

func (*Canvas) Begin

func (c *Canvas) Begin()

func (*Canvas) Clear

func (c *Canvas) Clear(red, green, blue float32)

func (*Canvas) End

func (c *Canvas) End()

func (*Canvas) Free

func (c *Canvas) Free()

func (*Canvas) GetHeight

func (c *Canvas) GetHeight() int

func (*Canvas) GetWidth

func (c *Canvas) GetWidth() int

func (*Canvas) Paint

func (c *Canvas) Paint(seeThru bool, left, top int, alphas []float32)

type Texture

type Texture struct {
	TextureId gl.Uint

	Width, Height int
	// contains filtered or unexported fields
}

func NewTexture

func NewTexture() *Texture

func (*Texture) Activate

func (t *Texture) Activate(texUnit gl.Enum)

func (*Texture) Allocate

func (t *Texture) Allocate(width, height int)

func (*Texture) Deactivate

func (t *Texture) Deactivate()

func (*Texture) Free

func (t *Texture) Free()

func (*Texture) LoadBytes_RGBA

func (t *Texture) LoadBytes_RGBA(width, height int, bytes []uint8)

func (*Texture) LoadImage

func (t *Texture) LoadImage(filename string)

type TextureMultiSampled

type TextureMultiSampled struct {
	TextureId gl.Uint

	Width, Height int
	// contains filtered or unexported fields
}

func NewTextureMultiSampled

func NewTextureMultiSampled(width, height int) *TextureMultiSampled

func (*TextureMultiSampled) Activate

func (t *TextureMultiSampled) Activate(texUnit gl.Enum)

func (*TextureMultiSampled) Deactivate

func (t *TextureMultiSampled) Deactivate()

func (*TextureMultiSampled) Free

func (t *TextureMultiSampled) Free()

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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