Giter Site home page Giter Site logo

paroj / gltut Goto Github PK

View Code? Open in Web Editor NEW
1.5K 1.5K 358.0 30.11 MB

Learning Modern 3D Graphics Programming

Home Page: https://paroj.github.io/gltut/

License: MIT License

Lua 20.48% XSLT 0.01% TeX 0.01% CSS 0.02% C++ 45.50% GLSL 0.81% C 22.25% CMake 0.08% Makefile 2.23% Shell 1.78% M4 0.02% Roff 5.87% HTML 0.94% POV-Ray SDL 0.02%
opengl tutorial

gltut's People

Contributors

dvir avatar gerardrodes avatar hazkaz avatar jicksaw avatar jim19930609 avatar konstapoulos avatar kveretennicov avatar ljrk0 avatar mickbeaver avatar mwrshl avatar nadirrogue avatar nellodotca avatar omertuc avatar paroj avatar pidge avatar ratchette avatar sand3r- avatar sergv avatar simply-silver avatar tonymagro avatar trevorfancher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gltut's Issues

Debug the tutorial's vertex/fragment shaders

Originally reported by: Anonymous


I would love to see an appendix with a walkthrough on how to debug one of the tutorial's vertex/fragment shaders using a tool such as glslDevil or gDEBugger.

It would be enormously useful to be able to see the exact effect the perspective and model2camera transformations have on the matrices in a debugger and to also visualize fragment shader operations.

I've tried myself without success to debug several different Tutorial executables using both tools, I'm perhaps making a few assumptions that aren't true such as that they fully support the opengl 3.3 core profile and are aware of freeglut etc.

Peter


Tutorial 5 doesn't work in VS2010

Originally reported by: Anonymous


Building tutorial 5 in VS2010 yields executables that simply produce white screens. If you resize the window the area outside the original window extent is black.

Instrumenting the display function in BaseVertexOverlap.cpp:

void display()
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);

glUseProgram(theProgram);
std::cout << "glUseProgram\n";
glBindVertexArray(vao);
std::cout << "glBindVertexArray\n";
glUniform3f(offsetUniform, 0.0f, 0.0f, 0.0f);
glDrawElements(GL_TRIANGLES, ARRAY_COUNT(indexData), GL_UNSIGNED_SHORT, 0);
std::cout << "glDrawElements\n";
glUniform3f(offsetUniform, 0.0f, 0.0f, -1.0f);
glDrawElementsBaseVertex(GL_TRIANGLES, ARRAY_COUNT(indexData),
    GL_UNSIGNED_SHORT, 0, numberOfVertices / 2);
std::cout << "glDrawElementsBaseVertex\n";
glBindVertexArray(0);
glUseProgram(0);
std::cout << "glUnUseProgram\n";
glutSwapBuffers();
std::cout << "glutSwapBuffers\n";

}

Yields the following output on the console:

glUseProgram
glBindVertexArray
glDrawElements
glUseProgram
glBindVertexArray
glDrawElements


Error report with Code::Blocks and MinGW

Originally reported by: Fejwin (Bitbucket: Fejwin, GitHub: Fejwin)


I downloaded the latest release and started building the required programs.

//FreeGlut 2.6.0//

Unfortunately the ./configure and make approach did not work for FreeGlut 2.6.0 with my MinGW. Instead I downloaded the official GLSDK. That GLSDK includes FreeGlut 2.6.0 and offers a premake4 file for it. That way I created a Code::Blocks project and compiled it. The output was two libs: libfreeglut.a and libfreeglutD.a. These I put into the \Tutorial 0.3.6\freeglut-2.6.0\lib directory.

//GLImg//

Here a premake4 file was present. Code::Blocks compiled libglimg.a and libglimgD.a into the \Tutorial 0.3.6\glimg\lib directory for me.

//GLLoad//

Here again premake 4 and Code::Blocks gave me the libglload.a and libglloadD.a files in the \Tutorial 0.3.6\glload\lib directory.

//TinyXML//

Finally, premake4 and Code::Blocks gave me libtinyxml_pm.a and libtinyxml_pmD.a in \Tutorial 0.3.6\tinyxml\lib.

After that I headed over to the \Tutorial 0.3.6\Tut 01 Hello Triangle folder, used premake4 and started the Code::Blocks workspace. When I try to compile that workspace (or any of the two projects framework and tutorial 1) I get these errors:

