Skip to content

Commit 3864d34

Browse files
authored
Update README.md
1 parent d4bfb46 commit 3864d34

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
> This series of demos accompanies the e-book "Anton's OpenGL 4 Tutorials":
55
> [antongerdelan.net/opengl](http://antongerdelan.net/opengl/)
66
7+
## Table of Contents
8+
1. [Info](#info)
9+
2. [Compiling on Linux](#compiling-on-linux)
10+
2. [Compiling on macOS](#compiling-on-macos)
11+
3. [Compiling on Windows with Visual Studio](#compiling-on-windows-with-visual-studio)
12+
4. [Compiling on Windows with GCC](#compiling-on-windows-with-gcc)
13+
5. [Contribution and Contributors](contribution-and-contributors)
14+
6. [Licence](licence)
15+
716
## Info
817

918
Each chapter with major demonstration code has a corresponding demo here.
@@ -16,9 +25,7 @@ This code is some years old now and builds may fall out of date.
1625
I try to maintain this so that it functions, but be aware that Makefiles and
1726
build details may differ slightly from book text for this reason.
1827

19-
## Compiling Demos
20-
21-
### Linux
28+
## Compiling on Linux
2229

2330
* Install a C and C++ compiler - usually by installing a `build-essential`
2431
bundle package via the package manager on your distribution. E.g. for Ubuntu:
@@ -41,8 +48,7 @@ make -f Makefile.linux64
4148

4249
* Or, to build all the demos at once, you can run `./build_all_linux_macos.sh` from the main directory.
4350

44-
45-
### Apple macOS
51+
## Compiling on macOS
4652

4753
* Install the Clang or GNU compiler and tools. Usually this is done by installing Apple [XCode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) through the App Store.
4854

@@ -60,11 +66,20 @@ make -f Makefile.osx
6066

6167
* Or, to build all the demos at once, you can run `./build_all_linux_macos.sh` from the main directory.
6268

63-
### Windows with Visual Studio
69+
## Compiling on Windows with Visual Studio
6470

65-
Install Microsoft Visual Studio. Any edition is fine.
71+
Install Microsoft Visual Studio. Any edition is fine. There are several alternatives to compile with Visual Studio:
6672

67-
#### With `build.bat` and `build_all_msvc.bat`
73+
* Using the included batch files.
74+
* Installing libraries with NuGet within Visual Studio.
75+
* Installing libraries manually within Visual Studio.
76+
77+
> [!NOTE]\
78+
> Compiling using a batch file is an easy option for working with Visual Studio's compiler.
79+
> It's also an easier way to build all the demos in one go, if you just want to try them all first.
80+
> The only catch is editing the batch file to get the correct path to your compiler tools.
81+
82+
### Batch Files
6883

6984
For your convenience a `build.bat` file is included in each demo. These will use Visual Studio's command-line tools to
7085
compile the demo:
@@ -76,28 +91,27 @@ compile the demo:
7691
If you want to build all the demos in one go, there is a file called `build_all_msvc.bat`.
7792
You will also need to check the Visual Studio tool path at the top of this file.
7893

79-
#### Within Visual Studio
94+
### Within Visual Studio
8095

8196
Create a new _Empty_, _C++_, _Console_ project.
8297
You can then easily install the required libraries with _NuGet_, under the _Project_ menu of a new C++ project, and you're ready to draw a triangle in 5 minutes.
8398

84-
#### Install Libraries with NuGet
99+
##### Install Libraries with NuGet
85100

86101
1. In the _Browse_ tab search for and install; `glfw`, and `glew`. For later tutorials you can also find `assimp`, and `freetype`, when required.
87102
2. You need to add the text `opengl32.lib` to your linker input string. You can find this in _Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies_. Just add `opengl32.lib;` to the front of the long string of dependencies so that it changes to `opengl32.lib;kernel32.lib;user32;...`.
88103
3. You do not need to add the libraries you installed _via_ NuGet to the linker string.
89104
4. You can now compile a _Hello Triangle_ demo for OpenGL using GLFW and GLEW.
90105

91-
#### Install Libraries Manually
106+
##### Install Libraries Manually
92107

93108
If you would rather do things the old fashioned way, without using a package manager, I have recorded a 2020 video stream tutorial where I show how to get Visual Studio set up and start programming OpenGL, including downloading and setting up libraries.
94109

95110
[Tutorial: Intro to 3D Graphics Programming with OpenGL 4 (with Anton). Stream Recording.](https://youtu.be/qQJ7irgxZFQ)
96111

97112
This includes a very verbose set-up of Visual Studio 2019 with helper libraries.
98113

99-
100-
### Windows with GCC
114+
## Compiling on Windows with GCC
101115

102116
* Install the GNU Compiler Collection - usually by installing MinGW. I suggest the minimal MinGW GCC distribution at [https://nuwen.net/mingw.html](https://nuwen.net/mingw.html).
103117
* Open a console and `cd` to the demo of choice.

0 commit comments

Comments
 (0)