Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn OpenGL

You're reading from   Learn OpenGL Beginner's guide to 3D rendering and game development with OpenGL and C++

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789340365
Length 208 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Frahaan Hussain Frahaan Hussain
Author Profile Icon Frahaan Hussain
Frahaan Hussain
Arrow right icon
View More author details
Toc

Drawing Shapes and Applying Textures

The previous chapter was all about setting up our project to use different types of libraries, such as GLFW, GLEW, SMFL, and SDL. In this chapter, we'll go beyond the setup part and learn to implement some really cool OpenGL stuff. We'll learn about shaders and how to use them to create various shapes. Then, we'll move on to learn how to create a separate shader file and reference that in our code. We'll also discuss how to apply different textures to shapes using the SOIL library.

In this chapter, we'll cover the following topics in detail:

  • Learning to draw a triangle using a shader
  • Creating a separate shader file and referencing it in the main code
  • Drawing a rectangle and applying textures to it using the SOIL library

This chapter will initiate you into OpenGL coding and you'll learn a lot of concepts related...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image