Skip to content

Commit

Permalink
Add GPUInfo.TexWrapBorderColor to query for BorderColor support.
Browse files Browse the repository at this point in the history
Fixes #56
  • Loading branch information
slimsag committed Dec 2, 2014
1 parent 86a7549 commit f87adf2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions render.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ type GPUInfo struct {
// 4x4 matrix is 16 floating-point values) that can be used inside a GLSL
// fragment shader, or -1 if not available. Generally at least 64.
GLSLMaxFragmentInputs int

// Whether or not the graphics hardware supports the use of the
// BorderColor TexWrap mode. If the hardware doesn't support it the
// renderer falls back to the Clamp TexWrap mode in it's place.
//
// OpenGL ES 2 does not support BorderColor.
TexWrapBorderColor bool
}

// Renderer is capable of loading meshes, textures, and shaders. A renderer can
Expand Down
10 changes: 10 additions & 0 deletions texwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ const (

// BorderColor represents the extra area of the texture by the border color
// specified on the Texture object.
//
// Not all renderers support BorderColor (See GPUInfo.TexWrapBorderColor
// for more information). To check for support:
//
// if gpuInfo.TexWrapBorderColor {
// // Have BorderColor support.
// }
//
// Renderers fall back to the Clamp TexWrap mode in the event that you
// try and use BorderColor and the GPU does not support it.
BorderColor

// Mirror represents the extra area of the texture by mirroring itself into
Expand Down

0 comments on commit f87adf2

Please sign in to comment.