opengles31

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphicsImpl

type GraphicsImpl struct {
}

GraphicsImpl is the graphics provider for the mobile implementation of OpenGL.

func InitOpenGLES2

func InitOpenGLES2() (*GraphicsImpl, error)

InitOpenGLES2 initializes the OpenGL ES 2 graphics provider and sets it to be the current provider for the module.

func (*GraphicsImpl) ActiveTexture

func (impl *GraphicsImpl) ActiveTexture(t graphics.Texture)

ActiveTexture selects the active texture unit

func (*GraphicsImpl) AttachShader

func (impl *GraphicsImpl) AttachShader(p graphics.Program, s graphics.Shader)

AttachShader attaches a shader object to a program object

func (*GraphicsImpl) BindBuffer

func (impl *GraphicsImpl) BindBuffer(target graphics.Enum, b graphics.Buffer)

BindBuffer binds a buffer to the OpenGL target specified by enum

func (*GraphicsImpl) BindFragDataLocation

func (impl *GraphicsImpl) BindFragDataLocation(p graphics.Program, color uint32, name string)

BindFragDataLocation binds a user-defined varying out variable to a fragment shader color number. NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) BindFramebuffer

func (impl *GraphicsImpl) BindFramebuffer(target graphics.Enum, fb graphics.Buffer)

BindFramebuffer binds a framebuffer to a framebuffer target

func (*GraphicsImpl) BindRenderbuffer

func (impl *GraphicsImpl) BindRenderbuffer(target graphics.Enum, renderbuffer graphics.Buffer)

BindRenderbuffer binds a renderbuffer to a renderbuffer target

func (*GraphicsImpl) BindTexture

func (impl *GraphicsImpl) BindTexture(target graphics.Enum, t graphics.Texture)

BindTexture binds a texture to the OpenGL target specified by enum

func (*GraphicsImpl) BindVertexArray

func (impl *GraphicsImpl) BindVertexArray(a uint32)

BindVertexArray binds a vertex array object NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) BlendEquation

func (impl *GraphicsImpl) BlendEquation(mode graphics.Enum)

BlendEquation specifies the equation used for both the RGB and alpha blend equations

func (*GraphicsImpl) BlendFunc

func (impl *GraphicsImpl) BlendFunc(sFactor, dFactor graphics.Enum)

BlendFunc specifies the pixel arithmetic for the blend fucntion

func (*GraphicsImpl) BlitFramebuffer

func (impl *GraphicsImpl) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int32, mask graphics.Bitfield, filter graphics.Enum)

BlitFramebuffer copies a block of pixels from one framebuffer object to another

func (*GraphicsImpl) BufferData

func (impl *GraphicsImpl) BufferData(target graphics.Enum, size int, data unsafe.Pointer, usage graphics.Enum)

BufferData creates a new data store for the bound buffer object.

func (*GraphicsImpl) CheckFramebufferStatus

func (impl *GraphicsImpl) CheckFramebufferStatus(target graphics.Enum) graphics.Enum

CheckFramebufferStatus checks the completeness status of a framebuffer

func (*GraphicsImpl) Clear

func (impl *GraphicsImpl) Clear(mask graphics.Enum)

Clear clears the window buffer specified in mask

func (*GraphicsImpl) ClearColor

func (impl *GraphicsImpl) ClearColor(red, green, blue, alpha float32)

ClearColor specifies the RGBA value used to clear the color buffers

func (*GraphicsImpl) CompileShader

func (impl *GraphicsImpl) CompileShader(s graphics.Shader)

CompileShader compiles the shader object

func (*GraphicsImpl) CreateProgram

func (impl *GraphicsImpl) CreateProgram() graphics.Program

CreateProgram creates a new shader program object

func (*GraphicsImpl) CreateShader

func (impl *GraphicsImpl) CreateShader(ty graphics.Enum) graphics.Shader

CreateShader creates a new shader object

func (*GraphicsImpl) CullFace

func (impl *GraphicsImpl) CullFace(mode graphics.Enum)

CullFace specifies whether to use front or back face culling

func (*GraphicsImpl) DeleteBuffer

func (impl *GraphicsImpl) DeleteBuffer(b graphics.Buffer)

DeleteBuffer deletes the OpenGL buffer object

func (*GraphicsImpl) DeleteFramebuffer

func (impl *GraphicsImpl) DeleteFramebuffer(fb graphics.Buffer)

DeleteFramebuffer deletes the framebuffer object

func (*GraphicsImpl) DeleteProgram

func (impl *GraphicsImpl) DeleteProgram(p graphics.Program)

DeleteProgram deletes the shader program object

func (*GraphicsImpl) DeleteRenderbuffer

func (impl *GraphicsImpl) DeleteRenderbuffer(rb graphics.Buffer)

DeleteRenderbuffer deletes the renderbuffer object

func (*GraphicsImpl) DeleteShader

func (impl *GraphicsImpl) DeleteShader(s graphics.Shader)

DeleteShader deletes the shader object

func (*GraphicsImpl) DeleteTexture

func (impl *GraphicsImpl) DeleteTexture(v graphics.Texture)

DeleteTexture deletes the specified texture

func (*GraphicsImpl) DeleteVertexArray

func (impl *GraphicsImpl) DeleteVertexArray(a uint32)

DeleteVertexArray deletes an OpenGL VAO NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) DepthMask

func (impl *GraphicsImpl) DepthMask(flag bool)

DepthMask enables or disables writing into the depth buffer

func (*GraphicsImpl) Disable

func (impl *GraphicsImpl) Disable(e graphics.Enum)

Disable disables various GL capabilities.

func (*GraphicsImpl) DrawArrays

func (impl *GraphicsImpl) DrawArrays(mode graphics.Enum, first int32, count int32)

DrawArrays renders primitives from array data

func (*GraphicsImpl) DrawBuffers

func (impl *GraphicsImpl) DrawBuffers(buffers []uint32)

DrawBuffers specifies a list of color buffers to be drawn into NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) DrawElements

func (impl *GraphicsImpl) DrawElements(mode graphics.Enum, count int32, ty graphics.Enum, indices unsafe.Pointer)

DrawElements renders primitives from array data

func (*GraphicsImpl) Enable

func (impl *GraphicsImpl) Enable(e graphics.Enum)

Enable enables various GL capabilities

func (*GraphicsImpl) EnableVertexAttribArray

func (impl *GraphicsImpl) EnableVertexAttribArray(a uint32)

EnableVertexAttribArray enables a vertex attribute array

func (*GraphicsImpl) Finish

func (impl *GraphicsImpl) Finish()

Finish blocks until the effects of all previously called GL commands are complete

func (*GraphicsImpl) Flush

func (impl *GraphicsImpl) Flush()

Flush forces the execution of GL commands that have been buffered

func (*GraphicsImpl) FramebufferRenderbuffer

func (impl *GraphicsImpl) FramebufferRenderbuffer(target, attachment, renderbuffertarget graphics.Enum, renderbuffer graphics.Buffer)

FramebufferRenderbuffer attaches a renderbuffer as a logical buffer of a framebuffer object

func (*GraphicsImpl) FramebufferTexture2D

func (impl *GraphicsImpl) FramebufferTexture2D(target, attachment, textarget graphics.Enum, texture graphics.Texture, level int32)

FramebufferTexture2D attaches a texture object to a framebuffer

func (*GraphicsImpl) GenBuffer

func (impl *GraphicsImpl) GenBuffer() graphics.Buffer

GenBuffer creates an OpenGL buffer object

func (*GraphicsImpl) GenFramebuffer

func (impl *GraphicsImpl) GenFramebuffer() graphics.Buffer

GenFramebuffer generates a OpenGL framebuffer object

func (*GraphicsImpl) GenRenderbuffer

func (impl *GraphicsImpl) GenRenderbuffer() graphics.Buffer

GenRenderbuffer generates a OpenGL renderbuffer object

func (*GraphicsImpl) GenTexture

func (impl *GraphicsImpl) GenTexture() graphics.Texture

GenTexture creates an OpenGL texture object

func (*GraphicsImpl) GenVertexArray

func (impl *GraphicsImpl) GenVertexArray() uint32

