graphics143

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

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 7

README

graphics143

a library that provides little functions with building your own widgets

Documentation

Index

Constants

View Source
const (
	BasicVertexShaderSource = `
		#version 410
		in vec3 vp;
		void main() {
			gl_Position = vec4(vp, 1.0);
		}
	`

	TextureVertexShaderSrc = `` /* 261-byte string literal not displayed */

	TextureFragmentShaderSrc = `` /* 235-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CompileShader

func CompileShader(source string, shaderType uint32) (uint32, error)

func DrawImage

func DrawImage(windowWidth, windowHeight int, img image.Image, imageRectSpecs RectSpecs)

You must have initialized glfw and gl before using this function

func InRectSpecs

func InRectSpecs(rectSpecs RectSpecs, xPos, yPos int) bool

useful for mouse events

func MakeProgram

func MakeProgram(vertexShaderSource, fragmentShaderSource string) (uint32, uint32, uint32)

func NewWindow

func NewWindow(width, height int, title string, resizable bool) *glfw.Window

NewWindow begins with initializing glfw and gl libraries.

func XtoFloat

func XtoFloat(x, windowWidth int) float32

Converts Pixels to Opengl Coordinates: X Axis

func YtoFloat

func YtoFloat(y, windowHeight int) float32

Converts Pixels to Opengl Coordinates: Y Axis

Types

type RectSpecs

type RectSpecs struct {
	Width   int
	Height  int
	OriginX int
	OriginY int
}

func NRectSpecs

func NRectSpecs(x, y, w, h int) RectSpecs

Directories

Path Synopsis
samples

Jump to

Keyboard shortcuts

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