Update definitions
This commit is contained in:
parent
d0612c27b2
commit
93855022d7
1 changed files with 126 additions and 162 deletions
284
raylib/raylib.go
284
raylib/raylib.go
|
@ -75,22 +75,6 @@ const (
|
||||||
CameraOrthographic
|
CameraOrthographic
|
||||||
)
|
)
|
||||||
|
|
||||||
// ShaderUniformDataType type
|
|
||||||
type ShaderUniformDataType int32
|
|
||||||
|
|
||||||
// ShaderUniformDataType enumeration
|
|
||||||
const (
|
|
||||||
ShaderUniformFloat ShaderUniformDataType = iota
|
|
||||||
ShaderUniformVec2
|
|
||||||
ShaderUniformVec3
|
|
||||||
ShaderUniformVec4
|
|
||||||
ShaderUniformInt
|
|
||||||
ShaderUniformIvec2
|
|
||||||
ShaderUniformIvec3
|
|
||||||
ShaderUniformIvec4
|
|
||||||
ShaderUniformSampler2d
|
|
||||||
)
|
|
||||||
|
|
||||||
// Some basic Defines
|
// Some basic Defines
|
||||||
const (
|
const (
|
||||||
Pi = 3.1415927
|
Pi = 3.1415927
|
||||||
|
@ -250,99 +234,69 @@ const (
|
||||||
KeyVolumeUp = 24
|
KeyVolumeUp = 24
|
||||||
KeyVolumeDown = 25
|
KeyVolumeDown = 25
|
||||||
|
|
||||||
|
MouseLeftButton = MouseButtonLeft
|
||||||
|
MouseRightButton = MouseButtonRight
|
||||||
|
MouseMiddleButton = MouseButtonMiddle
|
||||||
|
)
|
||||||
|
|
||||||
// Mouse Buttons
|
// Mouse Buttons
|
||||||
MouseLeftButton = 0
|
const (
|
||||||
MouseRightButton = 1
|
MouseButtonLeft = iota
|
||||||
MouseMiddleButton = 2
|
MouseButtonRight
|
||||||
MouseSideButton = 3
|
MouseButtonMiddle
|
||||||
MouseExtraButton = 4
|
MouseButtonSide
|
||||||
MouseForwardButton = 5
|
MouseButtonExtra
|
||||||
MouseBackButton = 6
|
MouseButtonForward
|
||||||
|
MouseButtonBack
|
||||||
|
)
|
||||||
|
|
||||||
// Touch points registered
|
// Mouse cursor
|
||||||
MaxTouchPoints = 2
|
type MouseCursor = int32
|
||||||
|
|
||||||
// Gamepad Number
|
const (
|
||||||
GamepadPlayer1 = 0
|
MouseCursorDefault MouseCursor = iota // Default pointer shape
|
||||||
GamepadPlayer2 = 1
|
MouseCursorArrow // Arrow shape
|
||||||
GamepadPlayer3 = 2
|
MouseCursorIBeam // Text writing cursor shape
|
||||||
GamepadPlayer4 = 3
|
MouseCursorCrosshair // Cross shape
|
||||||
|
MouseCursorPointingHand // Pointing hand cursor
|
||||||
|
MouseCursorResizeEW // Horizontal resize/move arrow shape
|
||||||
|
MouseCursorResizeNS // Vertical resize/move arrow shape
|
||||||
|
MouseCursorResizeNWSE // Top-left to bottom-right diagonal resize/move arrow shape
|
||||||
|
MouseCursorResizeNESW // The top-right to bottom-left diagonal resize/move arrow shape
|
||||||
|
MouseCursorResizeAll // The omni-directional resize/move cursor shape
|
||||||
|
MouseCursorNotAllowed // The operation-not-allowed shape
|
||||||
|
)
|
||||||
|
|
||||||
// Gamepad Buttons/Axis
|
// Gamepad Buttons
|
||||||
|
const (
|
||||||
|
GamepadButtonUnknown = iota // Unknown button, just for error checking
|
||||||
|
GamepadButtonLeftFaceUp // Gamepad left DPAD up button
|
||||||
|
GamepadButtonLeftFaceRight // Gamepad left DPAD right button
|
||||||
|
GamepadButtonLeftFaceDown // Gamepad left DPAD down button
|
||||||
|
GamepadButtonLeftFaceLeft // Gamepad left DPAD left button
|
||||||
|
GamepadButtonRightFaceUp // Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
|
||||||
|
GamepadButtonRightFaceRight // Gamepad right button right (i.e. PS3: Square, Xbox: X)
|
||||||
|
GamepadButtonRightFaceDown // Gamepad right button down (i.e. PS3: Cross, Xbox: A)
|
||||||
|
GamepadButtonRightFaceLeft // Gamepad right button left (i.e. PS3: Circle, Xbox: B)
|
||||||
|
GamepadButtonLeftTrigger1 // Gamepad top/back trigger left (first), it could be a trailing button
|
||||||
|
GamepadButtonLeftTrigger2 // Gamepad top/back trigger left (second), it could be a trailing button
|
||||||
|
GamepadButtonRightTrigger1 // Gamepad top/back trigger right (one), it could be a trailing button
|
||||||
|
GamepadButtonRightTrigger2 // Gamepad top/back trigger right (second), it could be a trailing button
|
||||||
|
GamepadButtonMiddleLeft // Gamepad center buttons, left one (i.e. PS3: Select)
|
||||||
|
GamepadButtonMiddle // Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
|
||||||
|
GamepadButtonMiddleRight // Gamepad center buttons, right one (i.e. PS3: Start)
|
||||||
|
GamepadButtonLeftThumb // Gamepad joystick pressed button left
|
||||||
|
GamepadButtonRightThumb // Gamepad joystick pressed button right
|
||||||
|
)
|
||||||
|
|
||||||
// PS3 USB Controller Buttons
|
// Gamepad Axis
|
||||||
GamepadPs3ButtonTriangle = 0
|
const (
|
||||||
GamepadPs3ButtonCircle = 1
|
GamepadAxisLeftX = iota // Gamepad left stick X axis
|
||||||
GamepadPs3ButtonCross = 2
|
GamepadAxisLeftY // Gamepad left stick Y axis
|
||||||
GamepadPs3ButtonSquare = 3
|
GamepadAxisRightX // Gamepad right stick X axis
|
||||||
GamepadPs3ButtonL1 = 6
|
GamepadAxisRightY // Gamepad right stick Y axis
|
||||||
GamepadPs3ButtonR1 = 7
|
GamepadAxisLeftTrigger // Gamepad back trigger left, pressure level: [1..-1]
|
||||||
GamepadPs3ButtonL2 = 4
|
GamepadAxisRightTrigger // Gamepad back trigger right, pressure level: [1..-1]
|
||||||
GamepadPs3ButtonR2 = 5
|
|
||||||
GamepadPs3ButtonStart = 8
|
|
||||||
GamepadPs3ButtonSelect = 9
|
|
||||||
GamepadPs3ButtonUp = 24
|
|
||||||
GamepadPs3ButtonRight = 25
|
|
||||||
GamepadPs3ButtonDown = 26
|
|
||||||
GamepadPs3ButtonLeft = 27
|
|
||||||
GamepadPs3ButtonPs = 12
|
|
||||||
|
|
||||||
// PS3 USB Controller Axis
|
|
||||||
GamepadPs3AxisLeftX = 0
|
|
||||||
GamepadPs3AxisLeftY = 1
|
|
||||||
GamepadPs3AxisRightX = 2
|
|
||||||
GamepadPs3AxisRightY = 5
|
|
||||||
// [1..-1] (pressure-level)
|
|
||||||
GamepadPs3AxisL2 = 3
|
|
||||||
// [1..-1] (pressure-level)
|
|
||||||
GamepadPs3AxisR2 = 4
|
|
||||||
|
|
||||||
// Xbox360 USB Controller Buttons
|
|
||||||
GamepadXboxButtonA = 0
|
|
||||||
GamepadXboxButtonB = 1
|
|
||||||
GamepadXboxButtonX = 2
|
|
||||||
GamepadXboxButtonY = 3
|
|
||||||
GamepadXboxButtonLb = 4
|
|
||||||
GamepadXboxButtonRb = 5
|
|
||||||
GamepadXboxButtonSelect = 6
|
|
||||||
GamepadXboxButtonStart = 7
|
|
||||||
GamepadXboxButtonUp = 10
|
|
||||||
GamepadXboxButtonRight = 11
|
|
||||||
GamepadXboxButtonDown = 12
|
|
||||||
GamepadXboxButtonLeft = 13
|
|
||||||
GamepadXboxButtonHome = 8
|
|
||||||
|
|
||||||
// Android Gamepad Controller (SNES CLASSIC)
|
|
||||||
GamepadAndroidDpadUp = 19
|
|
||||||
GamepadAndroidDpadDown = 20
|
|
||||||
GamepadAndroidDpadLeft = 21
|
|
||||||
GamepadAndroidDpadRight = 22
|
|
||||||
GamepadAndroidDpadCenter = 23
|
|
||||||
|
|
||||||
GamepadAndroidButtonA = 96
|
|
||||||
GamepadAndroidButtonB = 97
|
|
||||||
GamepadAndroidButtonC = 98
|
|
||||||
GamepadAndroidButtonX = 99
|
|
||||||
GamepadAndroidButtonY = 100
|
|
||||||
GamepadAndroidButtonZ = 101
|
|
||||||
GamepadAndroidButtonL1 = 102
|
|
||||||
GamepadAndroidButtonR1 = 103
|
|
||||||
GamepadAndroidButtonL2 = 104
|
|
||||||
GamepadAndroidButtonR2 = 105
|
|
||||||
|
|
||||||
// Xbox360 USB Controller Axis
|
|
||||||
// [-1..1] (left->right)
|
|
||||||
GamepadXboxAxisLeftX = 0
|
|
||||||
// [1..-1] (up->down)
|
|
||||||
GamepadXboxAxisLeftY = 1
|
|
||||||
// [-1..1] (left->right)
|
|
||||||
GamepadXboxAxisRightX = 2
|
|
||||||
// [1..-1] (up->down)
|
|
||||||
GamepadXboxAxisRightY = 3
|
|
||||||
// [-1..1] (pressure-level)
|
|
||||||
GamepadXboxAxisLt = 4
|
|
||||||
// [-1..1] (pressure-level)
|
|
||||||
GamepadXboxAxisRt = 5
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Some Basic Colors
|
// Some Basic Colors
|
||||||
|
@ -464,13 +418,8 @@ func NewMat2(m0, m1, m10, m11 float32) Mat2 {
|
||||||
return Mat2{m0, m1, m10, m11}
|
return Mat2{m0, m1, m10, m11}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quaternion type
|
// Quaternion, 4 components (Vector4 alias)
|
||||||
type Quaternion struct {
|
type Quaternion = Vector4
|
||||||
X float32
|
|
||||||
Y float32
|
|
||||||
Z float32
|
|
||||||
W float32
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewQuaternion - Returns new Quaternion
|
// NewQuaternion - Returns new Quaternion
|
||||||
func NewQuaternion(x, y, z, w float32) Quaternion {
|
func NewQuaternion(x, y, z, w float32) Quaternion {
|
||||||
|
@ -608,35 +557,54 @@ const (
|
||||||
|
|
||||||
// Shader location point type
|
// Shader location point type
|
||||||
const (
|
const (
|
||||||
LocVertexPosition = iota
|
ShaderLocVertexPosition = iota
|
||||||
LocVertexTexcoord01
|
ShaderLocVertexTexcoord01
|
||||||
LocVertexTexcoord02
|
ShaderLocVertexTexcoord02
|
||||||
LocVertexNormal
|
ShaderLocVertexNormal
|
||||||
LocVertexTangent
|
ShaderLocVertexTangent
|
||||||
LocVertexColor
|
ShaderLocVertexColor
|
||||||
LocMatrixMvp
|
ShaderLocMatrixMvp
|
||||||
LocMatrixView
|
ShaderLocMatrixView
|
||||||
LocMatrixProjection
|
ShaderLocMatrixProjection
|
||||||
LocMatrixModel
|
ShaderLocMatrixModel
|
||||||
LocMatrixNormal
|
ShaderLocMatrixNormal
|
||||||
LocVectorView
|
ShaderLocVectorView
|
||||||
LocColorDiffuse
|
ShaderLocColorDiffuse
|
||||||
LocColorSpecular
|
ShaderLocColorSpecular
|
||||||
LocColorAmbient
|
ShaderLocColorAmbient
|
||||||
LocMapAlbedo
|
ShaderLocMapAlbedo
|
||||||
LocMapMetalness
|
ShaderLocMapMetalness
|
||||||
LocMapNormal
|
ShaderLocMapNormal
|
||||||
LocMapRoughness
|
ShaderLocMapRoughness
|
||||||
LocMapOcclusion
|
ShaderLocMapOcclusion
|
||||||
LocMapEmission
|
ShaderLocMapEmission
|
||||||
LocMapHeight
|
ShaderLocMapHeight
|
||||||
LocMapCubemap
|
ShaderLocMapCubemap
|
||||||
LocMapIrradiance
|
ShaderLocMapIrradiance
|
||||||
LocMapPrefilter
|
ShaderLocMapPrefilter
|
||||||
LocMapBrdf
|
ShaderLocMapBrdf
|
||||||
|
|
||||||
|
ShaderLocMapDiffuse = ShaderLocMapAlbedo
|
||||||
|
ShaderLocMapSpecular = ShaderLocMapMetalness
|
||||||
)
|
)
|
||||||
|
|
||||||
// Material map type
|
// ShaderUniformDataType type
|
||||||
|
type ShaderUniformDataType int32
|
||||||
|
|
||||||
|
// ShaderUniformDataType enumeration
|
||||||
|
const (
|
||||||
|
ShaderUniformFloat ShaderUniformDataType = iota
|
||||||
|
ShaderUniformVec2
|
||||||
|
ShaderUniformVec3
|
||||||
|
ShaderUniformVec4
|
||||||
|
ShaderUniformInt
|
||||||
|
ShaderUniformIvec2
|
||||||
|
ShaderUniformIvec3
|
||||||
|
ShaderUniformIvec4
|
||||||
|
ShaderUniformSampler2d
|
||||||
|
)
|
||||||
|
|
||||||
|
// Material map index
|
||||||
const (
|
const (
|
||||||
MapAlbedo = iota
|
MapAlbedo = iota
|
||||||
MapMetalness
|
MapMetalness
|
||||||
|
@ -649,14 +617,10 @@ const (
|
||||||
MapCubemap
|
MapCubemap
|
||||||
MapIrradiance
|
MapIrradiance
|
||||||
MapPrefilter
|
MapPrefilter
|
||||||
)
|
MapBrdf
|
||||||
|
|
||||||
// Material map type
|
|
||||||
const (
|
|
||||||
MapDiffuse = MapAlbedo
|
MapDiffuse = MapAlbedo
|
||||||
MapSpecular = MapMetalness
|
MapSpecular = MapMetalness
|
||||||
LocMapDiffuse = LocMapAlbedo
|
|
||||||
LocMapSpecular = LocMapMetalness
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Shader and material limits
|
// Shader and material limits
|
||||||
|
@ -897,6 +861,13 @@ type Font struct {
|
||||||
Chars *GlyphInfo
|
Chars *GlyphInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Font type, defines generation method
|
||||||
|
const (
|
||||||
|
FontDefault = iota // Default font generation, anti-aliased
|
||||||
|
FontBitmap // Bitmap font generation, no anti-aliasing
|
||||||
|
FontSdf // SDF font generation, requires external shader
|
||||||
|
)
|
||||||
|
|
||||||
// PixelFormat - Texture format
|
// PixelFormat - Texture format
|
||||||
type PixelFormat int32
|
type PixelFormat int32
|
||||||
|
|
||||||
|
@ -979,6 +950,16 @@ const (
|
||||||
WrapMirrorClamp
|
WrapMirrorClamp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Cubemap layouts
|
||||||
|
const (
|
||||||
|
CubemapLayoutAutoDetect = iota // Automatically detect layout type
|
||||||
|
CubemapLayoutLineVertical // Layout is defined by a vertical line with faces
|
||||||
|
CubemapLayoutLineHorizontal // Layout is defined by a horizontal line with faces
|
||||||
|
CubemapLayoutCrossThreeByFour // Layout is defined by a 3x4 cross with cubemap faces
|
||||||
|
CubemapLayoutCrossFourByThree // Layout is defined by a 4x3 cross with cubemap faces
|
||||||
|
CubemapLayoutPanorama // Layout is defined by a panorama image (equirrectangular map)
|
||||||
|
)
|
||||||
|
|
||||||
// Image type, bpp always RGBA (32bit)
|
// Image type, bpp always RGBA (32bit)
|
||||||
// NOTE: Data stored in CPU memory (RAM)
|
// NOTE: Data stored in CPU memory (RAM)
|
||||||
type Image struct {
|
type Image struct {
|
||||||
|
@ -1059,23 +1040,6 @@ const (
|
||||||
LogNone
|
LogNone
|
||||||
)
|
)
|
||||||
|
|
||||||
// Mouse cursor
|
|
||||||
type MouseCursor = int32
|
|
||||||
|
|
||||||
const (
|
|
||||||
MouseCursorDefault MouseCursor = iota // Default pointer shape
|
|
||||||
MouseCursorArrow // Arrow shape
|
|
||||||
MouseCursorIBeam // Text writing cursor shape
|
|
||||||
MouseCursorCrosshair // Cross shape
|
|
||||||
MouseCursorPointingHand // Pointing hand cursor
|
|
||||||
MouseCursorResizeEW // Horizontal resize/move arrow shape
|
|
||||||
MouseCursorResizeNS // Vertical resize/move arrow shape
|
|
||||||
MouseCursorResizeNWSE // Top-left to bottom-right diagonal resize/move arrow shape
|
|
||||||
MouseCursorResizeNESW // The top-right to bottom-left diagonal resize/move arrow shape
|
|
||||||
MouseCursorResizeAll // The omni-directional resize/move cursor shape
|
|
||||||
MouseCursorNotAllowed // The operation-not-allowed shape
|
|
||||||
)
|
|
||||||
|
|
||||||
// N-patch layout
|
// N-patch layout
|
||||||
type NPatchLayout int32
|
type NPatchLayout int32
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue