gofmt
This commit is contained in:
parent
56ea7050a6
commit
4c9ba69910
2 changed files with 27 additions and 27 deletions
|
@ -233,16 +233,16 @@ func EndTextureMode() {
|
||||||
|
|
||||||
// BeginScissorMode - Begins scissor mode (define screen area for following drawing)
|
// BeginScissorMode - Begins scissor mode (define screen area for following drawing)
|
||||||
func BeginScissorMode(x, y, width, height int32) {
|
func BeginScissorMode(x, y, width, height int32) {
|
||||||
cx := (C.int)(x)
|
cx := (C.int)(x)
|
||||||
cy := (C.int)(y)
|
cy := (C.int)(y)
|
||||||
cwidth := (C.int)(width)
|
cwidth := (C.int)(width)
|
||||||
cheight := (C.int)(height)
|
cheight := (C.int)(height)
|
||||||
C.BeginScissorMode(cx, cy, cwidth, cheight)
|
C.BeginScissorMode(cx, cy, cwidth, cheight)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EndScissorMode - Ends scissor mode
|
// EndScissorMode - Ends scissor mode
|
||||||
func EndScissorMode() {
|
func EndScissorMode() {
|
||||||
C.EndScissorMode()
|
C.EndScissorMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMouseRay - Returns a ray trace from mouse position
|
// GetMouseRay - Returns a ray trace from mouse position
|
||||||
|
|
|
@ -47,25 +47,25 @@ func LoadFontEx(fileName string, fontSize int32, fontChars *int32, charsCount in
|
||||||
|
|
||||||
// LoadFontFromImage - Loads an Image font file (XNA style)
|
// LoadFontFromImage - Loads an Image font file (XNA style)
|
||||||
func LoadFontFromImage(image Image, key Color, firstChar int32) Font {
|
func LoadFontFromImage(image Image, key Color, firstChar int32) Font {
|
||||||
cimage := image.cptr()
|
cimage := image.cptr()
|
||||||
ckey := key.cptr()
|
ckey := key.cptr()
|
||||||
cfirstChar := (C.int)(firstChar)
|
cfirstChar := (C.int)(firstChar)
|
||||||
ret := C.LoadFontFromImage(*cimage, *ckey, cfirstChar)
|
ret := C.LoadFontFromImage(*cimage, *ckey, cfirstChar)
|
||||||
v := newFontFromPointer(unsafe.Pointer(&ret))
|
v := newFontFromPointer(unsafe.Pointer(&ret))
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFontData - Load font data for further use
|
// LoadFontData - Load font data for further use
|
||||||
func LoadFontData(fileName string, fontSize int32, fontChars *int32, charsCount, typ int32) *CharInfo {
|
func LoadFontData(fileName string, fontSize int32, fontChars *int32, charsCount, typ int32) *CharInfo {
|
||||||
cfileName := C.CString(fileName)
|
cfileName := C.CString(fileName)
|
||||||
defer C.free(unsafe.Pointer(cfileName))
|
defer C.free(unsafe.Pointer(cfileName))
|
||||||
cfontSize := (C.int)(fontSize)
|
cfontSize := (C.int)(fontSize)
|
||||||
cfontChars := (*C.int)(unsafe.Pointer(fontChars))
|
cfontChars := (*C.int)(unsafe.Pointer(fontChars))
|
||||||
ccharsCount := (C.int)(charsCount)
|
ccharsCount := (C.int)(charsCount)
|
||||||
ctype := (C.int)(typ)
|
ctype := (C.int)(typ)
|
||||||
ret := C.LoadFontData(cfileName, cfontSize, cfontChars, ccharsCount, ctype)
|
ret := C.LoadFontData(cfileName, cfontSize, cfontChars, ccharsCount, ctype)
|
||||||
v := newCharInfoFromPointer(unsafe.Pointer(&ret))
|
v := newCharInfoFromPointer(unsafe.Pointer(&ret))
|
||||||
return &v
|
return &v
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnloadFont - Unload Font from GPU memory (VRAM)
|
// UnloadFont - Unload Font from GPU memory (VRAM)
|
||||||
|
@ -102,12 +102,12 @@ func DrawTextRec(font Font, text string, rec Rectangle, fontSize, spacing float3
|
||||||
cfont := font.cptr()
|
cfont := font.cptr()
|
||||||
ctext := C.CString(text)
|
ctext := C.CString(text)
|
||||||
defer C.free(unsafe.Pointer(ctext))
|
defer C.free(unsafe.Pointer(ctext))
|
||||||
crec := rec.cptr()
|
crec := rec.cptr()
|
||||||
cfontSize := (C.float)(fontSize)
|
cfontSize := (C.float)(fontSize)
|
||||||
cspacing := (C.float)(spacing)
|
cspacing := (C.float)(spacing)
|
||||||
cwordWrap := (C.bool)(wordWrap)
|
cwordWrap := (C.bool)(wordWrap)
|
||||||
ctint := tint.cptr()
|
ctint := tint.cptr()
|
||||||
C.DrawTextRec(*cfont, ctext, *crec, cfontSize, cspacing, cwordWrap, *ctint)
|
C.DrawTextRec(*cfont, ctext, *crec, cfontSize, cspacing, cwordWrap, *ctint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DrawTextRecEx - Draw text using font inside rectangle limits with support for text selection
|
// DrawTextRecEx - Draw text using font inside rectangle limits with support for text selection
|
||||||
|
@ -115,16 +115,16 @@ func DrawTextRecEx(font Font, text string, rec Rectangle, fontSize, spacing floa
|
||||||
cfont := font.cptr()
|
cfont := font.cptr()
|
||||||
ctext := C.CString(text)
|
ctext := C.CString(text)
|
||||||
defer C.free(unsafe.Pointer(ctext))
|
defer C.free(unsafe.Pointer(ctext))
|
||||||
crec := rec.cptr()
|
crec := rec.cptr()
|
||||||
cfontSize := (C.float)(fontSize)
|
cfontSize := (C.float)(fontSize)
|
||||||
cspacing := (C.float)(spacing)
|
cspacing := (C.float)(spacing)
|
||||||
cwordWrap := (C.bool)(wordWrap)
|
cwordWrap := (C.bool)(wordWrap)
|
||||||
ctint := tint.cptr()
|
ctint := tint.cptr()
|
||||||
cselectStart := (C.int)(selectStart)
|
cselectStart := (C.int)(selectStart)
|
||||||
cselectLength := (C.int)(selectLength)
|
cselectLength := (C.int)(selectLength)
|
||||||
cselectText := selectText.cptr()
|
cselectText := selectText.cptr()
|
||||||
cselectBack := selectBack.cptr()
|
cselectBack := selectBack.cptr()
|
||||||
C.DrawTextRecEx(*cfont, ctext, *crec, cfontSize, cspacing, cwordWrap, *ctint, cselectStart, cselectLength, *cselectText, *cselectBack)
|
C.DrawTextRecEx(*cfont, ctext, *crec, cfontSize, cspacing, cwordWrap, *ctint, cselectStart, cselectLength, *cselectText, *cselectBack)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MeasureText - Measure string width for default font
|
// MeasureText - Measure string width for default font
|
||||||
|
@ -151,9 +151,9 @@ func MeasureTextEx(font Font, text string, fontSize float32, spacing float32) Ve
|
||||||
|
|
||||||
// GetGlyphIndex - Returns index position for a unicode character on spritefont
|
// GetGlyphIndex - Returns index position for a unicode character on spritefont
|
||||||
func GetGlyphIndex(font Font, character int32) int32 {
|
func GetGlyphIndex(font Font, character int32) int32 {
|
||||||
cfont := font.cptr()
|
cfont := font.cptr()
|
||||||
ccharacter := (C.int)(character)
|
ccharacter := (C.int)(character)
|
||||||
ret := C.GetGlyphIndex(*cfont, ccharacter)
|
ret := C.GetGlyphIndex(*cfont, ccharacter)
|
||||||
v := (int32)(ret)
|
v := (int32)(ret)
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue