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

OpenGL Game Development By Example: Design and code your own 2D and 3D games efficiently using OpenGL and C++

eBook
Can$12.99 Can$66.99
Paperback
Can$83.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

OpenGL Game Development By Example

Chapter 1. Building the Foundation

Building a game is like building a house. Except this is a crazy house with rooms sticking out everywhere, and at any time someone might decide to add another room just here, and remove a room over there. You had better have a good foundation!

This chapter will take you through the process of setting up the foundation to build your game. You will learn, how to set up a development environment using Visual Studio. Next, you will set up the game loop, which is the foundation for every game ever created. Finally, you will set up the development environment to use OpenGL as your rendering engine.

Introducing the development environment

The development environment is the set of tools that you use to edit, compile, and run your program. There are many development tools out there; some tools are glorified text editors, while others are entire suites of tools that are integrated into a single application. These more advanced suites are known as Integrated Development Environments (IDEs).

Microsoft's Visual Studio is by far the most widely used IDE, and the good news is that you can obtain and use it for free. Go to https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx and follow the links to download the latest version of Visual Studio Community, previously known as Visual Studio Express. Visual Studio Community is not a trial version and will not expire. You will probably see trial versions of Visual Studio being offered, so make sure you download the free version of Visual Studio Community.

Visual Studio offers several languages to program in. We will be using C++ throughout this book. When you first use Visual Studio, you may be asked which language you want to set up the development environment for. I recommend that you choose the C++ settings. However, you will still be able to use Visual Studio for C++ even if you choose a different default programming language.

Visual Studio Community 2013 was the current version at the time this book was written. All of the screenshots you see in the book are from that version. It is quite likely that a later version of Visual Studio will have come out by the time you get your hands on this book. The general functionality stays the same from one version to another, so this should not be a problem. If you are using a different version of Visual Studio, then the exact location of some commands may not be the same as in the screenshots in this book.

Tip

Microsoft differentiates between programs written for Windows Desktop and those written for Windows Universal. Ensure that you download Visual Studio Community Express for Desktop.

When you first start Visual Studio, you will be asked for a few options, so I thought I'd cover them here:

  • If you are asked which programming language you would like to set up as your default development environment, it really doesn't matter which language you choose. If you think you will be using C++ a lot, then pick C++. If you pick another language as your default you will still be able to code in C++.
  • You will be asked to sign into your Microsoft account. If you have ever used MSN, Hotmail, or Windows Messenger, then you already have a Microsoft account. At any rate, if you don't have a Microsoft account you can use your own e-mail address to create one, and it doesn't cost anything.
  • You may be asked to set up a developer license for Windows. Just click I Agree and it will be done. Again, no charge!

A quick look at Visual Studio

As Visual Studio can do so many things, it may be a bit intimidating the first time you use it. I have been using Visual Studio for over 20 years and there are still parts of it that I have never needed! Let's take a look at the key components, in the following screenshot, that you will use every day:

A quick look at Visual Studio

Start screen

The start screen, as shown in the preceding screenshot, allows you to quickly start a new project or open an existing project. The most recent projects that you have worked with can be quickly accessed from the list of recent projects.

The Solution Explorer panel

The Solution Explorer panel allows you to navigate and work with all of the code and other resources in your project. If you do not see the Solution Explorer window on your screen, click View | Solution Explorer.

The Solution Explorer panel

From this window you can:

  • Double-click on any item to open it
  • Right-click to add existing items to the project
  • Right-click to add new items to the project
  • Create folders to organize your code

The Standard Toolbar panel

The Standard Toolbar panel contains buttons for the most common tasks:

  • Save the current file
  • Save all modified files
  • Undo and Redo
  • Run the program

Tip

There are basically two ways to run your program. You can run the program with or without debugging. Debugging mode allows you to set checkpoints that stop the program and let you view the state of variables, and perform other operations while the code is running. If you run the program without debugging, you will not be able to do these things.

The Standard Toolbar panel

The code window

The center of the IDE is dominated by the code window. This is where you type and edit your code. You can have several code windows open at once. Each code window will add a tab across the top, allowing you to switch from one piece of code to another with a single click:

The code window

You will notice that the text is color-coded. This allows you to easily see different types of code. For example, the comments in the code in the preceding screenshot are in green, while the C++ objects are in blue. You can also zoom in and out of the code by holding down the Ctrl button and using the scroll wheel on the mouse.

The output window

