graphics-snippets

StackOverflow


Immediate mode and legacy OpenGL

Primitive

Point

point size and smooth point

Line

wireframe cube
wireframe cube

Triangle

triangle strip to octagonal
triangle strip to octagonal

Shapes

platonic solids
platonic solids

Light

light, solid cube

Raster and bitmap

Raster bitmap

Texture

texture PLI, solid cube
texture - glDrawPixels

Text

freetype - hello world
freetype - hello world

Buffer

update buffer

Shader

legacy shader minimal example

Wavefront (obj)

glfw wavefront viewer
glfw wavefront viewer

Glu

Glu Shapes

glu sphere - PLI texture
glu sphere - PLI texture

Glut

glut minimal example

Glut Shapes

glut solid cylinder
glut solid cylinder

glut solid cylinder between 2 points
glut solid cylinder between 2 points

glut wire teapot
glut solid teapot

Text

glut bitmap character - window position

glut bitmap character - raster position

glut stroke character

Event loop

glut event loop - close window

Glfw

glut minimal example - CamelCase

glut minimal example - snake case

PyGame

pygame minimal example