vulkanRenderSystem

package module
v0.0.0-...-6b8388a Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 19 Imported by: 0

README

#Vulkan Render System

This is a replacement for common's Render system in engo that uses Vulkan instead of OpenGL to render to screens.

Getting Started

First, you'll need the Vulkan SDK on your system.

Linux / Windows

On linux and windows make sure you have LunarG's Vulkan SDK installed.

OSX

On OSX make sure you have MoltenVK installed.

Building with engo

Use the build tag vulkan from engo to run.

go run --tags=vulkan *.go

TODO

In order to make this a replacement for the common.RenderSystem's stuff, it has to be able to do the following exactly as the regular RenderSystem does:

[ ] use .png .jpg .bmp and .svg images [ ] blit an image to the screen [ ] blit multiple images to the screen at locations based on their space component [ ] animation [ ] hud vs non-hud elements [ ] text from .ttf and .otf [ ] TMX maps [ ] Global Scale [ ] Scale on Resize [ ] Full Screen [ ] Utilize custom shaders [ ] View Culling [ ] Blend Maps

Documentation

Index

Constants

View Source
const RenderSystemPriority = -1000

RenderSystemPriority is the priority of the render system. This makes sure rendering happens after all other systems in the update

Variables

This section is empty.

Functions

This section is empty.

Types

type RenderComponent

type RenderComponent struct {
	// Hidden is used to prevent drawing by OpenGL
	Hidden bool
	// Scale is the scale at which to render, in the X and Y axis. Not defining Scale, will default to engo.Point{1, 1}
	Scale engo.Point
	// Color defines how much of the color-components of the texture get used
	Color color.Color
	// Drawable refers to the Texture that should be drawn
	// Drawable Drawable
	// ZIndex is the drawing order for the entities
	Zindex int
}

RenderComponent is the component used by the RenderSystem

type RenderSystem

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

func (*RenderSystem) Cleanup

func (r *RenderSystem) Cleanup()

Cleanup cleans up all the vulkan memory used by the VulkanRenderSystem.

func (*RenderSystem) New

func (r *RenderSystem) New(w *ecs.World)

func (*RenderSystem) Remove

func (r *RenderSystem) Remove(e ecs.BasicEntity)

func (*RenderSystem) Update

func (r *RenderSystem) Update(dt float32)

type Texture

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

func (*Texture) Destroy

func (t *Texture) Destroy(dev vk.Device)

func (*Texture) DestroyImage

func (t *Texture) DestroyImage(dev vk.Device)

func (*Texture) Height

func (t *Texture) Height() float32

func (*Texture) Width

func (t *Texture) Width() float32

type TextureResource

type TextureResource struct {
	Texture *Texture
	// contains filtered or unexported fields
}

func NewTextureResource

func NewTextureResource(img image.Image, url string) TextureResource

func (TextureResource) URL

func (t TextureResource) URL() string

type UniformBufferObject

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

Directories

Path Synopsis
internal
shaders
Code generated by go-bindata.
Code generated by go-bindata.

Jump to

Keyboard shortcuts

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