Git Product home page Git Product logo

vertex's Introduction

Vertex Framework

Vertex is a C++ game development framework that provides essential building blocks for developing games. Vertex comes with many helpful tools:

  • Math library including essential functions and structures for 2D and 3D development such as vectors, quaternions, and matrices.
  • (coming soon) Image library for image io and manipulation operations.
  • (coming soon) Logging and profiling tools to help streamline the development process.
  • (coming soon) Windowing tools for cross platform window generation and input handling with GLSL backend.
  • (coming soon) Cross platform graphics api with support for both Vulkan and OpenGL backend.

Getting Started

Prerequisites

Before you start, make sure you have CMake installed on your system. You can download it from CMake's official website.

Clone the Repository

Clone the Vertex repository to your local machine:

git clone https://github.com/milkmull/Vertex.git
cd Vertex

Configure and Generate the Project Files

Run CMake to configure and build the project:

cmake -B ./build ./
cmake --build ./build

The build will produce a static library in the lib folder.

CMake Parameters

You can customize the build process using the following CMake parameters:

  • CMAKE_BUILD_TYPE (Default: Debug)

    • Set to Release to build release library.
  • VX_BUILD_EXAMPLES (Default: OFF)

    • Set to ON to include building examples.
  • VX_BUILD_TESTS (Default: OFF)

    • Set to ON to include building tests.
  • VX_BUILD_SANDBOX (Default: ON)

    • Set to OFF to exclude building Sandbox.

Sandbox

Vertex comes with the option to build an internal project called sandbox:

https://github.com/milkmull/Vertex/tree/main/sandbox

Sandbox is an easy way to get started playing around with features without having to build your own project. Sandbox will be compiled along with Vertex and is configured to include and link against Vertex automatically. An executable will be generated for sandbox in the bin directory.

Installation

coming soon

Vertex Math

The math library in Vertex provides a set of functions and structures for handling mathematical operations in game development. It includes features such as vector operations, matrix transformations, and more.

Usage

Here are some basic examples demonstrating the usage of the Vertex math library:

#include <vertex/math/math.h>
#include <iostream>

int main()
{
    // Create vectors
    vx::vec2 v2(1.0f, 2.0f);
    vx::vec3 v3(1.0f, 2.0f, 3.0f);
    vx::vec4 v4(1.0f, 2.0f, 3.0f, 4.0f);

    // Print vector
    std::cout << v2.to_string() << std::endl;

    // Normalize vector
    v2 = vx::math::normalize(v2);

    // See if the magnitude is 1
    if (vx::math::is_equal_approx(v2.magnitude(), 1.0f))
    {
        std::cout << "vector " << v2.to_string() << " is normalized." << std::endl;
    }

    // Check for approximate equality
    vx::vec3 v32 = v3 + 0.000001f;
    if (vx::math::is_equal_approx(v3, v32))
    {
        std::cout << v3.to_string() << " and " << v32.to_string() << " are approximately equal." << std::endl;
    }

    // Math operations
    v4 += 5.0f;
    v4 -= 20.0f;
    v4 *= 0.5f;
    v4 /= 1.2f;

    vx::vec4 v42(v2, v2);

    v4 += v42;
    v4 -= v42;
    v4 *= v42;
    v4 /= v42;
}

vertex's People

Contributors

milkmull avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.