Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check out my profile on reddit Check me out on Facebook

Mitch Richling: FLTK Example Programs

Author: Mitch Richling
Updated: 2023-11-15

Table of Contents

1. Introduction

Here you will find just a few simple FLTK programs intended to get the FLTK beginner off the ground with the first couple of programs. The hardest part about FLTK is getting the first program to build! The library itself is one of the simplest toolkits available today – a working GUI in just a few lines of code. FLTK has a very nice GLUT layer to give GLUT programmers a bit more functionality than they have with GLUT and base OpenGL. A layout manager is coming in FLTK 2.0.

Get it all on github: https://github.com/richmit/ex-FLTK/

2. The basics & Types

minimalFLTK.cpp
A minimal FLTK example (just a few lines of code). FLTK has very low setup overhead.
SimpleButton.cpp
Simple button example using pure procedural code.
SimpleButtonOO.cpp
Simple button example the "OO way".
mainWinCallback.cpp
How to use the main window callback to cleanup before application exit.

3. GLUT & OpenGL

glutWithFltk.cpp
Simple GLUT program turned into an FLTK program.
glutWithFltkInput.cpp
The power of GLUT with the ease of FLTK user input management.

4. Fluid

simpleFluid.fl
Simple fluid example (The makefile will generate the source, simpleFluid.cpp, simpleFluid.h, and compile)