Skip to content

vitrevance/OSE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSE

OpenGL 4D rendering engine.

Description

This engine is designed for rendering objects in 4-dimensional space. It allows loading 3D models of various formats, which will be automatically converted to 4D. Interaction with objects is based on an event system.

Examples

Rendering two hypercubes

Hypercubes

Build

CMake targets:

  • OSE - Engine dynamic library
  • SandboxBundle - sandbox executable for testing

Build options

  • OSE_DISABLE_LOGGING - disable logging (default ON)
  • S_APP_NAME=App - define app name (default "APP")

Setup

Using Sandbox project

  • Clone this repository
  • Put your code into ./Sandbox/src
  • Build target SandboxBundle

Custom setup

OSE is designed as dynamic library

  • Build library
  • Include OSE.h
  • Inherit from Engine
class ExamapleGame : public OSE::Engine {
    // Use constructor for initialization
    ExamapleGame() {
        //create player and so on
    }
};
  • Define CreateApplication callback
OSE::Engine* OSE::CreateApplication() {
	return new ExamapleGame();
}
  • Do not define/declare entry point ("main" function), it is already defined in OSE.h
  • See Sandbox.cpp for more examples
  • Use bundle(target relative_path_to_assets) CMake function to add custom target for building final application

Essential docs

Events

OSE::EventListener - template class, inherite from it to subsribe for events

class Player : public OSE::EventListener<OSE::KeyPressedEvent> {
    void onEvent(OSE::KeyPressedEvent& ev) override {
        OSE_LOG(LOG_APP_TRACE, ev.getKeyCode());
    }
}

OSE::TickEvent - event type for tick events: fired each update ~ each frame.

OSE::RenderEvent - event called each frame to render entites. Perform all rendering on receive.

void onRender(OSE::Renderer* renderer) override {
    renderer->drawStaticMesh(OSE::AssetSystem::instance->getStaticMesh("cube") , &this->getTransform());
}

OSE::Actor - base class of in-game entities. If something is intended as a dynamic entity it should inherit from this class. OSE::Actor will receive Tick Events by default.

OSE::AssetSystem - class for loading assets from files, is a singleton instance. Never throws! Returns nullptr if failed.

OSE::AssetSystem::instance->setAssetDir("assets/");
if (!OSE::AssetSystem::instance->loadStaticMesh("cube", "cube.obj")) {
    OSE_LOG(LOG_APP_WARNING, "Failed to load asset");
}

About

Oversimplified engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published