Chapter 2 Getting Our Target Ready

Chapter main image

Chapter Overview

Chapter 2 is where we will have our first big difference in the code content in 2025, as we no longer use VisualGDB, even though its a great tool and you would be wise to experiment with it, it does cost some money. So we've moved to totally free Visual Studio for Linux. This lets us target our Pi. But we do need to make sure we set things up correctly and be aware that the code the book asks you to type in is no longer valid. It means you can save your fingers a bit of work.

You can now download and install the code, I've not broken the chapter content into single downloads all content will be intalled, but we just have to focus on the code mentioned in the book.

Download Chapter Files

Main Example

The New OpenGLES setup
Copied!
Loading code sample...

Our main Raspberry project does all the hard work of setting up our systems, We have some features we can set in XWindow.h if we really want to, but best we just leave things alone. Once OpenGLES2.0 is setup, our code jumps to our Game::Start() function which finishes off the initialisation and sets up some of the standard OpenGL states we might want.Then our code simply falls into code that we write ourselves. The same thing will happen if we are running a PC build. The Windows code will set up OpenGLES2.0 for us, and then jump to the same machine independant Game code, to allow us to set both systems up and run our code.
Any OpenGLES2.0 code our project needs to write won't care if its running on PC or Pi3. Game() has effectively replaced main() as our kick off point for our own code.

Changing Some Pi content can be done here

Header File
Copied!
Loading code sample...
Copied!
Loading code sample...

Video Tutorial

Making Hello World

Tets go through a simple hello world example, after we install the libraries we need for the books projects,