Join Pablo Colapinto for an in-depth discussion in this video Compiling shaders, part of Learning OpenGL.
- [Voiceover] Let's take a look at how…to compile our own shaders.…Let's scroll down to line 45 to 62.…This is our shader code, pretty short and sweet,…and we'll come back to it in a moment.…Let's continue scrolling down, past all this stuff.…You can ignore it for now…and take a look starting at line 150, down to about line 177.…These are the steps necessary to create,…load, compile, link, and use a shader program.…
On line 150, we create the shader program…and it returns a unique ID.…We set this to our variable SID.…That's a unique ID we're going to be able to use later.…We also create a vertex shader and a fragment shader…and these also get their own unique ID's.…On lines 155 and 156,…we actually load the shader code into our shaders.…Here we're specifying the shader ID.…Here are the number of files we're going to load.…Here's a pointer to the text that we're going to load…and this null string we can ignore for the moment.…
On lines 159 and 160, we compile our shaders,…passing them the unique ID's…that we defined on lines 151 and 152.…
- What is OpenGL?
- Setting up an OpenGL workflow
- Creating a window with GLFW
- Working with geometric primitives
- Rotating, translating, and scaling
- Understanding matrix transformations
- Creating mesh data structures
- Buffering mesh data
- Getting mouse and keyboard input
Skill Level Intermediate
Q: Why am I getting errors saying I don’t have GLEW installed when I try to create the Xcode projects with Cmake?
1) Download, Install, and Run Xcode
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install glew
./bootstrap && make && make install
brew install cmake
cd Exercise Filesmkdir xcodecd xcodecmake -G "Xcode" ..