Skip to content

Simple OpenGL 1 x

Finalspace edited this page May 29, 2026 · 1 revision

Table of Contents

main.cpp

#define FPL_IMPLEMENTATION
#include "final_platform_layer.h"

// You have to include GL.h yourself or use any other OpenGL loader you want.
// FPL just creates an OpenGL rendering context for you, but nothing more.
#include <GL\GL.h>

int main(int argc, char **argv) {
    int result = 0;
    if ((, )) {
        glClearColor(0.39f, 0.58f, 0.93f, 1.0f);
        while (()) {
             ev;
            while ((&ev)) {}

             windowArea = ();
            glViewport(0, 0, windowArea., windowArea.);
            glClear(GL_COLOR_BUFFER_BIT);
            glBegin(GL_TRIANGLES);
            glVertex2f(0.0f, 0.5f);
            glVertex2f(-0.5f, -0.5f);
            glVertex2f(0.5f, -0.5f);
            glEnd();
            ();
        }
        ();
        result = 0;
    } else {
        result = -1;
    }
    return(result);
}

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally