slbool

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: BSD-3-Clause Imports: 0 Imported by: 6

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 added in v1.0.17

func (b Bool) Bool() bool

Bool returns the Bool as a standard Go bool

func (*Bool) FromString added in v1.0.5

func (b *Bool) FromString(s string)

FromString sets the bool from the given string

func (Bool) IsFalse added in v1.0.5

func (b Bool) IsFalse() bool

IsFalse returns whether the bool is false

func (Bool) IsTrue added in v1.0.5

func (b Bool) IsTrue() bool

IsTrue returns whether the bool is true

func (Bool) MarshalJSON added in v1.0.6

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

MarshalJSON implements the encoding/json.Marshaler interface

func (*Bool) SetBool added in v1.0.5

func (b *Bool) SetBool(bb bool)

SetBool sets the Bool from a standard Go bool

func (Bool) String added in v1.0.5

func (b Bool) String() string

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

func (*Bool) UnmarshalJSON added in v1.0.6

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

UnmarshalJSON implements the encoding/json.Unmarshaler interface

Jump to

Keyboard shortcuts

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