Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(g Gamelooper) error
Run starts the game loop with default video settings (NTSC 320x240, no interlacing). It will initialize the display, then repeatedly call Update() and Draw().
Types ¶
type Gamelooper ¶
type Gamelooper interface { // Update is called every frame to update game logic. // Return an error to exit the game loop, nil to continue. Update() error // Draw is called every frame to render the game. // The screen is already initialized and ready for drawing. Draw(screen *Screen) }
Gamelooper represents a game instance that can be updated and drawn.
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
Screen represents the display surface that can be drawn to.
func Init ¶
func Init(preset VideoPreset) *Screen
Init initializes display with the specified video preset. It sets up the framebuffer and renderer for drawing.
func (*Screen) BeginDrawing ¶
func (s *Screen) BeginDrawing()
BeginDrawing prepares for a new frame by swapping the framebuffer.
func (*Screen) EndDrawing ¶
func (s *Screen) EndDrawing()
EndDrawing finalizes the frame by flushing the renderer.
type VideoPreset ¶
type VideoPreset int
VideoPreset represents a predefined video configuration
const ( // LowRes is the most common setup: 320x240 without interlacing LowRes VideoPreset = iota // HighRes is 640x480 with interlacing HighRes )
Click to show internal directories.
Click to hide internal directories.