..\freeglut-2.6.0\include\GL\freeglut_std.h|60|warning: "NOMINMAX" redefined|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0\include\c++\mingw32\bits\os_defines.h|46|note: this is the location of the previous definition|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|225|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|226|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|227|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|228|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|229|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|230|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|231|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|232|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|233|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|234|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|235|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|236|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|237|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|238|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|239|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|240|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|241|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|242|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|243|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|244|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|245|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|246|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|247|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|248|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|249|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|250|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|251|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|252|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|253|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|254|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|255|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|256|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|257|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|258|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|259|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|260|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|261|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|262|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|263|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|264|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|265|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|266|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|267|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|268|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|269|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|270|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|271|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|272|error: 'GLAPI' does not name a type|
c:\mingw\bin..\lib\gcc\mingw32\4.5.0........\include\GL\glu.h|273|error: 'GLAPI' does not name a type|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 1 warnings ===|


Suggest OpenGL 3.2 as a basis

Originally reported by: Shawn Walker (Bitbucket: binarycrusader, GitHub: binarycrusader)


Instead of basing this work on OpenGL 3.3, I'd like to suggest you base it on OpenGL 3.2.

While I realize that many platforms have OpenGL 3.3 available, OpenGL 3.2 is currently the max supported on OS X (and it has an excellent implementation of it).

The gltut materials are excellent, and generally work on OpenGL 3.2 with very little modification. (Mainly just removing use of the layout keyword, and using a different shader version.)

I don't see a particularly compelling reason to limit yourself to OpenGL 3.3 support, when OpenGL 3.2 allows you to fulfill all of the goals of writing about a modern graphics rendering pipeline.

Alternatively, a short section providing a summary of differences between OpenGL 3.2 and 3.3 would suffice for users following along.


FreeGlut Problem

Originally reported by: Anonymous


Hello, I'm posting here since I did not see any other method of contact. I am getting an error when I try to run any of the tutorials. The console says:

"freeglut (./Test): glXCreateContextAttribsARB not found"

when I run the executables. This is probably very simple, but I need the help.

Thanks!


tutorial 12 error when compile with tinyxml

Originally reported by: Anonymous


Thx for this fantastic tutorial.

I got an issue when compile tutorial 12 and so on with tinyxml included.

And I noticed we must switch on the STL support in the tinyxml.h.

Your included version seems did this, however it cost me lots of time to figure it out when I compile with recent tinyxml.

I need to add

define TIXML_USE_STL

to the first line of the tinyxml.h to make it compile.


Error Building freeglut - 'GL/gl.h' not found

Originally reported by: Alex Coplan (Bitbucket: acoplan, GitHub: acoplan)


Inside the project root I ran premake4 gmake followed by make config=debug, and got this error:

==== Building framework (debug) ====
framework.cpp
In file included from framework.cpp:17:
In file included from ../glsdk/freeglut/include/GL/freeglut.h:17:
../glsdk/freeglut/include/GL/freeglut_std.h:120:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
         ^
1 error generated.
make[1]: *** [lib/Debug/framework.o] Error 1
make: *** [framework] Error 2

So I decided to try and build the glsdk:

cd glsdk
premake4 gmake
make config=debug

And I got this:

freeglut_callbacks.c
In file included from src/freeglut_callbacks.c:28:
In file included from include/GL/freeglut.h:17:
include/GL/freeglut_std.h:120:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
         ^
1 error generated.
make: *** [obj/Debug/freeglut_callbacks.o] Error 1

Why can't it find that file?

I'm running OS X 10.7.4.


make problems in Scene.cpp

Originally reported by: Russell Lundberg (Bitbucket: rlundberg, GitHub: Unknown)


Hi Jason,

Thanks for the tremendous effort you've put into these tutorials.

I'm having trouble building the package. I've tried with both the 0.3.8 and 0.3.7 packages.

I'm using Windows 7 Ultimate 64-bit, Build environment is Cygwin/MinGW g++, presently from the command line, not using an IDE.

Before I copy the lengthy errors into this post let me ask a procedural question.

Is this the step-by-step procedure to build a package?

  1. in the glsdk directory, run "premake4 gmake" (this works on my system)
  2. run make (this is not successful on my system.)
  3. change to "Tut 01..." directory.
  4. run "premake4 gmake" (this works on my system)
  5. run "make" (this is not successful on my system.)

If these are the proper steps to follow then there is a problem that needs to be resolved.

Many thanks again for the wonderful tutorials.

Russell


Tutorials segfault

Originally reported by: wesdec (Bitbucket: wesdec, GitHub: Unknown)


All tutorials segfault on my system (Ubuntu 10.04). Below is the gdb output.

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) where
#0  0x00000000 in ?? ()
#1  0x08051a13 in init () at tut1.cpp:133
#2  0x08052f11 in main (argc=1, argv=0xbffff3f4) at framework.cpp:158

