render

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package render device rendering implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Render

type Render interface {
	// Init the rendering device
	Init(opt options.Options)
	// End the rendering device
	End()
	// BeginFrame for rendering
	BeginFrame()
	// EndFrame for rendering
	EndFrame()
	// ShouldClose returns if th engine should close
	ShouldClose() bool

	// GetScreenSize get the current screen size
	GetScreenSize() geometry.Size

	// GetMousePoint returns the current Point of the mouse
	GetMousePoint() geometry.Point

	// IsMouseRelease check if the given MouseButton has been release
	IsMouseRelease(button device.MouseButton) bool

	// GetKeyStatus returns the device.KeyStatus for a given device.Key
	GetKeyStatus(key device.Key) device.KeyStatus

	// GetFrameTime returns the time from the delta time for current frame
	GetFrameTime() float32

	// LoadTexture giving it file name into VRAM
	LoadTexture(fileName string) (components.TextureDef, error)
	// UnloadTexture from VRAM
	UnloadTexture(textureDef components.TextureDef)

	// LoadFont giving it file name into VRAM
	LoadFont(fileName string) (components.FontDef, error)
	// UnloadFont from VRAM
	UnloadFont(textureDef components.FontDef)

	// SetBackgroundColor changes the current background color.Solid
	SetBackgroundColor(color color.Solid)

	// DrawText will draw a text.Text in the given geometry.Point with the correspondent color.Color
	DrawText(ftd components.FontDef, txt ui.Text, pos geometry.Point, color color.Solid)
	// DrawSprite draws a sprite.Sprite in the given geometry.Point with the tint color.Color
	DrawSprite(def components.SpriteDef, sprite sprite.Sprite, pos geometry.Point, tint color.Solid) error
	// DrawSolidBox draws a solid box with an color.Solid and a scale
	DrawSolidBox(pos geometry.Point, box shapes.Box, solid color.Solid)
	// DrawGradientBox draws a solid box with an color.Solid and a scale
	DrawGradientBox(pos geometry.Point, box shapes.Box, gradient color.Gradient)
	// MeasureText return the geometry.Size of a string with a defined size
	MeasureText(fnt components.FontDef, str string, size float32) geometry.Size
}

Render is the interface for our rendering system

func New

func New() Render

New return the Render system

Directories

Path Synopsis
Package ray the implementation of render.Render for raylib
Package ray the implementation of render.Render for raylib

Jump to

Keyboard shortcuts

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