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
OpenGL Game Development By Example

You're reading from   OpenGL Game Development By Example Design and code your own 2D and 3D games efficiently using OpenGL and C++

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781783288199
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Robert Madsen Robert Madsen
Author Profile Icon Robert Madsen
Robert Madsen
Stephen Madsen Stephen Madsen
Author Profile Icon Stephen Madsen
Stephen Madsen
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Coding in 3D


It's time for us to put our theory into practice and create our first 3D scene. To keep things simple, we will go through the steps of placing a cube in 3D space. This is also going to be the start of our 3D game, so let's start by creating a brand new project in Visual Studio.

Creating the project

When we created a project for our 2D game, we started with a standard Windows project and then removed (or ignored) the items that we didn't need to use. In fact, the standard Windows project has a lot of overhead that we don't need. This is because the Windows project template assumes that Windows is going to be in charge of rendering and processing. This came in useful for our 2D project, but just adds a lot of extra code that we don't need.

For this project, we will start with a blank Windows project and then add the necessary code to initialize and create an OpenGL window. Then, we will work our way up from there:

  1. Begin by opening Visual Studio.

  2. Once Visual Studio is open, create a...

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 R$50/month. Cancel anytime