Documentation ¶
Overview ¶
Package sdlscreen implements a Displayer interface as required by tilegraphics and outputs using SDL2.
This package does not use SDL2 entirely correctly, nor is it really intended for serious use. It is mainly useful for testing the tilegraphics package without constantly reflashing a microcontroller.
Index ¶
- type Screen
- func (s *Screen) Close() error
- func (s *Screen) Display() error
- func (s *Screen) FillRectangle(x, y, width, height int16, c color.RGBA) error
- func (s *Screen) FillRectangleWithBuffer(x, y, width, height int16, buffer []color.RGBA) error
- func (s *Screen) FillScreen(c color.RGBA) error
- func (s *Screen) SetPixel(x, y int16, c color.RGBA)
- func (s *Screen) Size() (int16, int16)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen is a window implemented using SDL2 that can be drawn to.
func (*Screen) Display ¶
Display updates the window surface. This is necessary to actually write to the screen what was drawn using FillRectangle, for example.
func (*Screen) FillRectangle ¶
FillRectangle fills the given rectangle with the given color, and returns an error if something went wrong.
func (*Screen) FillRectangleWithBuffer ¶
FillRectangleWithBuffer fills the given rectangle with a slice of colors. The buffer must be in row major order.
func (*Screen) FillScreen ¶
FillScreen sets the whole screen to the given color.