GenVertexArray creates an OpoenGL VAO NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) GenerateMipmap

func (impl *GraphicsImpl) GenerateMipmap(t graphics.Enum)

GenerateMipmap generates mipmaps for a specified texture target

func (*GraphicsImpl) GetAttribLocation

func (impl *GraphicsImpl) GetAttribLocation(p graphics.Program, name string) int32

GetAttribLocation returns the location of a attribute variable

func (*GraphicsImpl) GetError

func (impl *GraphicsImpl) GetError() uint32

GetError returns the next error

func (*GraphicsImpl) GetProgramInfoLog

func (impl *GraphicsImpl) GetProgramInfoLog(p graphics.Program) string

GetProgramInfoLog returns the information log for a program object

func (*GraphicsImpl) GetProgramiv

func (impl *GraphicsImpl) GetProgramiv(p graphics.Program, pname graphics.Enum, params *int32)

GetProgramiv returns a parameter from the program object

func (*GraphicsImpl) GetShaderInfoLog

func (impl *GraphicsImpl) GetShaderInfoLog(s graphics.Shader) string

GetShaderInfoLog returns the information log for a shader object

func (*GraphicsImpl) GetShaderiv

func (impl *GraphicsImpl) GetShaderiv(s graphics.Shader, pname graphics.Enum, params *int32)

GetShaderiv returns a parameter from the shader object

func (*GraphicsImpl) GetUniformLocation

func (impl *GraphicsImpl) GetUniformLocation(p graphics.Program, name string) int32

GetUniformLocation returns the location of a uniform variable

func (*GraphicsImpl) LinkProgram

func (impl *GraphicsImpl) LinkProgram(p graphics.Program)

LinkProgram links a program object

func (*GraphicsImpl) PolygonMode

func (impl *GraphicsImpl) PolygonMode(face, mode graphics.Enum)

PolygonMode sets a polygon rasterization mode.

func (*GraphicsImpl) PolygonOffset

func (impl *GraphicsImpl) PolygonOffset(factor float32, units float32)

PolygonOffset sets the scale and units used to calculate depth values

func (*GraphicsImpl) Ptr

func (impl *GraphicsImpl) Ptr(data interface{}) unsafe.Pointer

Ptr takes a slice or pointer (to a singular scalar value or the first element of an array or slice) and returns its GL-compatible address. NOTE: Shamelessly ripped from: github.com/go-gl/gl/blob/master/v3.3-core/gl/conversions.go Thanks, guys!

func (*GraphicsImpl) PtrOffset

func (impl *GraphicsImpl) PtrOffset(offset int) unsafe.Pointer

PtrOffset takes a pointer offset and returns a GL-compatible pointer. Useful for functions such as glVertexAttribPointer that take pointer parameters indicating an offset rather than an absolute memory address.

func (*GraphicsImpl) ReadBuffer

func (impl *GraphicsImpl) ReadBuffer(src graphics.Enum)

ReadBuffer specifies the color buffer source for pixels NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) RenderbufferStorage

func (impl *GraphicsImpl) RenderbufferStorage(target graphics.Enum, internalformat graphics.Enum, width int32, height int32)

RenderbufferStorage establishes the format and dimensions of a renderbuffer

func (*GraphicsImpl) RenderbufferStorageMultisample

func (impl *GraphicsImpl) RenderbufferStorageMultisample(target graphics.Enum, samples int32, internalformat graphics.Enum, width int32, height int32)

RenderbufferStorageMultisample establishes the format and dimensions of a renderbuffer

func (*GraphicsImpl) Scissor

func (impl *GraphicsImpl) Scissor(x, y, w, h int32)

Scissor clips to a rectangle with the location and dimensions specified.

func (*GraphicsImpl) ShaderSource

func (impl *GraphicsImpl) ShaderSource(s graphics.Shader, source string)

ShaderSource replaces the source code for a shader object.

func (*GraphicsImpl) TexImage2D

func (impl *GraphicsImpl) TexImage2D(target graphics.Enum, level, intfmt, width, height, border int32, format graphics.Enum, ty graphics.Enum, ptr unsafe.Pointer, dataLength int)