Line 133 of tut1.cpp is this:

glGenVertexArrays(1, &vao);

Furthermore the output of glload::LoadFunctions(); in main() is 0.

Please let me know if I can assist in anyway.


Spaces in Path and Debugging

Originally reported by: Anonymous


Due to off again, on again, problems with gdb and gcc handling paths with spaces in windows(7.1 and 7.4 gdb http://sourceware.org/bugzilla/show_bug.cgi?id=12843 among others can't use a breakpoint in a file that has spaces in it or in the path), certain versions of gcc have trouble also, I took out the spaces(replacing them with underscores) in the directory names, the tutorial.lua, and the cpp files. This allows debugging and stepping through the tutorials without issues in any modern gdb.


Link error with premake gmake

Originally reported by: ekari (Bitbucket: ekari, GitHub: ekari)


Using 64-bit Arch Linux, the following happened in Tut 01, Tut 02, and Tut 03:

premake gmake
make
(compiling...)
Linking Tut 01 Main
/usr/bin/ld: ../glsdk/freeglut/lib/libfreeglutD.a(freeglut_main.o): undefined reference to symbol 'XPending'
/usr/bin/ld: note: 'XPending' is defined in DSO /usr/lib/libX11.so.6 so try adding it to the linker command line
/usr/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [Tut 01 MainD] Error 1
make: *** [Tut 01 Main] Error 2

Then with the premake generated "Tut 01 Main.make", I changed:

LIBS += -lframeworkD -lglloadD -lglimgD -lglutilD -lglmeshD -lfreeglutD -lGL -lGLU

to

LIBS += -lX11 -lframeworkD -lglloadD -lglimgD -lglutilD -lglmeshD -lfreeglutD -lGL -lGLU

and after that everything ran as expected.


link error building tutorials.

Originally reported by: Anonymous


I've used Premake4.3 to generate the project files for
codeblocks10.05(premake4 codeblocks) with the MinGW compiler
and successfully compiled the glsdk_0.4.1 and framework files
but all of the tutorials give me the same error.
ld.exe cannot find -lglloadD.

"Tut 01 MainD.exe" obj\Debug\tut1.o
-lframeworkD -lglloadD -lglimgD -lglutilD -lglmeshD -lfreeglutD
-ltinyxml_pmD -lglu32 -lopengl32 -lgdi32 -lwinmm -luser32
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/
../../../../mingw32/bin/ld.exe: cannot find -lglloadD

I thought it might be something simple because I'm not familiar with
codeblocks as I use devc++(which Premake doesn't generate files for) so
I tried using Visual Studio 2010 Express(premake4 vs2010) only to get
the exact same problem, everything builds except the tutorials.
Here is the error message I get for each tutorial.
LINK : fatal error LNK1104: cannot open file 'glloadD.lib'

Please help me resolve this problem, I wouldn't like to bother anyone
with what might be a simple newbie mistake but Ive been at it for over 13 hours.


Problem building glsdk

Originally reported by: Anonymous


I can't seem to build the glsdk that comes with the tutorials.
Here's what I've done:

  • I use "premake4.exe vs2010" in the glsdk folder
  • I open the resulting "glsdk.sln" in VS 2010
    *I try to build "Debug" (happens with "Release" too)
    *Building fails with the error: "Unalbe to start .../glloadD.lib The specified file is an unrecognized or unsupported binary format"

What am I missing here?


Can't get build to work

Originally reported by: Brandon Harvey (Bitbucket: sandover, GitHub: sandover)


Hi, I'm interested in the "Learning..." book in progress, so I cloned the repo today and installed premake4, lua5, freeglut, and then built tinyxml from within the repo. A few issues stopping progress at this point:

returns

cannot open /home/demo/src/gltut/glsdk/links.lua: No such file or directory

  • I gave get_externals.lua a try, but

lua get_externals.lua

returns

lua: get_externals.lua:20: unexpected symbol near `=='

That's with lua 5. lua 4 returns the following instead:

error: =' expected; last token read:script' at line 2 in file `get_externals.lua'


Problems with frameworkD.lib

Originally reported by: Joseph Ciurej (Bitbucket: churay, GitHub: churay)


Greetings Mr. McKesson,

I've been trying to run through the first of your tutorials to make sure everything was running smoothly following installation. Unfortunately, I've run into a bit of an issue. Whenever I try to run the "Building Triangles" tutorial, I'm met with an error that reads as follows:

"Unable to start program '[file_path]\Tutorial 0.3.8\framework\lib\frameworkD.lib'. The specified file is an unrecognized or unsupported binary format."

I run into similar issues when trying to run the program in the "Test" directory (these are the only two I've tried to run thus far). I used Premake v4 to build the files in both the glsdk directory and the directories where I attempted to run the solution (Tutorial 1 and Test). I most likely made some form of error in setting up the projects, but I can't seem to find it. Do you have any advice? Thanks in advance for your help!


MousePole set default camera matrix, should havn't

Originally reported by: Anonymous


Hi,

When I debug my program I found I cannot get the correct default camera, then I found MousePole set its default one which is conflict with my own camera matrix.

I think this should not happen, the Mouse function should not influence the default camera matrix from user.

#!C++

MousePole::MousePole(const glm::vec3 &target, const RadiusDef &radiusDef, ActionButtons eButton)
        : m_lookAt(target)
        , m_radCurrXZAngle(0.0)
        , m_radCurrYAngle(/*-PI_2 / 2.0f*/0.0f) //modified here, cause confusing
        , m_radCurrSpin(0.0f)
        , m_fRadius(20.0f)
        , m_radius(radiusDef)
        , m_glutActionButton(0)
        , m_bIsDragging(false)

cheers,
Jianming


"glXCreateContextAttribsARB" not found on OS X Lion

Originally reported by: Denis Hovart (Bitbucket: denzen, GitHub: denzen)


I have compiled everything without problem but I have an error that occurs at runtime when trying to launch the first tutorial :

//freeglut (./Tut 01 MainD): glXCreateContextAttribsARB not found//

I compiled everything using the following flags :

LDFLAGS="-L/usr/X11R6/lib -lX11 -lGLU -lGL -framework OpenGL -framework GLUT"
CPPFLAGS="-I/usr/X11R6/include"
CC="clang -emit-llvm"

I’m running Mac OS 10.7.3


Overlap and Depth Buffering Explanation

Originally reported by: Anonymous


Given the following quote from the online opengl documentation for glDepthFunc:

"GL_LESS - Passes if the incoming depth value is less than the stored depth value."

Along with the following quotes from the Overlap and Depth Buffering tutorial page:

"When the test is true, the incoming fragment is written."

I don't believe the following sentence is correct (but would very much like to understand if I'm wrong):

"So GL_LESS means that, when the incoming fragment's depth is less than the depth from the depth buffer, the incoming fragment is not written."

Shouldn't it be?:

"So GL_LESS means that, when the incoming fragment's depth is less than the depth from the depth buffer, the incoming fragment is written."

.

As a beginner this is my understanding of the described depth comparison process:

Writing 1st wedge object

offsetUniform.z is 0.0f so window-space Z value is 0.0f

No previous depth value stored so glDepthRange Max used

(winZ GL_LESS DepthRangeMax) comparison is actually (0.0f < 1.0f = TRUE)

Test passed

Therefore: fragment colour written and current depth of 0.0f written

.

Writing 2nd wedge object

offsetUniform.z is -1.0f so window-space Z value is 1.0f

Previous depth value stored is 0.0f

(winZ GL_LESS PreviousDepthValue) comparison is actually (1.0f < 0.0f = FALSE)

Test failed

Therefore: fragment colour is not written and current depth remains 0.0f

.

To me this process corresponds with the output image shown in Figure 5.3.

Thank you...


Tutorials 12 and 16 do not build with GCC 4.7

Originally reported by: Nikos Platis (Bitbucket: nplatis, GitHub: nplatis)


The error messages for tutorial 12 are

In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h: In instantiation of ‘void Framework::ConstVelLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<glm::detail::tvec3<float> >; ValueType = glm::detail::tvec3<float>]’:
Lights.cpp:66:35:   required from here

../framework/Interpolators.h:183:5: error: ‘distance’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

Lights.cpp:38:7: note: ‘float distance(const vec3&, const vec3&)’ declared here, later in the translation unit

and similarly for

Lights.cpp:133:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit

and

Lights.cpp:134:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit

This is due to a change in (incorrect) behavior of gcc, as documented in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
and the solution is to (at least) declare these functions before including "Lights.h" (or actually before including "../framework/Interpolators.h").

In tutorial 16 (LightEnv.cpp) this is accomplished by simply moving the #include "LightEnv.h" after the definition of distance().

In tutorial 12 (Lights.cpp) you could move all declarations of these functions at the top (just like in tutorial 16/LightEnv.cpp) and also move the #include "Lights.h" below them.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.