Skip to content

devalexxx/Orion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platform Build Status
Windows Windows build
Ubuntu Ubuntu build
Macos ARM Macos arm build
Macos Macos build

Installation

Install xmake

https://xmake.io/#/guide/installation

From GitHub

Clone repository

git clone https://github.com/alspin8/Orion.git

Configure

xmake f --mode=<debug|release> --shared=<y|n> --unittest=<y|n> --nogpu=<y|n> --sandbox=<y|n>

Build

xmake

From xrepo

Add repository

xrepo add-repo orion-repo https://github.com/alspin8/xmake-repo.git main

Install package (version match with tags name)

xrepo install orion <version>

Usage

Create a simple program that draw a triangle.

xmake.lua

add_rules("mode.debug", "mode.release")

set_language("c++23")

add_repositories("orion-repo https://github.com/devalexxx/xmake-repo.git")

add_requires("orion", { config = { debug = is_mode("debug") } })

target("orion_test")
    set_kind("binary")
    add_files("src/*.cpp")

    add_packages("orion")
    add_rules("@orion/resource")

main.cpp

#include <orion/graphics.h>

int main(int argc, char** argv)
{
    auto event_manager = orion::EventManager::create();
    auto window        = orion::Window::create("Test");
    
    window->set_event_manager(event_manager);
    
    event_manager->subscribe<orion::Input::KeyEvent>([](const auto& event)
    {
        if (event.key == orion::Input::Key::ESCAPE && event.pressed)
        {
            event.window.lock()->close();    
        }
    });
    
    window->get_view().translate(orion::Vector3f(0.f, 0.f, 5.f));
    window->get_view().look_at  (orion::Vector3f(0.f, 0.f, 0.f));
    
    orion::Shape shape(orion::Primitive::TRIANGLE);
    
    while(!window->is_close())
    {
        window->clear(orion::ClearMask::COLOR | orion::ClearMask::DEPTH);
        window->draw(shape);
        window->display();
    }
    
    return EXIT_SUCCESS;
}

Credits

About

Orion is a C++ game development library specializing in streamlined 2D and 3D rendering, designed to simplify the game development process.

Topics

Resources

License

Stars

Watchers

Forks

Contributors