prepare release 0.1
[miniglut] / README.md
1 MiniGLUT
2 ========
3 MiniGLUT is a subset of GLUT (or more precisely a subset of FreeGLUT)
4 implemented in a single C source file, without any non-essential dependencies,
5 not even the C library.
6
7 You can use MiniGLUT by simply dropping two files: `miniglut.h` and `miniglut.c`
8 into your project source tree, or by building MiniGLUT as a static library and
9 linking with it.
10
11 MiniGLUT does not intend to replace a full GLUT library, like FreeGLUT, for
12 hacking small to medium OpenGL programs. The purpose of MiniGLUT is to
13 potentially replace a full GLUT library when it's time for release, in order to
14 minimize runtime dependencies of the resulting binary.
15
16 A second reason to use MiniGLUT is to ease porting of UNIX OpenGL programs to
17 Windows, especially when using the microsoft compiler, where setting up and
18 linking with a proper 3rd-party library is an ordeal in itself.  Even more so if
19 you decide to statically link, at which point you need to deal with the whole
20 "MSVC runtime" chaos. Even if you decide to link MiniGLUT as a static library,
21 instead of dropping it in your code, it still won't present any MSVC runtime
22 compatibility issues, since it doesn't call any C library functions whatsoever.
23
24 Download
25 --------
26 Latest release (v0.1):
27   - https://github.com/jtsiomb/miniglut/releases/download/v0.1/miniglut-0.1.tar.gz
28   - https://github.com/jtsiomb/miniglut/releases/download/v0.1/miniglut-0.1.zip
29
30 Both archives are identical, choose whichever is more convenient.
31
32 Source repository (git):
33   - https://github.com/jtsiomb/miniglut
34
35 Build
36 -----
37 Under X11 MiniGLUT depends only on Xlib and OpenGL. Therefore to build a program
38 using MiniGLUT you'll need to link with `-lX11 -lGL`.
39
40 Under Windows MiniGLUT depends only on OpenGL, GDI and winmm. Therefore to build
41 a program using MiniGLUT you'll need to link with `-lopengl32 -lgdi32 -lwinmm`.
42 When building with MSVC, linking with the correct libraries is taken care by
43 pragmas in the header file. If you wish to avoid the winmm dependency, define
44 `MINIGLUT_NO_WINMM`.
45
46 To avoid calling C library functions, MiniGLUT uses inline assembly code for
47 system calls and trigonometric operations. This makes the default build
48 incompatible with non-x86 systems, and with MSVC x64 builds. If you don't mind
49 linking with the C library, you can define `MINIGLUT_USE_LIBC` to lift these
50 limitations.
51
52 License
53 -------
54 Copyright (C) 2020 John Tsiombikas <nuclear@member.fsf.org>
55
56 MiniGLUT is free software. Feel free to use, modify and/or redistribute it,
57 under the terms of the GNU General Public License v3, or at your option any
58 newer version published by the Free Software Foundation. See COPYING for
59 details.
60
61 The intention is not to dictate a specific free software license (GPL) but to
62 shut the door to proprietary programs. If you want to use MiniGLUT in a free
63 software project with an incompatible license, contact me and we will figure out
64 a way to enable that.
65
66 To learn more about GPL-incompatible free software licenses where this might
67 be an issue, see:
68 https://www.gnu.org/licenses/license-list.en.html#GPLIncompatibleLicenses
69
70 Known Issues
71 ------------
72 MiniGLUT being a subset of GLUT, is missing a number of features. Some of them
73 on purpose to keep it minimal, and some of them because I didn't happen to use
74 them in a program I wanted to link with MiniGLUT yet.
75
76 Missing GLUT features:
77  - The only supported systems are: UNIX with X11 (GLX), and Windows (WGL).
78  - Multiple windows.
79  - Subwindows.
80  - Overlays.
81  - Game mode (video mode switching).
82  - Menus.
83  - Font rendering.
84  - Some of the primitives.
85  - Buttons and Dials callbacks.
86  - Tablet callbacks.
87  - Spaceball callbacks are only implemented on UNIX/X11.
88  - Timer callback.
89
90 Missing FreeGLUT features:
91  - Mobile callbacks.
92  - Context version and profile selection and other context flags.
93  - Window close actions.
94  - Multi-touch/multi-pointer callbacks.
95  - User-pointer callbacks.
96  - Joystick callbacks.
97  - More missing primitives.
98
99 If wish to let me know how much you need one of the missing features, or even
100 better if you are volunteering to implement it yourself, send me an email at:
101 nuclear@member.fsf.org
102
103 Only plain-text emails, hard-wrapped at 72 columns will be accepted.