The output window is typically at the bottom of the IDE. This window is where you will look at to see the status of the current run, and where you will find errors when you try to compile run your program.

If you see an error in the output window, you can usually double-click on it, and Visual Studio will take you to the line in code that caused the error:

The output window

Starting your project

It's time to stop reading and start doing! We are going to use Visual Studio to start our game project.

  1. Open Visual Studio and click the New Project link in the start window.
  2. Navigate to the left-hand side panel and select Win32 under the Visual C++ branch of Templates.
    Starting your project
  3. Select Win32 Project in the center area.
  4. Give the project a name. The first game we will be working on is a 2D robot racing game that we'll call RoboRacer2D.
  5. Choose a folder location to store the project, or just leave the default location.
  6. The solution name is almost always the same as the project name, so leave that as it is.
  7. Leave Create directory for solution checked.
  8. Click OK.
  9. On the next screen click Finish.

We need to tell Visual Studio how to work with Unicode characters. Right-click on the project name in the Solution Explorer panel and choose Properties. Then select General. Change the Character Set property to Not Set.

Congratulations! You have now created your Windows application and set up your development environment. It's time to move on to creating the framework for your game.

The game loop

The game loop is the primary mechanism that moves the game forward in time. Before we learn how to create this important component, let's briefly take a look at the structure of most games.

The game structure

There are three phases to most games: the initialization phase, the game loop, and the shutdown phase. The core of any game is the game loop.

The game structure

The game loop is a sequence of processes that run continuously as long as the game is running. The three main processes that occur in the game loop are input, update, and render.

The input process is how the player controls the game. This could be any combination of keyboard, mouse, or control pad. Newer technologies allow the game to be controlled via a sensing device that detects gestures, while mobile devices detect touch, acceleration, and even GPS.

The update process encompasses all of the tasks required to update the game: calculating where characters and game objects have moved, determining whether items in the game have collided, and applying physics and other forces in the game.

Once the preceding calculations have been completed, then it is time to draw results. This is known as the render process. OpenGL is the library of code that handles the rendering for your game.

Tip

Many people think that OpenGL is a game engine. This is not accurate. OpenGL—the open graphics language—is a rendering library. As you can see, rendering is only one process involved in the execution of a game.

Let's take a closer look at each stage of the game so that we can get a better idea of how OpenGL fits in.

Initialization

There are certain parts of the game that must be set up only once before the game can run. This typically includes initializing variables and loading resources. There are certain parts of OpenGL that must be initialized during this phase as well.

The game loop

Once the initialization is complete, the game loop takes over. The game loop is literally an endless loop that cycles until something tells it to stop. This is often the player telling the game to end.

In order to create the illusion of movement, the render phase must occur several times a second. In general, games strive to render at least 30 frames to the screen every second, and 60 frames per second (fps) is even better.

Tip

It turns out that 24 fps is the threshold at which the human eye begins to see continuous motion instead of individual frames. This is why we want the slowest speed for our game to be 30 fps.

Shutdown

When the game does end, it isn't enough to just exit the program. Resources that are taking up precious computer memory must be properly released to the reclaim that memory. For example, if you have allocated memory for an image, you will want to release that memory by the end of the game. OpenGL has to be properly shut down so that it doesn't continue to control the Graphics Processing Unit (GPU). The final phase of the game is to return control to the device so that it will continue working properly in its normal, nongaming mode.

Creating the game structure

Now that we created our RoboRacer2D project in Visual Studio project, let's learn how to modify this code to create our game structure. Start Visual Studio and open the project we just created.

You should now see a window with code in it. The name of the code file should be RoboRacer2D.cpp. If you don't see this code window, then find Solution Explorer, navigate to RoboRacer2D.cpp, and open it up.

I'll be the first person to admit that the Windows C++ code is both ugly and intimidating! There is a lot of code created from you by Visual Studio when you choose the Windows desktop template to create your project. In fact, you can run this code right now by clicking DEBUG from the menu bar and then choosing Start Debugging. You can also press the F5 key.

Go ahead and do it!

Creating the game structure

You will see a window telling you that the project is out of date. This simply means that Visual Studio needs to process your code and turn it into an executable—a process called building the project. For the computer science majors out there, this is where your code is compiled, linked, and then executed by the operating system.

Click Yes to continue.

Creating the game structure

Congratulations! You have now created and run your first program in Visual Studio. It may not look like much, but there is a lot going on here:

  • A fully sizeable and moveable window
  • A working menu system with File and Help choices
  • A title bar with RoboRacer2D
  • Working minimize, maximize, and close buttons

