Join Pablo Colapinto for an in-depth discussion in this video Loading image textures, part of Learning OpenGL.
-Let's take another look at textures by loading…in an image from a file.…In our GLdata.hpp file it included a simple bitmap loader.…Our vertex and fragment shader remain the same.…Here on line 84 we load our bitmap from file.…The main changes to note are down here…where we generate the texture image itself.…Since the format of our data is GLRGB…as opposed to GLRGBA as it was in the last lesson.…
The type of data is now GL unsigned byte,…as opposed to GL float.…Since bitmaps store their data types as unsigned bytes.…The internal format can stay the same.…Also, when we actually send the data over,…we need to specify that the data type…is GL unsigned byte.…Here, because bitmaps flip the order of their…RGB values, we need to send them in reverse order.…Let's see how this compiles.…Here we have a nice smooth image because…I've set "GL texture mag filter" to be GL linear.…
If I change this back to be GL nearest,…and recompile, we'll see that the actual resolution…of the image is lower.…By using GL linear, we've been able to upsample the texture.…
- 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" ..