gles

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gles is the OpenGL ES 3.0 renderer. It calls EGL and GLES through purego.

Flutter: Impeller's GLES backend (engine/src/flutter/impeller/renderer/backend/gles).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(h gpu.SurfaceHandle) (*Context, *Surface, error)

Open loads EGL and GLES, creates an OpenGL ES 3.0 context on the display of h, creates the first window surface for h, makes it current, and turns vsync off (eglSwapInterval 0: frames are paced by the compositor's frame callbacks, SPEC §8.11). It fails with

  • EGLLoadFailed when libEGL or libGLESv2 cannot be loaded
  • EGLInitFailed when there is no EGL display or it will not initialize
  • EGLNoConfig when no config has RGBA8 and OpenGL ES 3 window surfaces
  • GLES3Unsupported when no ES 3.0 context can be created or the driver reports an older GL_VERSION

Close releases everything.

Flutter: no counterpart

func ShaderNames

func ShaderNames() ([]string, error)

ShaderNames returns the names of the shader programs in the executable, in alphabetical order: each has a <name>.vert.glsl and a <name>.frag.glsl.

Flutter: no counterpart

func ShaderSource

func ShaderSource(name, stage string) (string, error)

ShaderSource returns the GLSL source of a stage ("vert" or "frag") of a program. A line of the form //#include "name.glsl" is replaced by the contents of that file of the shaders directory, so that shaders share code.

Flutter: no counterpart

func X11Visual

func X11Visual(display uintptr) (uint32, error)

X11Visual returns the ID of the X visual that windows must use to be drawn with OpenGL ES through EGL on the Xlib display: the visual of the EGL config that Open chooses. Create the X window with this visual (and a colormap made for it), or eglCreateWindowSurface fails with BadMatch. It fails with

  • EGLLoadFailed, EGLInitFailed and EGLNoConfig as Open does
  • EGLConfigQueryFailed when the config has no native visual

Flutter: no counterpart

Types

type Buffer

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

Buffer is a GL buffer whose capacity is a power of two, so that buffers of similar sizes are interchangeable. Get one from Device.AcquireBuffer.

Flutter: no counterpart

func (*Buffer) Capacity

func (b *Buffer) Capacity() int

Capacity is the number of bytes the buffer can hold.

Flutter: no counterpart

func (*Buffer) ID

func (b *Buffer) ID() uint32

ID is the GL name of the buffer.

Flutter: no counterpart

type Caps

type Caps struct {
	// Version, Vendor and Renderer are the GL strings.
	Version, Vendor, Renderer string
	// MaxTextureSize is the largest width or height of a texture.
	MaxTextureSize int
	// MaxRenderbufferSize is the largest width or height of a renderbuffer.
	MaxRenderbufferSize int
	// MaxTextureUnits is the number of texture units a fragment shader can use.
	MaxTextureUnits int
	// Extensions are the names of the supported extensions.
	Extensions map[string]bool
}

Caps are what the driver reports about itself.

Flutter: no counterpart

type Context

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

Context is an EGL display with an OpenGL ES 3.0 context, shared by every window surface (SPEC §9.1). Use it only on the UI thread.

Flutter: no counterpart

func (*Context) CanSwapWithDamage

func (c *Context) CanSwapWithDamage() bool

CanSwapWithDamage says whether the display has EGL_KHR_swap_buffers_with_damage (or the EXT extension), so that SwapBuffersWithDamage tells the compositor what changed.

Flutter: no counterpart

func (*Context) Clear

func (c *Context) Clear(r, g, b, a float32)

Clear fills the current framebuffer with the color, given as premultiplied components between 0 and 1.

Flutter: no counterpart

func (*Context) Close

func (c *Context) Close()

Close destroys the surfaces, the context and the display. Closing twice does nothing.

Flutter: no counterpart

func (*Context) Device

func (c *Context) Device() *Device

Device returns the GL device of the context: its programs, pools and state cache.

Flutter: no counterpart

func (*Context) Lost

func (c *Context) Lost() bool

Lost says that the browser took the context away (WebGL's webglcontextlost): nothing can be drawn until it is restored. It is always false for an EGL context.

Flutter: no counterpart

func (*Context) MakeCurrent

func (c *Context) MakeCurrent(s *Surface) error

MakeCurrent makes the context current for drawing into s. It fails with EGLMakeCurrentFailed.

Flutter: no counterpart

func (*Context) MakeCurrentSurfaceless

func (c *Context) MakeCurrentSurfaceless() error

MakeCurrentSurfaceless makes the context current without any surface, for drawing into framebuffer objects only (EGL_KHR_surfaceless_context, which every OpenGL ES 3 driver has). It fails with EGLMakeCurrentSurfacelessFailed.

Flutter: no counterpart

func (*Context) NewSurface

func (c *Context) NewSurface(h gpu.SurfaceHandle) (*Surface, error)

NewSurface creates a window surface for the native window of h. It fails with EGLSurfaceFailed.

Flutter: no counterpart

func (*Context) ReadPixels

func (c *Context) ReadPixels(width, height int) (*image.RGBA, error)

ReadPixels reads the width x height pixels at the origin of the current framebuffer, top row first. Read before SwapBuffers: a framebuffer's content is undefined after the swap. It fails with GLReadPixelsFailed.

Flutter: no counterpart

func (*Context) ResizeSurface

func (c *Context) ResizeSurface(s *Surface, width, height int)

ResizeSurface makes the surface width x height pixels when it is not that size already, for a surface that is not resized by its window (the web's canvas, whose pixels are cleared when its size is set, so call it before drawing the frame). EGL surfaces follow their native window, so it does nothing for them.

Flutter: no counterpart

func (*Context) SwapBuffers

func (c *Context) SwapBuffers(s *Surface) error

SwapBuffers presents the frame drawn into s. On Wayland this is the commit of the wl_surface, so the frame callback must be requested before it. It fails with EGLSwapFailed.

Flutter: no counterpart

func (*Context) SwapBuffersWithDamage

func (c *Context) SwapBuffersWithDamage(s *Surface, height int, rects []image.Rectangle) error

SwapBuffersWithDamage presents the frame drawn into s as SwapBuffers does, and tells the compositor that only the rectangles changed from the frame before it: pixels from the top left of a surface that is height pixels high. The whole frame is drawn in the buffer anyway, so a compositor or driver that ignores the damage shows the same window. Without the extension it is SwapBuffers. It fails with EGLSwapFailed.

Flutter: no counterpart

func (*Context) Version

func (c *Context) Version() string

Version returns the GL_VERSION string of the context.

Flutter: no counterpart

func (*Context) Viewport

func (c *Context) Viewport(width, height int)

Viewport sets the GL viewport to the whole of a width x height surface.

Flutter: no counterpart

type Device

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

Device owns the GL objects of the renderer: the shader programs, and pools of buffers, textures and framebuffers that are reused instead of created again. It remembers the GL state it has set, so that setting it again costs nothing. Use it only on the UI thread, with its context current.

Flutter: no counterpart

func (*Device) AcquireBuffer

func (d *Device) AcquireBuffer(target uint32, size int) (*Buffer, error)

AcquireBuffer returns a buffer for target (glArrayBuffer or glElementArrayBuffer) of at least size bytes, reusing a free one of the same capacity class if there is one.

Flutter: no counterpart

func (*Device) AcquireFramebuffer

func (d *Device) AcquireFramebuffer(w, h int, stencil bool) (*Framebuffer, error)

AcquireFramebuffer returns an offscreen framebuffer of the size, with a stencil buffer if asked, reusing a free one of the same size. It fails with TextureSizeInvalid for a bad size and FramebufferIncomplete when the driver cannot make it.

Flutter: no counterpart

func (*Device) AcquireTexture

func (d *Device) AcquireTexture(w, h int, format TextureFormat) (*Texture, error)

AcquireTexture returns a texture of the size and format, reusing a free one of the same size and format if there is one. Its contents are undefined. Its sampling is linear with clamping to the edge. It fails with TextureSizeInvalid for a size that is not positive or larger than the driver allows, and GLError when the driver cannot allocate it.

Flutter: no counterpart

func (*Device) BindArrayBuffer

func (d *Device) BindArrayBuffer(b *Buffer)

BindArrayBuffer binds a buffer as the source of vertex attributes; nil unbinds.

Flutter: no counterpart

func (*Device) BindFramebuffer

func (d *Device) BindFramebuffer(f *Framebuffer)

BindFramebuffer makes a framebuffer the target of drawing and reading; nil is the window's.

Flutter: no counterpart

func (*Device) BindTexture

func (d *Device) BindTexture(unit int, t *Texture)

BindTexture binds a 2D texture to a texture unit, and makes the unit active.

Flutter: no counterpart

func (*Device) BindVertexArray

func (d *Device) BindVertexArray(vao uint32)

BindVertexArray makes a vertex array current; 0 is none.

Flutter: no counterpart

func (*Device) BlendEquation

func (d *Device) BlendEquation(mode uint32)

BlendEquation sets how the source and the destination are combined.

Flutter: no counterpart

func (*Device) BlendFunc

func (d *Device) BlendFunc(srcRGB, dstRGB, srcAlpha, dstAlpha uint32)

BlendFunc sets the blend factors for color and alpha.

Flutter: no counterpart

func (*Device) Caps

func (d *Device) Caps() Caps

Caps returns what the driver reported.

Flutter: no counterpart

func (*Device) ClearColor

func (d *Device) ClearColor(r, g, b, a float32)

ClearColor sets the color that Clear fills with, as premultiplied components.

Flutter: no counterpart

func (*Device) Close

func (d *Device) Close()

Close deletes every GL object the device made that is pooled or a program. Objects still in use by the caller are the caller's to release first. Closing twice does nothing. The context must still be current.

Flutter: no counterpart

func (*Device) ColorMask

func (d *Device) ColorMask(r, g, b, a bool)

ColorMask says which color channels are written.

Flutter: no counterpart

func (*Device) CompileAll

func (d *Device) CompileAll() error

CompileAll compiles every shader program now, so that a broken shader shows here and not in the middle of a frame. It fails with ShaderCompileFailed when a shader does not build, and ShaderSourceMissing when the sources are not in the executable.

Flutter: no counterpart

func (*Device) CopyFramebuffer

func (d *Device) CopyFramebuffer(unit int, t *Texture, x, y, w, h int) error

CopyFramebuffer copies the w x h pixels at x, y (counted from the bottom left) of the bound framebuffer into the corner of the texture where its first row starts, after binding the texture to the unit. The texture must be at least that big and RGBA8.

Flutter: no counterpart

func (*Device) EndFrame

func (d *Device) EndFrame()

EndFrame marks the end of a frame and frees the pooled objects that have not been used for a long time.

Flutter: no counterpart

func (*Device) GenerateMipmaps

func (d *Device) GenerateMipmaps(t *Texture)

GenerateMipmaps builds the mipmap chain of a texture from its level 0.

Flutter: no counterpart

func (*Device) NewProgram

func (d *Device) NewProgram(name, vertexSource, fragmentSource string) (*Program, error)

NewProgram compiles and links a program from GLSL ES 3.00 sources. It fails with ShaderCompileFailed, whose metadata has the program, the stage ("vertex shader", "fragment shader" or "link") and the driver's log.

Flutter: no counterpart

func (*Device) Program

func (d *Device) Program(name string) (*Program, error)

Program returns the program of the named shader files, compiling it the first time. It fails with ShaderSourceMissing when there are no such files, and ShaderCompileFailed, with the driver's log in its metadata, when a stage does not compile or the program does not link.

Flutter: no counterpart

func (*Device) ReleaseBuffer

func (d *Device) ReleaseBuffer(b *Buffer)

ReleaseBuffer gives a buffer back to the pool; releasing it twice panics with the tag BufferReleased.

Flutter: no counterpart

func (*Device) ReleaseFramebuffer

func (d *Device) ReleaseFramebuffer(f *Framebuffer)

ReleaseFramebuffer gives a framebuffer back to the pool; releasing it twice panics with the tag FramebufferReleased.

Flutter: no counterpart

func (*Device) ReleaseTexture

func (d *Device) ReleaseTexture(t *Texture)

ReleaseTexture gives a texture back to the pool. Using it afterwards is a programmer error; releasing it twice panics with the tag TextureReleased.

Flutter: no counterpart

func (*Device) ResetState

func (d *Device) ResetState()

ResetState sets the GL state to the starting point again. Call it after code that is not the device has used the GL context.

Flutter: no counterpart

func (*Device) SetBlend

func (d *Device) SetBlend(on bool)

SetBlend turns blending on or off.

Flutter: no counterpart

func (*Device) SetScissor

func (d *Device) SetScissor(on bool, x, y, w, h int)

SetScissor turns the scissor test on with a rectangle, or off. The rectangle is in the GL's pixels, from the bottom left.

Flutter: no counterpart

func (*Device) SetStencil

func (d *Device) SetStencil(on bool)

SetStencil turns the stencil test on or off.

Flutter: no counterpart

func (*Device) SetTextureParams

func (d *Device) SetTextureParams(t *Texture, minFilter, magFilter, wrapS, wrapT int32)

SetTextureParams sets the filters and the wrapping of a texture, skipping what is already set. The min filter may be one of the mipmap filters when the texture has mipmaps.

Flutter: no counterpart

func (*Device) Stats

func (d *Device) Stats() Stats

Stats returns the counts of GL objects.

Flutter: no counterpart

func (*Device) StencilFunc

func (d *Device) StencilFunc(fn uint32, ref int32, mask uint32)

StencilFunc sets the stencil comparison.

Flutter: no counterpart

func (*Device) StencilMask

func (d *Device) StencilMask(mask uint32)

StencilMask sets which stencil bits are written.

Flutter: no counterpart

func (*Device) StencilOp

func (d *Device) StencilOp(fail, zfail, zpass uint32)

StencilOp sets what happens to the stencil value on each outcome of the tests.

Flutter: no counterpart

func (*Device) Trim

func (d *Device) Trim(maxIdle uint64)

Trim deletes the pooled objects that have been free for more than maxIdle frames; 0 deletes all of them.

Flutter: no counterpart

func (*Device) UploadBuffer

func (d *Device) UploadBuffer(b *Buffer, data []byte) error

UploadBuffer writes data at the start of the buffer. The old contents are orphaned first, so that the driver need not wait for draws that still read them. It fails with BufferTooSmall when data is longer than the capacity.

Flutter: no counterpart

func (*Device) UploadTexture

func (d *Device) UploadTexture(t *Texture, x, y, w, h int, pixels []byte) error

UploadTexture writes the w x h pixels at x, y of the texture. The pixels are tightly packed, in the texture's format. It fails with TextureUploadInvalid when the rectangle is outside the texture or the data has the wrong length.

Flutter: no counterpart

func (*Device) UseProgram

func (d *Device) UseProgram(p *Program)

UseProgram makes a program current.

Flutter: no counterpart

func (*Device) VertexArray

func (d *Device) VertexArray(name string, setup func(vao uint32)) uint32

VertexArray returns the vertex array of the name, creating it the first time and calling setup with it (bound) to describe its attributes. The device deletes it when it is closed.

Flutter: no counterpart

func (*Device) Viewport

func (d *Device) Viewport(x, y, w, h int)

Viewport sets the viewport.

Flutter: no counterpart

type FrameStats

type FrameStats struct {
	// Commands is the number of drawing commands in the scene.
	Commands int
	// Drawn is the number of commands drawn.
	Drawn int
	// Skipped is the number of commands left out because the renderer cannot draw
	// them yet; only a renderer with SkipUnsupported skips.
	Skipped int
	// Instances is the number of instanced primitives sent to the GPU (shapes,
	// coverage tiles and image rectangles), Vertices the number of vertices, and
	// Batches the number of draw calls that drew them.
	Instances, Vertices, Batches int
	// TilesRasterized, ClipMasksBuilt and ImagesUploaded count the work the frame
	// did that an earlier frame's cache could have saved: coverage tiles
	// rasterized, clip masks made and images uploaded.
	TilesRasterized, ClipMasksBuilt, ImagesUploaded int
	// CachedLayersDrawn is the number of retained layers drawn from the raster
	// cache's textures, and CachedLayersMade the number drawn into them.
	CachedLayersDrawn, CachedLayersMade int
	// DamagedPixels is the number of pixels the frame told the compositor to
	// update, and DamageRects the number of rectangles they were in: the whole
	// window and 0 when the frame was presented whole. Both are 0 unless
	// RendererOpts.Damage is set and the display can swap with damage.
	DamagedPixels, DamageRects int
	// Unsupported lists the features that caused skipped commands, once each.
	Unsupported []string
}

FrameStats says what the last frame did.

Flutter: no counterpart

type Framebuffer

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

Framebuffer is an offscreen render target: an RGBA8 texture, and optionally a stencil buffer. Get one from Device.AcquireFramebuffer.

Flutter: no counterpart

func (*Framebuffer) Height

func (f *Framebuffer) Height() int

Height is the height in pixels.

Flutter: no counterpart

func (*Framebuffer) ID

func (f *Framebuffer) ID() uint32

ID is the GL name of the framebuffer.

Flutter: no counterpart

func (*Framebuffer) Texture

func (f *Framebuffer) Texture() *Texture

Texture is the color attachment, which can be sampled once drawing is done.

Flutter: no counterpart

func (*Framebuffer) Width

func (f *Framebuffer) Width() int

Width is the width in pixels.

Flutter: no counterpart

type Program

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

Program is a linked shader program, with its uniform and attribute locations remembered after the first lookup.

Flutter: no counterpart

func (*Program) Attrib

func (p *Program) Attrib(name string) int32

Attrib returns the location of a vertex attribute, or -1.

Flutter: no counterpart

func (*Program) Name

func (p *Program) Name() string

Name is the name of the program: the name of its shader files.

Flutter: no counterpart

func (*Program) SetFloat

func (p *Program) SetFloat(name string, v float32)

SetFloat sets a float uniform.

Flutter: no counterpart

func (*Program) SetFloats

func (p *Program) SetFloats(name string, values []float32)

SetFloats sets a float[] uniform.

Flutter: no counterpart

func (*Program) SetInt

func (p *Program) SetInt(name string, v int32)

SetInt sets an int (or sampler, or bool) uniform. A name the program does not have is ignored, as GL ignores location -1.

Flutter: no counterpart

func (*Program) SetVec2

func (p *Program) SetVec2(name string, x, y float32)

SetVec2 sets a vec2 uniform.

Flutter: no counterpart

func (*Program) SetVec4

func (p *Program) SetVec4(name string, x, y, z, w float32)

SetVec4 sets a vec4 uniform.

Flutter: no counterpart

func (*Program) SetVec4s

func (p *Program) SetVec4s(name string, values []float32)

SetVec4s sets a vec4[] uniform; values has four floats for each element.

Flutter: no counterpart

func (*Program) Uniform

func (p *Program) Uniform(name string) int32

Uniform returns the location of a uniform, or -1 when the program has no such uniform (or the compiler removed it because it is unused).

Flutter: no counterpart

type Renderer

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

Renderer is the GPU renderer: a gpu.Renderer that draws with OpenGL ES 3.0. This is its skeleton (step 3.1): Render clears the surface to the background color and presents it; the drawing of scenes arrives in steps 3.2 to 3.5.

Flutter: no counterpart (flutter::Rasterizer)

func NewRenderer

func NewRenderer(opts ...RendererOpts) *Renderer

NewRenderer returns a renderer that has no GL context yet: the first Attach creates it. Passing more than one RendererOpts panics with MultipleOptions.

Flutter: no counterpart

func (*Renderer) Attach

func (r *Renderer) Attach(h gpu.SurfaceHandle) (gpu.Surface, error)

Attach starts drawing into the native window of h. The first call opens the GL context (see Open for its failures) and so creates the device; later calls add a surface to the same context. It fails with RendererClosed after Close.

Flutter: no counterpart

func (*Renderer) Close

func (r *Renderer) Close() error

Close destroys every surface, the device and the context. Closing twice does nothing.

Flutter: no counterpart

func (*Renderer) DeviceName

func (r *Renderer) DeviceName() string

DeviceName returns GL_RENDERER, the name of the GPU (or of the software rasterizer) that draws, or "" before the first Attach has opened the context.

Flutter: no counterpart

func (*Renderer) Invalidate

func (r *Renderer) Invalidate(s gpu.Surface)

Invalidate says that the window of the surface lost its content (it was exposed), so that its next frame reports the whole window as changed.

Flutter: no counterpart

func (*Renderer) LastFrame

func (r *Renderer) LastFrame() FrameStats

LastFrame says what the last call of Render drew and left out.

Flutter: no counterpart

func (*Renderer) RasterizeScene

func (r *Renderer) RasterizeScene(scene *ui.Scene, width, height int) (*ui.Image, error)

RasterizeScene draws the scene into a new image of width x height pixels, as Snapshot does: the ui.Rasterizer of the GPU renderer, for Picture.ToImage and Scene.ToImage.

Flutter: no counterpart

func (*Renderer) Render

func (r *Renderer) Render(s gpu.Surface, scene *ui.Scene, size ui.Size, dpr float32) error

Render makes the surface current, clears it to the background color, draws the scene over it and presents it. A nil scene is an empty one. It fails with RendererSurfaceInvalid when s is not a surface of this renderer or was destroyed, RendererSizeInvalid when the size is not positive, GLNotImplemented when the scene has something the renderer cannot draw yet (unless SkipUnsupported is set), and the errors of MakeCurrent and SwapBuffers. Nothing is presented when it fails.

Flutter: no counterpart

func (*Renderer) RenderCapture

func (r *Renderer) RenderCapture(s gpu.Surface, scene *ui.Scene, size ui.Size, dpr float32) (*image.RGBA, error)

RenderCapture is Render that also returns the frame it drew, top row first, read back before it was presented (the content of a window is undefined after the swap). It also fails with GLReadPixelsFailed.

Flutter: no counterpart

func (*Renderer) Snapshot

func (r *Renderer) Snapshot(scene *ui.Scene, size ui.Size) (*image.RGBA, error)

Snapshot draws the scene into a new image of the size, without a window: the work of Picture.ToImage and Scene.ToImage. The scene is drawn over transparent pixels into a pooled framebuffer, which is read back; the pixels are premultiplied, top row first. The context must exist, so a surface has to have been attached at some point; it is made current with one of the live surfaces, or without any. It fails with RendererClosed, RendererNotAttached, RendererSizeInvalid, GLNotImplemented as Render does, and the errors of MakeCurrent, of the framebuffer's pool and of reading the pixels back.

Flutter: no counterpart

type RendererOpts

type RendererOpts struct {
	// Background is the color every frame is cleared to before the scene is drawn.
	// The default is opaque white.
	Background ui.Color
	// HasBackground says that Background was set, so that a transparent black
	// background can be asked for.
	HasBackground bool
	// RasterCacheAfter turns on the raster cache: a layer that a scene retains (it is
	// in this many consecutive scenes) is drawn into a texture that later frames draw
	// instead of its contents. Zero, the default, keeps nothing. The engine sets 3: the
	// layer of a RepaintBoundary that the framework did not repaint for three frames.
	RasterCacheAfter int
	// Damage makes Render tell the compositor which part of the window changed from
	// the frame before it, when the display has EGL_KHR_swap_buffers_with_damage (or
	// the EXT extension): the scene is compared with the last one of the window, and
	// the frame is still drawn whole. It costs a walk of the scene's layers for each
	// frame.
	Damage bool
	// SkipUnsupported makes Render leave out what the renderer cannot draw yet,
	// and count it in LastFrame, instead of failing with GLNotImplemented. The
	// development examples use it to show what works.
	SkipUnsupported bool
	// OnContextRestored is called when the browser gives a lost WebGL context back (the web
	// only; an EGL context is never lost), from a goroutine of the browser's event: it must
	// hand over to the UI thread and ask for a frame, which draws whole after the renderer made
	// its resources again.
	OnContextRestored func()
}

RendererOpts are the optional parameters of NewRenderer.

Flutter: no counterpart

type Stats

type Stats struct {
	// Live objects: made and not deleted, whether in use or pooled.
	Textures, Buffers, Framebuffers, Renderbuffers, Programs int
	// Pooled objects: free, waiting to be reused.
	FreeTextures, FreeBuffers, FreeFramebuffers int
	// StateSkipped is how many state changes (viewport, scissor, blend, color mask,
	// stencil, program, texture, framebuffer, vertex array and buffer bindings, clear
	// color) were not sent to GL because it had the value already. UniformsSet and
	// UniformsSkipped are the same for the uniforms of the programs.
	StateSkipped, UniformsSet, UniformsSkipped uint64
}

Stats says how many GL objects the device has, for tests and diagnostics.

Flutter: no counterpart

type Surface

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

Surface is an EGL window surface of a Context.

Flutter: no counterpart

func (*Surface) Destroy

func (s *Surface) Destroy()

Destroy releases the surface. Do it before the native window goes away.

Flutter: no counterpart

type Texture

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

Texture is a 2D texture. Get one from Device.AcquireTexture and give it back with Device.ReleaseTexture.

Flutter: no counterpart

func (*Texture) Format

func (t *Texture) Format() TextureFormat

Format is the pixel format.

Flutter: no counterpart

func (*Texture) Height

func (t *Texture) Height() int

Height is the height in pixels.

Flutter: no counterpart

func (*Texture) ID

func (t *Texture) ID() uint32

ID is the GL name of the texture.

Flutter: no counterpart

func (*Texture) Width

func (t *Texture) Width() int

Width is the width in pixels.

Flutter: no counterpart

type TextureFormat

type TextureFormat int

TextureFormat is the pixel format of a texture.

Flutter: no counterpart

const (
	// TextureFormatUnspecified is the zero value: TextureFormatRGBA8.
	//
	// Flutter: no counterpart
	TextureFormatUnspecified TextureFormat = iota
	// TextureFormatRGBA8 is 8 bits per channel, premultiplied alpha.
	//
	// Flutter: no counterpart
	TextureFormatRGBA8
	// TextureFormatR8 is one 8-bit channel: coverage masks.
	//
	// Flutter: no counterpart
	TextureFormatR8
)

The texture formats.

Directories

Path Synopsis
Command glwebtest is the program of the browser tests of the WebGL 2 renderer (step 21.4, SPEC §9.1, §17).
Command glwebtest is the program of the browser tests of the WebGL 2 renderer (step 21.4, SPEC §9.1, §17).

Jump to

Keyboard shortcuts

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