ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: GAMES/SHADER/LAB.CC

Source reference: GAMES/SHADER/LAB.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path GAMES/SHADER/LAB.CC
Lines 26
Bytes 705
SHA-256 2eda7e10d4d7fe90f654b53de45425b46d3c7a5b8409eddb79704dbbca4a87c7
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

int main() {
    int vs;
    int fs;
    int program;
    int loc;
    vs = shader_make(shader_vert(), "void main() { gl_Position = vec4(0.0, 0.0, 0.0, 1.0); }");
    fs = shader_make(shader_frag(), "out vec4 color; void main() { color = vec4(1.0, 0.0, 0.0, 1.0); }");
    if (shader_ok(vs) == 0 || shader_ok(fs) == 0) {
        return 0;
    }
    program = prog_make();
    prog_attach(program, vs);
    prog_attach(program, fs);
    if (prog_link(program) != 0 || prog_ok(program) == 0) {
        return 0;
    }
    loc = prog_uniloc(program, "time");
    if (loc >= 0) {
        prog_setf(program, loc, 0, 0.0);
    }
    shader_drop(vs);
    shader_drop(fs);
    prog_drop(program);
    return 1;
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-2eda7e10d4d7fe90 Reviewed source: da3df29cb397 Class: generated-source-reference