Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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

Modifications to the main.cpp file

In the main.cpp file, there are a few changes we need to make. Follow the steps shown here:

  1. First of all, we need to create a new shader object, so before we define GLfloat cubeVertices[], we need to add Shader skyboxShader(). And, to that we'll pass the locations of our shader files: "res/shaders/skybox.vs" and "res/shaders/skybox.frag".
  2. Next, we're going to need some more vertices for the skybox. Luckily, you can refer those to the main.cpp file present inside the advanced_opengl folder. Add these vertices to our code.
  3. Once you've got the skybox vertices all set up, you will need to create a vertex array object and vertex buffer object for the skybox. So, let's do that right now.
  4. After we have defined glBindVertexArray(0), we'll add GLuint skyboxVAO and skyboxVBO;.
  5. Then, we'll add glGenVertexArrays...
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 £16.99/month. Cancel anytime