Custom API Documentation
Welcome to the UniApt Custom API Documentation. This comprehensive guide is designed to help developers leverage the full potential of UniApt’s APIs in their projects. Whether you are building a game, tool, or utility, this documentation will provide you with the necessary information to effectively use the UniApt platform.
Overview
The UniApt Custom API is a robust interface that allows developers to interact with the core functionalities of the UniApt engine, including asset management, rendering, physics, AI, and more. This API is designed to be intuitive, flexible, and powerful, offering a wide range of functionalities necessary for modern game development.
Getting Started
Requirements
UniApt Engine (version 1.5.2 or later)
C++17 compatible compiler
Basic understanding of the UniApt Engine architecture
Initialization
Before using any of the API functionalities, initialize the UniApt environment:
#include <uniapt.h>
int main() {
uniapt::initialize();
// Your code here
uniapt::terminate();
return 0;
}
Modules
Asset Management
uniapt::assets
Load Asset
uniapt::assets::AssetHandle asset = uniapt::assets::load("path/to/asset");
Unload Asset
uniapt::assets::unload(asset);
Rendering Engine
uniapt::graphics
Create Renderer
uniapt::graphics::Renderer renderer = uniapt::graphics::createRenderer(window);
Render Frame
renderer.renderFrame(scene);
Physics System
uniapt::physics
Create Physics World
uniapt::physics::World physicsWorld = uniapt::physics::createWorld(worldConfig);
Add Object to World
physicsWorld.addObject(physicsObject);
Artificial Intelligence
uniapt::ai
Create Behavior Tree
uniapt::ai::BehaviorTree tree = uniapt::ai::createBehaviorTree("path/to/tree.json");
Run AI Tick
uniapt::ai::runTick(tree, deltaTime);
Advanced Features
Networking
uniapt::networking
Establish Connection
uniapt::networking::Connection connection = uniapt::networking::connect("server.address.com", portNumber);
Send Data
uniapt::networking::send(connection, data, dataSize);
Audio Processing
uniapt::audio
Play Sound
uniapt::audio::Sound sound = uniapt::audio::loadSound("path/to/sound"); uniapt::audio::play(sound);
Adjust Volume
uniapt::audio::setVolume(sound, 0.75f);
API Reference
Scene Management
uniapt::scene
Create Scene
uniapt::scene::SceneHandle scene = uniapt::scene::create();
Add Entity to Scene
uniapt::scene::addEntity(scene, entity);
Scene Iteration
uniapt::scene::forEachEntity(scene, [](uniapt::Entity entity) { // Entity processing logic });
User Interface API
uniapt::ui
Create UI Element
uniapt::ui::Element uiElement = uniapt::ui::createButton("Click Me"); uniapt::ui::setPosition(uiElement, {x: 100, y: 200});
UI Event Handling
uniapt::ui::onEvent(uiElement, uniapt::ui::EventType::Click, [](uniapt::ui::Event e) { // Handle click event });
Custom Shader API
uniapt::graphics::shader
Compile Shader
uniapt::graphics::Shader shader = uniapt::graphics::shader::compile("vertexShader.vs", "fragmentShader.fs");
Apply Shader
uniapt::graphics::applyShader(mesh, shader);
Advanced Topics
Plugin Development
UniApt supports custom plugin development to extend engine functionalities.
Plugin Creation:
uniapt::Plugin myPlugin = uniapt::Plugin::create("MyPlugin"); myPlugin.onLoad = []() { // Plugin initialization logic }; uniapt::Plugin::registerPlugin(myPlugin);
Multiplayer and Networking
UniApt offers a comprehensive suite for building multiplayer games and networked applications.
Setting up a Server:
uniapt::networking::Server server = uniapt::networking::createServer(8080); server.onClientConnected = [](uniapt::networking::Client client) { // Handle new client connection };
Virtual Reality (VR) Integration
UniApt provides APIs for integrating VR functionalities into your projects.
Initializing VR System:
uniapt::vr::initialize(); if (uniapt::vr::isHMDPresent()) { uniapt::vr::startSession(); }
If additional or complete information is required to connect to the UniApt server
please contact: [email protected]
Last updated
Was this helpful?