2018-07-22 00:12:22 +00:00
|
|
|
package sdl
|
|
|
|
|
|
|
|
import (
|
2019-04-10 00:35:44 +00:00
|
|
|
"git.kirsle.net/apps/doodle/lib/render"
|
2018-07-22 00:12:22 +00:00
|
|
|
"github.com/veandco/go-sdl2/sdl"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ColorToSDL converts Doodle's Color type to an sdl.Color.
|
|
|
|
func ColorToSDL(c render.Color) sdl.Color {
|
2018-07-26 03:25:02 +00:00
|
|
|
return sdl.Color{
|
|
|
|
R: c.Red,
|
|
|
|
G: c.Green,
|
|
|
|
B: c.Blue,
|
|
|
|
A: c.Alpha,
|
|
|
|
}
|
2018-07-22 00:12:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// RectToSDL converts Doodle's Rect type to an sdl.Rect.
|
|
|
|
func RectToSDL(r render.Rect) sdl.Rect {
|
|
|
|
return sdl.Rect{
|
|
|
|
X: r.X,
|
|
|
|
Y: r.Y,
|
|
|
|
W: r.W,
|
|
|
|
H: r.H,
|
|
|
|
}
|
|
|
|
}
|