Keep in mind that you haven't written a single line of code yet!

Now that you see it, feel free to use the close button to close the window and return to Visual Studio.

But wait, this doesn't look like a game!

If you are thinking the RoboRacer2D program doesn't look much like a game, you are correct! In fact, to make a game we typically strip away about everything that you now see! However, for this demonstration, we are going to keep the window just like it is, and worry more about the code than the appearance.

Port of access

Every program has a starting point, and for a Windows program the entry point is the _tWinMain function. Look for the following line of code:

int APIENTRY wWinMain

The _wWinMain function will start running and will set up everything required to run a Windows desktop program. It is beyond the scope of this book to go into everything that is going on here. We will just take it for granted that the code we are looking at sets things up to run in Windows, and we will focus on the things that we need to modify to make a game.

The Windows message loop

It turns out that _wWinMain already sets up a loop. In a similar manner to games, Windows programs actually run in an endless loop, until they receive some kind of event that tells them to stop. Here's the code:

// Main message loop:
while (GetMessage(&msg, nullptr, 0, 0))
{
  if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
  {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }
}

As you can see, these lines of code set up a while loop that will continue to run until the result of the GetMessage call is false.

Again, we won't worry about the exact details, but suffice to say that GetMessage constantly checks for messages, or events, that are sent by Windows. One particular message is the quit event, which will return a result of false, ending the while loop, exiting the _tWinMain function, and ending the program.

Our goal is to modify the Windows message loop and turn this block of code into a game loop:

StartGame();
//Game Loop
bool done = false;
while (!done)
{
  if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
  {
    if (msg.message == WM_QUIT)
    {
      done = true;
    }
    else
    {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
    }
  }
  else
  {
    GameLoop();
  }
}
EndGame();

Study the preceding code. You will see that we have added three new functions: StartGame, GameLoop, and EndGame.

  • StartGame comes before the Windows message loop, which means that everything in StartGame will run once before Windows enters its loop. We will put all of the game initialization code in the StartGame function.
  • EndGame comes after the Windows message loop. This means that the code in EndGame will only execute one time after the Windows message loop has exited. This is the perfect place for us to release resources and shut the game down.
  • GameLoop is interleaved in the Windows message loop. Basically, the code is saying, "Keep running until you receive a Windows message to quit. While you are running, check to see if Windows has passed any events that need to be handled. If there are no messages to handle, then run our game."

Tip

Order is important. For example, you have to declare these functions before the wWinMain function. This is because they are called by wWinMain, so they have to exist before tWinMain uses them. In general, a function has to be declared before the code that uses it.

In order for these new functions to be valid, go to the line just before the _tWinMain and enter some stubs for these three functions:

void StartGame()
{
}

void GameLoop()
{
}

void EndGame()
{
}

The idea here is to help you see how easy it is to convert the standard Windows message loop into a game loop.

Introducing OpenGL

We have spent a lot of time so far talking about game loops and Visual Studio. We are finally going to discuss the main topic of this book: OpenGL!

What is OpenGL?

OpenGL makes it possible to render sophisticated 2D and 3D graphics on your computer screen. In fact, OpenGL is also the technology behind most mobile devices and tablet devices.

OpenGL works in conjunction with your device's graphics device to draw graphics on the screen. Most modern computing devices have two processors: the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU).

Drawing modern 2D and 3D graphics is a very processor intensive task. In order to free the computer's main processor (the CPU) to do its job, the GPU takes on the task of rendering to the screen. OpenGL is a language that tells the GPU what to do and how to do it.

Tip

Technically, OpenGL is an API, or application programming interface. Another way to understand this is that OpenGL is a library of code that you can access once you have included the proper headers in your code. There are different versions of OpenGL. This book uses OpenGL 1.1. Although this is the very first version of OpenGL, it is included in all versions of Windows and provides the building blocks for all future versions.

The other GL

By the way, you have probably heard of the "other" graphics engine—Microsoft's DirectX. Similar to OpenGL, DirectX allows programmers to talk to the GPU. A lot of people want to know the differences between OpenGL and DirectX, and which is the best choice.

Although there are certainly going to be fans and defenders of both technologies, the only real difference between DirectX and OpenGL is the specific way that you code them. Both technologies are about the same when it comes to features and abilities.

There is one advantage that OpenGL has over DirectX. DirectX only works on Microsoft technologies, while OpenGL works on Microsoft technologies and many others, including most modern cell phones, and the Apple Mac line of computers.

Downloading OpenGL

I remember when I was first learning OpenGL. I searched in vain, looking for the link to download the OpenGL SDK. It turns out that you don't have to download the OpenGL SDK because it is already installed when you install Visual Studio.

You do want to make sure that you have the latest OpenGL driver for your video card. To do that, go to http://www.opengl.org/wiki/Getting_started#Downloading_OpenGL and follow the appropriate link.

Adding OpenGL to the project

In order to use OpenGL in our program, we will need to add some code. Open the RoboRacer2D project that we have been working on, and let's do this!

Linking to the OpenGL library

Everything that you need to use OpenGL is found in the OpenGL32.dll lib file. It's up to you to tell Visual Studio that you want to use the OpenGL library in your project.

Right-click on Project | RoboRacer2D properties.

Tip

By the way, Visual Studio first creates a solution, and then puts a project in the solution. The solution is the top entry in the Solution Explorer hierarchy, and the project is the first child. In this case, make sure you right-click on the project, not the solution.

Linking to the OpenGL library
  1. For the Configuration drop-down box, make sure you select All Configurations.
  2. Open the Configuration Properties branch, then the Linker branch.
  3. Select the Input option.
  4. Click the dropdown for Additional Dependencies and choose <Edit…>.
  5. Enter OpenGL32.lib into the dialog window and click OK.
    Linking to the OpenGL library
  6. Close the Property Pages window.

Even if you are writing a 64 bit application, you will use the OpenGL 32 bit library.

Next, we need to tell Visual Studio that you want to include the OpenGL headers in your program. If you take a look at the top of your code, you will see several headers already being loaded:

#include "stdafx.h"
#include "RoboRacer2D.h"

Just below these lines, add the following:

#include <Windows.h>
#include <gl\GL.h>
#include <gl\GLU.h>

Tip

GL.h is the main header for the OpenGL library. GLU.h stands for GL Utility and is an additional library of features that make OpenGL a little easier to use. These headers correspond to the OpenGL32.lib and Glu32.lib libraries that we added to the project.

Congratulations! You have set up the development environment to use OpenGL and you are now ready to program your first game.

Summary

We covered a lot of ground in this chapter. We learned how to set up your development environment by downloading and installing Visual Studio. Next, we created a C++ Windows Desktop application.

We discussed the structure of most games and the importance of the game loop. Recall that an average game should run at 30 fps, while top-end games shoot for 60 fps to provide smooth animations.

Finally, we learned about OpenGL and how to initialize OpenGL in your project. Remember, OpenGL is the graphics engine that will be responsible for drawing every image and piece of text to your screen using the power of your GPU.

After all this work, there still isn't a lot to see. In the next chapter, we will go into all of the details of how to render your first image to the screen. Believe it or not, getting your development environment properly set up means you have already accomplished a great deal toward creating your first game using OpenGL.

Left arrow icon Right arrow icon

Key benefits

  • Create 2D and 3D games completely, through a series of end-to-end game projects
  • Learn to render high performance 2D and 3D graphics using OpenGL
  • Implement a rudimentary game engine using step-by-step code

Description

OpenGL is one of the most popular rendering SDKs used to develop games. OpenGL has been used to create everything from 3D masterpieces running on desktop computers to 2D puzzles running on mobile devices. You will learn to apply both 2D and 3D technologies to bring your game idea to life. There is a lot more to making a game than just drawing pictures and that is where this book is unique! It provides a complete tutorial on designing and coding games from the setup of the development environment to final credits screen, through the creation of a 2D and 3D game. The book starts off by showing you how to set up a development environment using Visual Studio, and create a code framework for your game. It then walks you through creation of two games–a 2D platform game called Roboracer 2D and a 3D first-person space shooter game–using OpenGL to render both 2D and 3D graphics using a 2D coordinate system. You'll create sprite classes, render sprites and animation, and navigate and control the characters. You will also learn how to implement input, use audio, and code basic collision and physics systems. From setting up the development environment to creating the final credits screen, the book will take you through the complete journey of creating a game engine that you can extend to create your own games.

Who is this book for?

If you are a prospective game developer with some experience using C++, then this book is for you. Both prospective and experienced game programmers will find nuggets of wisdom and practical advice as they learn to code two full games using OpenGL, C++, and a host of related tools.