TexImage2D writes a 2D texture image.

func (*GraphicsImpl) TexImage2DMultisample

func (impl *GraphicsImpl) TexImage2DMultisample(target graphics.Enum, samples int32, intfmt graphics.Enum, width int32, height int32, fixedsamplelocations bool)

TexImage2DMultisample establishes the data storage, format, dimensions, and number of samples of a multisample texture's image

func (*GraphicsImpl) TexParameterf

func (impl *GraphicsImpl) TexParameterf(target, pname graphics.Enum, param float32)

TexParameterf sets a float texture parameter

func (*GraphicsImpl) TexParameterfv

func (impl *GraphicsImpl) TexParameterfv(target, pname graphics.Enum, params *float32)

TexParameterfv sets a float texture parameter

func (*GraphicsImpl) TexParameteri

func (impl *GraphicsImpl) TexParameteri(target, pname graphics.Enum, param int32)

TexParameteri sets a float texture parameter

func (*GraphicsImpl) TexStorage3D

func (impl *GraphicsImpl) TexStorage3D(target graphics.Enum, level int32, intfmt uint32, width, height, depth int32)

TexStorage3D simultaneously specifies storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) TexSubImage3D

func (impl *GraphicsImpl) TexSubImage3D(target graphics.Enum, level, xoff, yoff, zoff, width, height, depth int32, fmt, ty graphics.Enum, ptr unsafe.Pointer)

TexSubImage3D specifies a three-dimensonal texture subimage NOTE: not implemented in OpenGL ES 2

func (*GraphicsImpl) Uniform1f

func (impl *GraphicsImpl) Uniform1f(location int32, v float32)

Uniform1f specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform1fv

func (impl *GraphicsImpl) Uniform1fv(location int32, values []float32)

Uniform1fv specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform1i

func (impl *GraphicsImpl) Uniform1i(location int32, v int32)

Uniform1i specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform1iv

func (impl *GraphicsImpl) Uniform1iv(location int32, values []int32)

Uniform1iv specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform3f

func (impl *GraphicsImpl) Uniform3f(location int32, v0, v1, v2 float32)

Uniform3f specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform3fv

func (impl *GraphicsImpl) Uniform3fv(location int32, values []float32)

Uniform3fv specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform4f

func (impl *GraphicsImpl) Uniform4f(location int32, v0, v1, v2, v3 float32)

Uniform4f specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) Uniform4fv

func (impl *GraphicsImpl) Uniform4fv(location int32, values []float32)

Uniform4fv specifies the value of a uniform variable for the current program object

func (*GraphicsImpl) UniformMatrix4fv

func (impl *GraphicsImpl) UniformMatrix4fv(location, count int32, transpose bool, value interface{})

UniformMatrix4fv specifies the value of a uniform variable for the current program object. NOTE: value should be a mgl.Mat4 or []mgl.Mat4, else it will panic.

func (*GraphicsImpl) UseProgram

func (impl *GraphicsImpl) UseProgram(p graphics.Program)

UseProgram installs a program object as part of the current rendering state

func (*GraphicsImpl) VertexAttribIPointer

func (impl *GraphicsImpl) VertexAttribIPointer(dst uint32, size int32, ty graphics.Enum, stride int32, ptr unsafe.Pointer)

VertexAttribPointer uses a bound buffer to define vertex attribute data. Only integer types are accepted by this function. Note: not implemented in OpenGL ES 2

func (*GraphicsImpl) VertexAttribPointer

func (impl *GraphicsImpl) VertexAttribPointer(dst uint32, size int32, ty graphics.Enum, normalized bool, stride int32, ptr unsafe.Pointer)

VertexAttribPointer uses a bound buffer to define vertex attribute data.

The size argument specifies the number of components per attribute, between 1-4. The stride argument specifies the byte offset between consecutive vertex attributes.

func (*GraphicsImpl) Viewport

func (impl *GraphicsImpl) Viewport(x, y, width, height int32)

Viewport sets the viewport, an affine transformation that normalizes device coordinates to window coordinates.

Jump to

Keyboard shortcuts

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