Versions in this module Expand all Collapse all v0 v0.0.6 May 16, 2021 Changes in this version + var ErrContentLost = errors.New("buffer content lost") + var NewDirect3D11Device func(api Direct3D11) (Device, error) + var NewOpenGLDevice func(api OpenGL) (Device, error) + func DownloadImage(d Device, f Framebuffer, r image.Rectangle) (*image.RGBA, error) + func UploadImage(t Texture, offset image.Point, img *image.RGBA) + type API interface + type AccessBits uint8 + const AccessRead + const AccessWrite + type BlendFactor uint8 + const BlendFactorDstColor + const BlendFactorOne + const BlendFactorOneMinusSrcAlpha + const BlendFactorZero + type Buffer interface + Download func(data []byte) error + Release func() + Upload func(data []byte) + type BufferBinding uint8 + const BufferBindingFramebuffer + const BufferBindingIndices + const BufferBindingShaderStorage + const BufferBindingTexture + const BufferBindingUniforms + const BufferBindingVertices + type Caps struct + BottomLeftOrigin bool + Features Features + MaxTextureSize int + type DataType uint8 + const DataTypeFloat + const DataTypeInt + const DataTypeShort + type DepthFunc uint8 + const DepthFuncGreater + const DepthFuncGreaterEqual + type Device interface + BeginFrame func() Framebuffer + BindFramebuffer func(f Framebuffer) + BindImageTexture func(unit int, texture Texture, access AccessBits, format TextureFormat) + BindIndexBuffer func(b Buffer) + BindInputLayout func(i InputLayout) + BindProgram func(p Program) + BindTexture func(unit int, t Texture) + BindVertexBuffer func(b Buffer, stride, offset int) + BlendFunc func(sfactor, dfactor BlendFactor) + Caps func() Caps + Clear func(r, g, b, a float32) + ClearDepth func(d float32) + DepthFunc func(f DepthFunc) + DepthMask func(mask bool) + DispatchCompute func(x, y, z int) + DrawArrays func(mode DrawMode, off, count int) + DrawElements func(mode DrawMode, off, count int) + EndFrame func() + IsTimeContinuous func() bool + MemoryBarrier func() + NewBuffer func(typ BufferBinding, size int) (Buffer, error) + NewComputeProgram func(shader ShaderSources) (Program, error) + NewFramebuffer func(tex Texture, depthBits int) (Framebuffer, error) + NewImmutableBuffer func(typ BufferBinding, data []byte) (Buffer, error) + NewInputLayout func(vertexShader ShaderSources, layout []InputDesc) (InputLayout, error) + NewProgram func(vertexShader, fragmentShader ShaderSources) (Program, error) + NewTexture func(format TextureFormat, width, height int, minFilter, magFilter TextureFilter, ...) (Texture, error) + NewTimer func() Timer + Release func() + SetBlend func(enable bool) + SetDepthTest func(enable bool) + Viewport func(x, y, width, height int) + func NewDevice(api API) (Device, error) + type Direct3D11 struct + Device unsafe.Pointer + type DrawMode uint8 + const DrawModeTriangleStrip + const DrawModeTriangles + type Features uint + const FeatureCompute + const FeatureFloatRenderTargets + const FeatureTimers + func (f Features) Has(feats Features) bool + type Framebuffer interface + Invalidate func() + ReadPixels func(src image.Rectangle, pixels []byte) error + Release func() + type InputDesc struct + Offset int + Size int + Type DataType + type InputLayout interface + Release func() + type InputLocation struct + Location int + Name string + Semantic string + SemanticIndex int + Size int + Type DataType + type OpenGL struct + Context gl.Context + type Program interface + Release func() + SetFragmentUniforms func(buf Buffer) + SetStorageBuffer func(binding int, buf Buffer) + SetVertexUniforms func(buf Buffer) + type ShaderSources struct + GLSL100ES string + GLSL130 string + GLSL150 string + GLSL300ES string + GLSL310ES string + HLSL string + Inputs []InputLocation + Name string + Textures []TextureBinding + Uniforms UniformsReflection + type Texture interface + Release func() + Upload func(offset, size image.Point, pixels []byte) + type TextureBinding struct + Binding int + Name string + type TextureFilter uint8 + const FilterLinear + const FilterNearest + type TextureFormat uint8 + const TextureFormatFloat + const TextureFormatRGBA8 + const TextureFormatSRGB + type Timer interface + Begin func() + Duration func() (time.Duration, bool) + End func() + Release func() + type UniformBlock struct + Binding int + Name string + type UniformLocation struct + Name string + Offset int + Size int + Type DataType + type UniformsReflection struct + Blocks []UniformBlock + Locations []UniformLocation + Size int