"Interactive computer graphics based on the top-down method of OpenGL Shader (6th edition)" Code operation problem and its solution

Source: Internet
Author: User

In the previous article, I mentioned the Red Book 8th edition of the code compile run problem, presumably everyone already know I have seen Red Book.


However, the author can not understand, this is because I do not know the history of OpenGL. There are ancient OpenGL and modern OpenGL points, ancient OpenGL using fixed-function pipelines, is now obsolete (although still available), and modern use of programmable pipelines.


Because the author in the online search a pass, see how OpenGL code has two styles, until now understand. Originally OpenGL before the 8th edition is the fixed function pipeline, to the 8th version immediately turned into a programmable pipeline. However, Red Book has determined that you have a certain computer graphics foundation, so the introduction of the content are relatively advanced, not from the foundation, resulting in even a certain programming and geometric basis of the author also read not understand Red Book.


So the author bought this "interactive computer graphics based on the OpenGL shader's top-down approach (6th edition)", The feeling is very good, the 6th version of the book also added a writer, the author is Red book's author Dave. Watching with Red Book is a perfect blend, and also explains in detail the basic terms of OpenGL, which is almost a cookbook in red.


However, the code of this book does have some problems, even if the author has been successfully compiled red Book code, but the code to compile the book is still a few hours of tossing, explained below.


Download the code for the book from https://www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/SIXTH_EDITION/first


I downloaded only a part of the code,



Then create a new console empty project, the author named the Project E1,




Then add the required source files and shader files, and set the compilation mode to release,



Then add additional Include files



Then download the library file from https://www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/SIXTH_EDITION/and change the Windows folder name to Lib,



Add Additional Library Directories




Compile, error, unable to open file "Freeglut.lib"



and renamed LIBFREEGLUT.A to Freeglut.lib,



Compile, throw an error,



unresolved external symbols, both glut and GLEW functions


Baidu on the Internet a bit, the front with _IMP_ are static libraries, so I added two macros in the Example1.cpp,



Compile, still error, unable to open file "Freeglut_static.lib"



Then I copy the Freeglut.lib, and then renamed to Freeglut_static.lib,



Compile, still error, but this time only has glew problem



Modify additional dependencies, add libglew32.a libraries,




Compile, success




Put the shader file in the directory where the project file is located



Compile, crash, add glewexperimental= gl_true before Glewinit () (same as previous article)


Run successfully.




"Interactive computer graphics based on the top-down method of OpenGL Shader (6th edition)" Code operation problem and its solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.