// Returns true if texture is valid, false otherwise.
767695
func (c *Context) IsTexture(texture *js.Object) bool {
	return c.Call("isTexture", texture).Bool()
}
647537
func LoadTexture(renderer *sdl.Renderer, file string) (*sdl.Texture, error) {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_file := C.CString(file)
	defer C.free(unsafe.Pointer(_file))
	_surface := C.IMG_LoadTexture(_renderer, _file)
	if _surface == nil {
		return nil, GetError()
	}
	return (*sdl.Texture)(unsafe.Pointer(_surface)), nil
}
397897
func (m xlMetaV1) IsValid() bool {
	return isXLMetaFormatValid(m.Version, m.Format) &&
		isXLMetaErasureInfoValid(m.Erasure.DataBlocks, m.Erasure.ParityBlocks)
}
981069
func (cfg *ScopeCfg) IsValid() bool {
	if cfg == nil ||
		strings.TrimSpace(cfg.Client.Provider) == "" ||
		strings.TrimSpace(cfg.Client.Address) == "" {
		return false
	}

	return true
}
1059291
func (sim *simra) NewTextTexture(text string, fontsize float64, fontcolor color.RGBA, rect image.Rectangle) *Texture {
	simlog.FuncIn()

	gl := sim.gl
	tex := gl.MakeTextureByText(text, fontsize, fontcolor, rect.Rectangle)
	t := &Texture{
		simra:   sim,
		texture: gl.NewTexture(tex),
	}
	runtime.SetFinalizer(t, (*Texture).release)

	simlog.FuncOut()
	return t
}
801099
func (c Cap) IsValid() bool {
	return c.center.Vector.IsUnit() && c.height <= fullHeight
}
587423
func (h Dense) IsValid() error {
	if len(h)%3 != 0 {
		return errors.New("hll byte size sould be a multiple of 3")
	}
	m := h.m()
	if m&(m-1) != 0 {
		return errors.New("hll byte size sould be 3 times a power of two")
	}
	var p byte
	for z := m; z != 0; z >>= 1 {
		p++
	}
	p--
	if p < 4 || p > 25 {
		return errors.New("p must be between 4 and 25, inclusive")
	}
	return nil
}
509864
func (l TransactionList) Valid(version ofxVersion) (bool, error) {
	var emptyDate Date
	if l.DtStart.Equal(emptyDate) {
		return false, errors.New("TransactionList.DtStart not filled")
	} else if l.DtEnd.Equal(emptyDate) {
		return false, errors.New("TransactionList.DtEnd not filled")
	}
	for _, t := range l.Transactions {
		if ok, err := t.Valid(version); !ok {
			return false, err
		}
	}

	return true, nil
}
1291417
func (spec *SampleSpec) Valid() bool {
	if C.pa_sample_spec_valid(spec.toC()) == 0 {
		return false
	}
	return true
}
930067
func IsImageFormat(name string) bool {
	_, err := getImageFormat(name)
	return err == nil
}
21216
func (renderer *Renderer) CreateTexture(format uint32, access int, w, h int32) (*Texture, error) {
	texture := C.SDL_CreateTexture(
		renderer.cptr(),
		C.Uint32(format),
		C.int(access),
		C.int(w),
		C.int(h))
	if texture == nil {
		return nil, GetError()
	}
	return (*Texture)(unsafe.Pointer(texture)), nil
}
1191544
func (animation *AnimationSet) AddTexture(texture *Texture) {
	simlog.FuncIn()
	animation.textures = append(animation.textures, texture)
	simlog.FuncOut()
}
1037238
func (texture *Texture) Query() (format uint32, access int, width int32, height int32, err error) {
	var _format C.Uint32
	var _access C.int
	var _width C.int
	var _height C.int

	ret := int(C.SDL_QueryTexture(texture.cptr(), &_format, &_access, &_width, &_height))

	format = uint32(_format)
	access = int(_access)
	width = int32(_width)
	height = int32(_height)
	err = errorFromInt(ret)

	return
}
99252
func (f FrameHeader) IsValid() bool {
	const sync = 0xffe00000
	if (f & sync) != sync {
		return false
	}
	if f.ID() == consts.VersionReserved {
		return false
	}
	if f.BitrateIndex() == 15 {
		return false
	}
	if f.SamplingFrequency() == consts.SamplingFrequencyReserved {
		return false
	}
	if f.Layer() == consts.LayerReserved {
		return false
	}
	if f.Emphasis() == 2 {
		return false
	}
	return true
}
353830
func (c *Context) BindTexture(target int, texture *js.Object) {
	c.Call("bindTexture", target, texture)
}
479074
func NewTextureResource(img Image) TextureResource {
	id := UploadTexture(img)
	return TextureResource{Texture: id, Width: float32(img.Width()), Height: float32(img.Height())}
}
1104323
func (p Path) IsValid() bool {
	if len(p.Path) < 1 {
		return false
	}

	for _, n := range p.Path {
		if !n.IsValid() {
			return false
		}
	}

	return true
}