Skip to content

Triangle

Index · Français

Description

Three vertex indices and a color. Use with Shapes3D and Rasterizer3D.

gaspardos::graphics::Triangle — bindings/cpp/raster3d.hpp, C++98.

Simple program example

#include "raster3d.hpp"
using namespace gaspardos::graphics;

int main()
{
    Triangle value(0, 1, 2, 0x00ffffff);
    return value.a == 0 ? 0 : 1;
}

Building from Windows

From the repository root, save the program as build/api-examples/Triangle.cpp.

New-Item -ItemType Directory -Force build/api-examples | Out-Null
& .\build-x64-install\bin\x86_64-gaspardos-g++.exe -std=c++98 -O2 -Ibindings/cpp build/api-examples/Triangle.cpp bindings/cpp/raster3d.cpp -o build/api-examples/Triangle.elf
if ($LASTEXITCODE -ne 0) { throw "C++ build failed" }

Executable for GaspardOS. Presentation requires WINDOW_BLIT=146 in the kernel; -38 means the extension is absent. Source files.

Methods and public data

Triangle(unsigned a, unsigned b, unsigned c, uint32_t color)

Initialize zero-based indices and color.

Public fields

a, b, c : unsigned; color : uint32_t (0x00BBGGRR)