What you will learn

  • Set up your development environment in Visual Studio using OpenGL
  • Use 2D and 3D coordinate systems
  • Implement an input system to handle the mouse and the keyboard
  • Create a state machine to handle complex changes in the game
  • Load, display, and manipulate both 2D and 3D graphics
  • Implement collision detection and basic physics
  • Discover the key components needed to complete a polished game
  • Handle audio files and implement sound effects and music
Estimated delivery fee Deliver to Canada

Economy delivery 10 - 13 business days

Can$24.95

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 08, 2016
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781783288199
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Canada

Economy delivery 10 - 13 business days

Can$24.95

Product Details

Publication date : Mar 08, 2016
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781783288199
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 261.97
OpenGL ??? Build high performance graphics
Can$107.99
OpenGL Data Visualization Cookbook
Can$69.99
OpenGL Game Development By Example
Can$83.99
Total Can$ 261.97 Stars icon
Banner background image

Table of Contents

13 Chapters
1. Building the Foundation Chevron down icon Chevron up icon
2. Your Point of View Chevron down icon Chevron up icon
3. A Matter of Character Chevron down icon Chevron up icon
4. Control Freak Chevron down icon Chevron up icon
5. Hit and Run Chevron down icon Chevron up icon
6. Polishing the Silver Chevron down icon Chevron up icon
7. Audio Adrenaline Chevron down icon Chevron up icon
8. Expanding Your Horizons Chevron down icon Chevron up icon
9. Super Models Chevron down icon Chevron up icon
10. Expanding Space Chevron down icon Chevron up icon
11. Heads Up Chevron down icon Chevron up icon
12. Conquer the Universe Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.7
(6 Ratings)
5 star 16.7%
4 star 33.3%
3 star 0%
2 star 0%
1 star 50%
Filter icon Filter
Top Reviews

Filter reviews by




Robert Madsen Aug 12, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Full disclosure...I am the author of this book. I recognize the criticisms that the book is written to OpenGL 1.1. Keep in mind three things: (1) This book is intended as a primer. The reason for using OpenGL 1.1 is because that is the version that comes universally on all Windows PCs and therefore it is widely available and already pre-installed. (2) There is nothing taught in the book that is invalidated by newer versions of OpenGL, and (3) The book is much more that a book about OpenGL...it is a book about game development using OpenGL. In that regard, it covers other features of game development including good game design, audio, and UI. The reader creates 2 prototype games--one in 2D and one in 3D.I'll admit this is not an advanced OpenGL book...there are other books that fulfill that purpose. However, this book does exactly what the description says it does. It provides a beginner a good understanding of developing 2D and 3D games.Thanks for all of your comments.
Amazon Verified review Amazon
yetiman123 Mar 19, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Outdated a bit, but it works.
Amazon Verified review Amazon
Jairo Supelano Jul 29, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
About the objective of the text it more or less complies with it; it guides the user through the process of using OpenGL to develop both 2D and 3D games (intro level), and it gives pointers about free and open source tools that may help in the process, yet it makes use of things like GLUT, which must be avoided since is old, its use require things that are not part of C++ standard and is not a standard itself and is not always available, and it uses it for things like glutGet(GLUT_ELAPSED_TIME) which could be replaced by things like GetTickCount() since all examples are intended to run on Windows only (there are other alternatives which require to use at least C++ 11 or above, which would not be a problem with the tools used along the text).On the other hand the code examples where not verified for typos, and they would not even compile in the way they are presented in the text; from missing semi-colons to wrong type of parameters, to simply telling the user to include some files, but displayed in screenshots with the wrong name. Is obvious that the code was not copied from working code and was not tested before placing it in the text
Amazon Verified review Amazon
Amazon Customer Mar 10, 2016
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Absolutely terrible. Very shallow introduction to OpenGL, with nothing about shaders or modern pipeline, no scene graph, no proper model loading, nothing about lighting a scene... this book is just useless. You can find much better information online, on great websites like (...) and (...)
Amazon Verified review Amazon
Gabor Szauer Mar 23, 2016
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I got this book after reading Packt's other great books on shaders and OpenGL. I expected this to be great as well, it is not.The entire book focuses on the VERY outdated OpenGL 1.1 API. And even at that it does a poor job. The amount of information covered in this book is so low i can't even rant about it. The book does not even mention vertex arrays, forget about anything with buffer in the name. How did this manage to find a publisher and get published? If you want to get a good book about legacy OpenGL, go with OpenGL Game Programming, First edition/
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela