Structs fixes
This commit is contained in:
parent
c930274575
commit
c42d027833
1 changed files with 28 additions and 22 deletions
|
@ -79,8 +79,9 @@ func newWaveFromPointer(ptr unsafe.Pointer) Wave {
|
||||||
|
|
||||||
// Sound source type
|
// Sound source type
|
||||||
type Sound struct {
|
type Sound struct {
|
||||||
SampleCount uint32
|
|
||||||
Stream AudioStream
|
Stream AudioStream
|
||||||
|
SampleCount uint32
|
||||||
|
_ [4]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// newSoundFromPointer - Returns new Sound from pointer
|
// newSoundFromPointer - Returns new Sound from pointer
|
||||||
|
@ -91,11 +92,11 @@ func newSoundFromPointer(ptr unsafe.Pointer) Sound {
|
||||||
// Music type (file streaming from memory)
|
// Music type (file streaming from memory)
|
||||||
// NOTE: Anything longer than ~10 seconds should be streamed
|
// NOTE: Anything longer than ~10 seconds should be streamed
|
||||||
type Music struct {
|
type Music struct {
|
||||||
|
Stream AudioStream
|
||||||
|
SampleCount uint32
|
||||||
|
Looping bool
|
||||||
CtxType int32
|
CtxType int32
|
||||||
CtxData unsafe.Pointer
|
CtxData unsafe.Pointer
|
||||||
SampleCount uint32
|
|
||||||
LoopCount uint32
|
|
||||||
Stream AudioStream
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newMusicFromPointer - Returns new Music from pointer
|
// newMusicFromPointer - Returns new Music from pointer
|
||||||
|
@ -106,14 +107,15 @@ func newMusicFromPointer(ptr unsafe.Pointer) Music {
|
||||||
// AudioStream type
|
// AudioStream type
|
||||||
// NOTE: Useful to create custom audio streams not bound to a specific file
|
// NOTE: Useful to create custom audio streams not bound to a specific file
|
||||||
type AudioStream struct {
|
type AudioStream struct {
|
||||||
|
// Buffer
|
||||||
|
Buffer *C.rAudioBuffer
|
||||||
// Frequency (samples per second)
|
// Frequency (samples per second)
|
||||||
SampleRate uint32
|
SampleRate uint32
|
||||||
// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
|
||||||
SampleSize uint32
|
SampleSize uint32
|
||||||
// Number of channels (1-mono, 2-stereo)
|
// Number of channels (1-mono, 2-stereo)
|
||||||
Channels uint32
|
Channels uint32
|
||||||
// Buffer
|
_ [4]byte
|
||||||
Buffer *C.rAudioBuffer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newAudioStreamFromPointer - Returns new AudioStream from pointer
|
// newAudioStreamFromPointer - Returns new AudioStream from pointer
|
||||||
|
@ -133,12 +135,12 @@ const (
|
||||||
CameraThirdPerson
|
CameraThirdPerson
|
||||||
)
|
)
|
||||||
|
|
||||||
// CameraType type
|
// CameraProjection type
|
||||||
type CameraType int32
|
type CameraProjection int32
|
||||||
|
|
||||||
// Camera projection modes
|
// Camera projection modes
|
||||||
const (
|
const (
|
||||||
CameraPerspective CameraType = iota
|
CameraPerspective CameraProjection = iota
|
||||||
CameraOrthographic
|
CameraOrthographic
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -616,14 +618,14 @@ type Camera3D struct {
|
||||||
// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
|
// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
|
||||||
Fovy float32
|
Fovy float32
|
||||||
// Camera type, controlling projection type, either CameraPerspective or CameraOrthographic.
|
// Camera type, controlling projection type, either CameraPerspective or CameraOrthographic.
|
||||||
Type CameraType
|
Type CameraProjection
|
||||||
}
|
}
|
||||||
|
|
||||||
// Camera type fallback, defaults to Camera3D
|
// Camera type fallback, defaults to Camera3D
|
||||||
type Camera = Camera3D
|
type Camera = Camera3D
|
||||||
|
|
||||||
// NewCamera3D - Returns new Camera3D
|
// NewCamera3D - Returns new Camera3D
|
||||||
func NewCamera3D(pos, target, up Vector3, fovy float32, ct CameraType) Camera3D {
|
func NewCamera3D(pos, target, up Vector3, fovy float32, ct CameraProjection) Camera3D {
|
||||||
return Camera3D{pos, target, up, fovy, ct}
|
return Camera3D{pos, target, up, fovy, ct}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,7 +731,6 @@ const (
|
||||||
|
|
||||||
// Material map type
|
// Material map type
|
||||||
const (
|
const (
|
||||||
// MapDiffuse
|
|
||||||
MapAlbedo = iota
|
MapAlbedo = iota
|
||||||
MapMetalness
|
MapMetalness
|
||||||
MapNormal
|
MapNormal
|
||||||
|
@ -803,7 +804,7 @@ type Material struct {
|
||||||
// Shader
|
// Shader
|
||||||
Shader Shader
|
Shader Shader
|
||||||
// Maps
|
// Maps
|
||||||
Maps [MaxMaterialMaps]MaterialMap
|
Maps *MaterialMap
|
||||||
// Generic parameters (if required)
|
// Generic parameters (if required)
|
||||||
Params [4]float32
|
Params [4]float32
|
||||||
}
|
}
|
||||||
|
@ -890,11 +891,11 @@ type Shader struct {
|
||||||
// Shader program id
|
// Shader program id
|
||||||
ID uint32
|
ID uint32
|
||||||
// Shader locations array
|
// Shader locations array
|
||||||
Locs [MaxShaderLocations]int32
|
Locs *int32
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewShader - Returns new Shader
|
// NewShader - Returns new Shader
|
||||||
func NewShader(id uint32, locs [MaxShaderLocations]int32) Shader {
|
func NewShader(id uint32, locs *int32) Shader {
|
||||||
return Shader{id, locs}
|
return Shader{id, locs}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,19 +908,19 @@ func newShaderFromPointer(ptr unsafe.Pointer) Shader {
|
||||||
type CharInfo struct {
|
type CharInfo struct {
|
||||||
// Character value (Unicode)
|
// Character value (Unicode)
|
||||||
Value int32
|
Value int32
|
||||||
// Character rectangle in sprite font
|
|
||||||
Rec Rectangle
|
|
||||||
// Character offset X when drawing
|
// Character offset X when drawing
|
||||||
OffsetX int32
|
OffsetX int32
|
||||||
// Character offset Y when drawing
|
// Character offset Y when drawing
|
||||||
OffsetY int32
|
OffsetY int32
|
||||||
// Character advance position X
|
// Character advance position X
|
||||||
AdvanceX int32
|
AdvanceX int32
|
||||||
|
// Character image data
|
||||||
|
Image Image
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCharInfo - Returns new CharInfo
|
// NewCharInfo - Returns new CharInfo
|
||||||
func NewCharInfo(value int32, rec Rectangle, offsetX, offsetY, advanceX int32) CharInfo {
|
func NewCharInfo(value int32, offsetX, offsetY, advanceX int32, image Image) CharInfo {
|
||||||
return CharInfo{value, rec, offsetX, offsetY, advanceX}
|
return CharInfo{value, offsetX, offsetY, advanceX, image}
|
||||||
}
|
}
|
||||||
|
|
||||||
// newCharInfoFromPointer - Returns new CharInfo from pointer
|
// newCharInfoFromPointer - Returns new CharInfo from pointer
|
||||||
|
@ -933,6 +934,8 @@ type Font struct {
|
||||||
BaseSize int32
|
BaseSize int32
|
||||||
// Number of characters
|
// Number of characters
|
||||||
CharsCount int32
|
CharsCount int32
|
||||||
|
// Padding around the chars
|
||||||
|
CharsPadding int32
|
||||||
// Characters texture atlas
|
// Characters texture atlas
|
||||||
Texture Texture2D
|
Texture Texture2D
|
||||||
// Characters rectangles in texture
|
// Characters rectangles in texture
|
||||||
|
@ -1024,7 +1027,8 @@ type TextureWrapMode int32
|
||||||
const (
|
const (
|
||||||
WrapRepeat TextureWrapMode = iota
|
WrapRepeat TextureWrapMode = iota
|
||||||
WrapClamp
|
WrapClamp
|
||||||
WrapMirror
|
WrapMirrorRepeat
|
||||||
|
WrapMirrorClamp
|
||||||
)
|
)
|
||||||
|
|
||||||
// Image type, bpp always RGBA (32bit)
|
// Image type, bpp always RGBA (32bit)
|
||||||
|
@ -1109,11 +1113,13 @@ type RenderTexture2D struct {
|
||||||
ID uint32
|
ID uint32
|
||||||
// Color buffer attachment texture
|
// Color buffer attachment texture
|
||||||
Texture Texture2D
|
Texture Texture2D
|
||||||
|
// Depth buffer attachment texture
|
||||||
|
Depth Texture2D
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRenderTexture2D - Returns new RenderTexture2D
|
// NewRenderTexture2D - Returns new RenderTexture2D
|
||||||
func NewRenderTexture2D(id uint32, texture Texture2D) RenderTexture2D {
|
func NewRenderTexture2D(id uint32, texture, depth Texture2D) RenderTexture2D {
|
||||||
return RenderTexture2D{id, texture}
|
return RenderTexture2D{id, texture, depth}
|
||||||
}
|
}
|
||||||
|
|
||||||
// newRenderTexture2DFromPointer - Returns new RenderTexture2D from pointer
|
// newRenderTexture2DFromPointer - Returns new RenderTexture2D from pointer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue