mango

package module
v0.0.0-...-50d5a6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 12 Imported by: 0

README

Mango

About

Mango is a cross-platform, data-driven game engine written in Go. The engine is built with simplicity and usability in mind. As a result, Mango offers both an immediate mode rendering system as well as a retained mode rendering system. This allows developers build simple games faster while also providing the ability switch between render systems as a project grows more complex.

Warning: Mango is in extremely early stages. I would advise against using it to build a game but if you want to see how this might work, the Immediate Mode system is pretty usable. See examples.

Features

These are Mango's mean features so far:

  • Immediate Mode Render System
    • Primitives: Quad, Circle, Sprite, Line, etc
    • Batched Renderers: Quad, Pixel
  • Bitmap Font Rendering
  • Entity Component System (in progress)
  • UV Spritemap System
  • Input
  • Debug Tools
    • In-Game Logging System
  • imgui integration
    • Ability to create debug tools for your game

Usage

Default Mode

Coming soon...

Immediate Mode

Using Mango's immediate mode rendering system is extremely easy and requires minimal work:

import "github.com/micahke/mango"

func main() {

    // Initialize the engine and specify immediate mode rendering
    mango.Init(core.RENDER_MODE_IM)

    // Create a new window with vsync enabled
    mango.CreateWindow(800, 600, "TITLE", true)

    mango.IM.ConnectScene(&Game{})
    mango.Start()

}

Immediate mode scenes only need to implement 3 simple methods for this to work:

type Game struct {}

func (game *Game) Init() {}

func (game *Game) Update() {}

func (game *Game) Draw() {

    mango.IM.DrawRect(0, 0, 100, 100)

}

Contributing

If you are looking to contribute to the project, start here. Simply clone the repo and run:

git clone https://github.com/micahke/mango.git
cd mango

Warning: Mango relies on GLFW and OpenGL to handle window creation and graphics. Please make sure these libraries are installed on your machine.

Documentation

Index

Constants

This section is empty.

Variables

RENDER MODES

Functions

func CreateScene

func CreateScene() *core.Scene

Creates a scene and sets up an ECS

func CreateWindow

func CreateWindow(width, height int, title string, vsync bool)

Creates a new window

func GetWindow

func GetWindow() *core.Window

TODO: move this

func Init

func Init(renderMode core.RenderMode, args ...any)

Initialization function for the engine

func SetScene

func SetScene(scene *core.Scene)

func Start

func Start()

Starts the main game loop

Types

type Mango

type Mango struct {
	RenderMode core.RenderMode // The currently set render mode
	Window     *core.Window
	LogPanel   *logging.LogPanel

	SceneEditor  *core.SceneEditor
	ShaderEditor *core.ShaderEditor
	ImguiSandbox *core.ImguiSandbox

	SystemManager *core.SystemManager
	// contains filtered or unexported fields
}
var Engine *Mango

The main engine instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL