slbool

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: BSD-3-Clause Imports: 0 Imported by: 0

README

slbool

slbool defines a HLSL and Go friendly int32 Bool type. The standard HLSL bool type causes obscure errors, and the int32 obeys the 4 byte basic alignment requirements.

gosl automatically converts this Go code into appropriate HLSL code.

Documentation

Overview

package slbool defines a HLSL friendly int32 Bool type. The standard HLSL bool type causes obscure errors, and the int32 obeys the 4 byte basic alignment requirements.

gosl automatically converts this Go code into appropriate HLSL code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFalse

func IsFalse(b Bool) bool

IsFalse returns whether the given bool is false

func IsTrue

func IsTrue(b Bool) bool

IsTrue returns whether the given bool is true

Types

type Bool

type Bool int32

Bool is an HLSL friendly int32 Bool type.

const (
	// False is the [Bool] false value
	False Bool = 0
	// True is the [Bool] true value
	True Bool = 1
)

func FromBool

func FromBool(b bool) Bool

FromBool returns the given Go bool as a Bool

func (Bool) Bool

func (b Bool) Bool() bool

Bool returns the Bool as a standard Go bool

func (*Bool) FromString

func (b *Bool) FromString(s string)

FromString sets the bool from the given string

func (Bool) IsFalse

func (b Bool) IsFalse() bool

IsFalse returns whether the bool is false

func (Bool) IsTrue

func (b Bool) IsTrue() bool

IsTrue returns whether the bool is true

func (Bool) MarshalText

func (b Bool) MarshalText() ([]byte, error)

MarshalText implements the encoding/text.Marshaler interface

func (*Bool) SetBool

func (b *Bool) SetBool(bb bool)

SetBool sets the Bool from a standard Go bool

func (Bool) String

func (b Bool) String() string

String returns the bool as a string ("true"/"false")

func (*Bool) UnmarshalText

func (b *Bool) UnmarshalText(s []byte) error

UnmarshalText implements the encoding/text.Unmarshaler interface

Jump to

Keyboard shortcuts

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