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
Python Game Programming By Example

You're reading from   Python Game Programming By Example A pragmatic guide for developing your own games with Python

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781785281532
Length 230 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Getting started with OpenGL

OpenGL is a broad topic in itself, and it is possible to find plenty of tutorials, books, and other resources, usually targeted at C or C++.

Since this chapter is not intended to be a comprehensive guide for this specification, we will take advantage of GLUT, which stands for OpenGL Utility Toolkit. It is widely used in small applications because of its simplicity and portability, and the bindings are implemented in PyOpenGL.

GLUT will help us perform some basic operations, such as creating windows and handling input events.

Tip

GLUT licensing

Unfortunately, GLUT is not in the public domain. The copyright is maintained by its author, Mark Kilgard, who wrote it for the sample programs included in Red Book, the official OpenGL programming guide.

This is the reason we are using freeglut, one of the open source alternatives that implement the GLUT API.

Initializing the window

The first lines of our script will be the import statements as well as the definition of our App...

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