forked from openglsuperbible/sb7code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HOWTOBUILD.txt
106 lines (71 loc) · 3.68 KB
/
HOWTOBUILD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
OGLplus port of OpenGL SuperBible 7th Edition Examples - How to Build
=====================================================================
This source code archive uses CMake to build. The samples have been ported to use OGLplus,
a modern C++ wrapper library for OpenGL. They also use GLFW v3 library, both of which
you must obtain separately. Instructions for each supported platform are as follows:
Windows / Microsoft Visual Studio 2013
--------------------------------------
Install CMake. Windows binaries are available from http://www.cmake.org/.
Ensure that CMake is in your path.
Open a command prompt and change to the directory where you've checked out the code.
### Obtain the latest Khhronos header files
If they weren't supplied with the SDK for your GPU, the following should be
available from khronos.org:
* glcorearb.h
* glext.h
* wglext.h
### Build GLFW
Download/build/install glfw3.
Copy and rename the resulting glfw3 libraries:
* Copy `glfw-3.0.4/src/Debug/glfw3.lib` into the `lib` directory and **rename it to glfw3_d.lib**.
* Copy `glf3-3.0.4/src/Release/glfw3.lib` into the `lib` directory but don't rename it.
Note that OGLplus has support for other frameworks.
See <oglplus>/example/oglplus/*_main.cpp for alternatives.
### Download OGLplus
See http://oglplus.org for the latest version (note: OGLplu2 has a different &
incompatible API). While you may build it, it can also be used as a header-only
library.
### Build the samples
Open a command prompt and change to the build directory in the source archive.
Type:
cmake -G "Visual Studio 12" .. -DCMAKE_PREFIX_PATH=<path-to-oglplus>
Open the resulting superbible7.sln project in Visual Studio.
The examples will build into the `bin` directory.
Linux
-----
As with Windows, the project uses CMake to create build files. You'll
need to install it with the appropriate method for your distribution. On
Debian-based distributions (such as Ubuntu and Mint):
sudo apt-get install cmake
You'll also need to satisfy dependencies. In particular, you'll need GL and
GLX headers and libs (generally included in Mesa packages), and GLFW.
Note that OGLplus has support for other frameworks.
See <oglplus>/example/oglplus/*_main.cpp for alternatives.
Download OGLplus from http://oglplus.org (note: OGLplu2 has a different &
incompatible API). While you may build it, it can also be used as a header-only
library.
Once you have everything, you should enter the "build" directory in the source
arvhive and issue:
cmake <path-to-sb7> -DCMAKE_PREFIX_PATH=<path-to-oglplus>
make
The examples will build into the 'bin' directory.
For degging, append -DCMAKE_BUILD_TYPE=Debug to cmake and use the executables
with the _d suffix.
Other platforms
---------------
The code will probably build for other platforms, especially if they are
relatively non-obscure, but nothing besides Windows/Visual Studio and Linux
has been tested. It's up to you to find a capable OpenGL 4.x driver for
your platform of choice. CMake should also be able to build the appropriate
project files for environments such as Code::Blocks and Eclipse, but again,
this is untested.
*Please note carefully: EVEN IF YOU CAN BUILD THE SOURCES FOR YOUR FAVORITE
PLATFORM OF CHOICE, YOU NEED RECENT OpenGL 4.x DRIVERS TO RUN THEM. PLEASE
DON'T PAN THE BOOK BECAUSE YOUR COMPUTER DOESN'T SUPPORT OpenGL 4.x. THANKS*
Running the samples
-------------------
*This part is really important. Please read it!*
Most of the samples require some media files. The media files package is a
separate download available from http://www.openglsuperbible.com and is
rougly 100MB of textures, object files and shader code. Unpack the archive
to the bin/media directory before trying to run these samples.