gpu reference
The gpu package: gpu.
gpu
error CompileFailed
wolang
offer error CompileFailed(log: text)constant kClearColour
wolang
offer const kClearColour: int = 1constant kClearDepth
wolang
offer const kClearDepth: int = 2constant kTriangles
wolang
offer const kTriangles: int = 0constant kLines
wolang
offer const kLines: int = 1constant kPoints
wolang
offer const kPoints: int = 2constant kTriangleStrip
wolang
offer const kTriangleStrip: int = 3constant kTriangleFan
wolang
offer const kTriangleFan: int = 4constant kLineStrip
wolang
offer const kLineStrip: int = 5constant kZero
wolang
offer const kZero: int = 0constant kOne
wolang
offer const kOne: int = 1constant kSourceAlpha
wolang
offer const kSourceAlpha: int = 2constant kOneMinusSourceAlpha
wolang
offer const kOneMinusSourceAlpha: int = 3constant kDestinationAlpha
wolang
offer const kDestinationAlpha: int = 4constant kOneMinusDestinationAlpha
wolang
offer const kOneMinusDestinationAlpha: int = 5constant kNever
wolang
offer const kNever: int = 0constant kLess
wolang
offer const kLess: int = 1constant kEqual
wolang
offer const kEqual: int = 2constant kLessOrEqual
wolang
offer const kLessOrEqual: int = 3constant kGreater
wolang
offer const kGreater: int = 4constant kNotEqual
wolang
offer const kNotEqual: int = 5constant kGreaterOrEqual
wolang
offer const kGreaterOrEqual: int = 6constant kAlways
wolang
offer const kAlways: int = 7constant kCullNone
wolang
offer const kCullNone: int = 0constant kCullBack
wolang
offer const kCullBack: int = 1constant kCullFront
wolang
offer const kCullFront: int = 2constant kSpriteVertex
wolang
offer const kSpriteVertex: text = "#version 330 core\r\nlayout(location = 0) in vec2 a_position;\r\nlayout(location = 1) in vec2 a_uv;\r\nlayout(location = 2) in vec4 a_colour;\r\nuniform mat4 u_view;\r\nout vec2 v_uv;\r\nout vec4 v_colour;\r\nvoid main() \{\r\n v_uv = a_uv;\r\n v_colour = a_colour;\r\n gl_Position = u_view * vec4(a_position, 0.0, 1.0);\r\n}\r\n"constant kSpriteFragment
wolang
offer const kSpriteFragment: text = "#version 330 core\r\nin vec2 v_uv;\r\nin vec4 v_colour;\r\nuniform sampler2D u_texture;\r\nout vec4 o_colour;\r\nvoid main() \{\r\n o_colour = texture(u_texture, v_uv) * v_colour;\r\n}\r\n"constant kSolidFragment
wolang
offer const kSolidFragment: text = "#version 330 core\r\nin vec2 v_uv;\r\nin vec4 v_colour;\r\nout vec4 o_colour;\r\nvoid main() \{\r\n o_colour = v_colour;\r\n}\r\n"function WithHeader
wolang
offer fun WithHeader(source: text) -> text uses unsafestruct Buffer
wolang
offer struct Bufferfield id
wolang
var id: intfield count
wolang
var count: intstruct Layout
wolang
offer struct Layoutfield id
wolang
var id: intstruct Program
wolang
offer struct Programfield id
wolang
var id: intstruct Texture
wolang
offer struct Texturefield id
wolang
var id: intfield width
wolang
var width: intfield height
wolang
var height: intstruct Target
wolang
offer struct Targetfield id
wolang
var id: intfield texture
wolang
var texture: Textureability Backend
wolang
offer ability Backendmethod Name
wolang
fun Name() -> textmethod Clear
wolang
fun Clear(
red: float,
green: float,
blue: float,
alpha: float,
depth: float,
mask: int) uses unsafemethod Viewport
wolang
fun Viewport(x: int, y: int, width: int, height: int) uses unsafemethod Blend
wolang
fun Blend(enabled: bool, source: int, destination: int) uses unsafemethod Depth
wolang
fun Depth(test: bool, write: bool, compare: int) uses unsafemethod Cull
wolang
fun Cull(mode: int) uses unsafemethod Scissor
wolang
fun Scissor(enabled: bool, x: int, y: int, width: int, height: int) uses unsafemethod BufferNew
wolang
fun BufferNew() -> int uses unsafemethod VertexData
wolang
fun VertexData(buffer: int, data: []f32, dynamic: bool) uses unsafemethod IndexData
wolang
fun IndexData(buffer: int, data: []u32, dynamic: bool) uses unsafemethod BufferDelete
wolang
fun BufferDelete(buffer: int) uses unsafemethod LayoutNew
wolang
fun LayoutNew() -> int uses unsafemethod LayoutAttribute
wolang
fun LayoutAttribute(
layout: int,
buffer: int,
index: int,
count: int,
stride: int,
offset: int) uses unsafemethod LayoutIndices
wolang
fun LayoutIndices(layout: int, buffer: int) uses unsafemethod LayoutDelete
wolang
fun LayoutDelete(layout: int) uses unsafemethod ProgramNew
wolang
fun ProgramNew(vertex: text, fragment: text) -> int uses unsafemethod ProgramLog
wolang
fun ProgramLog() -> text uses unsafemethod ProgramUse
wolang
fun ProgramUse(program: int) uses unsafemethod ProgramDelete
wolang
fun ProgramDelete(program: int) uses unsafemethod Uniform
wolang
fun Uniform(program: int, name: text) -> int uses unsafemethod UniformFloat
wolang
fun UniformFloat(
location: int,
count: int,
a: float,
b: float,
c: float,
d: float) uses unsafemethod UniformInt
wolang
fun UniformInt(location: int, value: int) uses unsafemethod UniformMatrix
wolang
fun UniformMatrix(location: int, values: []f32) uses unsafemethod TextureNew
wolang
fun TextureNew(
width: int,
height: int,
rgba: []u8,
linear: bool,
repeat: bool) -> int uses unsafemethod TextureUpdate
wolang
fun TextureUpdate(
texture: int,
x: int,
y: int,
width: int,
height: int,
rgba: []u8) uses unsafemethod TextureBind
wolang
fun TextureBind(unit: int, texture: int) uses unsafemethod TextureDelete
wolang
fun TextureDelete(texture: int) uses unsafemethod TargetNew
wolang
fun TargetNew(texture: int) -> int uses unsafemethod TargetBind
wolang
fun TargetBind(target: int) uses unsafemethod TargetDelete
wolang
fun TargetDelete(target: int) uses unsafemethod Draw
wolang
fun Draw(layout: int, mode: int, first: int, count: int) uses unsafemethod DrawIndexed
wolang
fun DrawIndexed(layout: int, mode: int, count: int, first: int) uses unsafemethod Read
wolang
fun Read(x: int, y: int, width: int, height: int, out: []mut u8) -> bool uses unsafemethod Error
wolang
fun Error() -> int uses unsafeclass OpenGl
wolang
offer class OpenGlfield version
wolang
var version: text = ""function OpenGlStart
wolang
offer fun OpenGlStart(window: Window) -> Backend? uses unsafeclass Null
wolang
offer class Nullfield next
wolang
var next: int = 1field buffers
wolang
var buffers: List<int>field layouts
wolang
var layouts: List<int>field programs
wolang
var programs: List<int>field textures
wolang
var textures: List<int>field targets
wolang
var targets: List<int>field log
wolang
var log: List<text>field errors
wolang
var errors: int = 0field failure
wolang
var failure: text = ""field program_sources
wolang
var program_sources: List<text>field bound_target
wolang
var bound_target: int = 0field bound_program
wolang
var bound_program: int = 0field clear_red
wolang
var clear_red: float = 0.0field clear_green
wolang
var clear_green: float = 0.0field clear_blue
wolang
var clear_blue: float = 0.0field clear_alpha
wolang
var clear_alpha: float = 0.0field uniforms_set
wolang
var uniforms_set: int = 0method Record
wolang
fun Record(line: text) uses unsafemethod Take
wolang
fun Take(list: List<int>) -> int uses unsafemethod Live
wolang
fun Live(list: List<int>, id: int) -> boolmethod Release
wolang
fun Release(list: List<int>, id: int, what: text) uses unsafemethod Need
wolang
fun Need(list: List<int>, id: int, what: text) uses unsafemethod Count
wolang
fun Count(list: List<int>) -> intfunction NullNew
wolang
offer fun NullNew() -> Null uses unsafeclass Device
wolang
offer class Devicefield backend
wolang
var backend: Backendmethod Name
wolang
fun Name() -> textmethod VertexBuffer
wolang
fun VertexBuffer(data: []f32, dynamic: bool) -> Buffer uses unsafemethod IndexBuffer
wolang
fun IndexBuffer(data: []u32, dynamic: bool) -> Buffer uses unsafemethod BufferDelete
wolang
fun BufferDelete(buffer: Buffer) uses unsafemethod LayoutNew
wolang
fun LayoutNew() -> Layout uses unsafemethod LayoutAttribute
wolang
fun LayoutAttribute(
layout: Layout,
buffer: Buffer,
index: int,
count: int,
stride: int,
offset: int) uses unsafemethod LayoutIndices
wolang
fun LayoutIndices(layout: Layout, buffer: Buffer) uses unsafemethod LayoutDelete
wolang
fun LayoutDelete(layout: Layout) uses unsafemethod ProgramNew
wolang
fun ProgramNew(vertex: text, fragment: text) -> Program!CompileFailed uses unsafemethod ProgramUse
wolang
fun ProgramUse(program: Program) uses unsafemethod ProgramDelete
wolang
fun ProgramDelete(program: Program) uses unsafemethod Uniform
wolang
fun Uniform(program: Program, name: text) -> int uses unsafemethod SetFloat
wolang
fun SetFloat(location: int, a: float) uses unsafemethod SetVec2
wolang
fun SetVec2(location: int, a: float, b: float) uses unsafemethod SetVec3
wolang
fun SetVec3(location: int, a: float, b: float, c: float) uses unsafemethod SetVec4
wolang
fun SetVec4(location: int, a: float, b: float, c: float, d: float) uses unsafemethod SetInt
wolang
fun SetInt(location: int, value: int) uses unsafemethod SetMatrix
wolang
fun SetMatrix(location: int, values: []f32) uses unsafemethod TextureNew
wolang
fun TextureNew(
width: int,
height: int,
rgba: []u8,
linear: bool,
repeat: bool) -> Texture uses unsafemethod TextureUpdate
wolang
fun TextureUpdate(
texture: Texture,
x: int,
y: int,
width: int,
height: int,
rgba: []u8) uses unsafemethod TextureBind
wolang
fun TextureBind(unit: int, texture: Texture) uses unsafemethod TextureDelete
wolang
fun TextureDelete(texture: Texture) uses unsafemethod TargetNew
wolang
fun TargetNew(texture: Texture) -> Target? uses unsafemethod TargetDelete
wolang
fun TargetDelete(target: Target) uses unsafemethod Begin
wolang
fun Begin(
target: Target?,
width: int,
height: int,
red: float,
green: float,
blue: float,
alpha: float,
clear_depth: bool) uses unsafemethod End
wolang
fun End() uses unsafemethod Blend
wolang
fun Blend(enabled: bool, source: int, destination: int) uses unsafemethod Depth
wolang
fun Depth(test: bool, write: bool, compare: int) uses unsafemethod Cull
wolang
fun Cull(mode: int) uses unsafemethod Scissor
wolang
fun Scissor(enabled: bool, x: int, y: int, width: int, height: int) uses unsafemethod Draw
wolang
fun Draw(layout: Layout, mode: int, first: int, count: int) uses unsafemethod DrawIndexed
wolang
fun DrawIndexed(layout: Layout, mode: int, count: int, first: int) uses unsafemethod Read
wolang
fun Read(x: int, y: int, width: int, height: int) -> []mut u8 uses unsafemethod Error
wolang
fun Error() -> int uses unsafefunction DeviceNew
wolang
offer fun DeviceNew(backend: Backend) -> Device