---
title: "Why GLUT is used in OpenGL"
subject: "Computer Graphics"
chapter: 9
key: "semester_5/computer_graphics:glut-in-opengl"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/glut-in-opengl
site: BCT Engineering
---

# Why GLUT is used in OpenGL

Computer Graphics · Chapter 9: Introduction to Open GL

- Asked in: 2072 Chaitra, 2 marks; 2071 Shrawan, 2 marks (asked 2 times)
- Video: [OpenGL Tutorial | OpenGL Screencast Video Tutorial 5: using GLUT for OpenGL interactions](https://www.youtube.com/watch?v=NNgRm-EqAmM) — David Parker
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/glut-in-opengl
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-9

## Question

Why is GLUT implemented in OpenGL?

## Short answer

GLUT is implemented with OpenGL to provide platform-independent window creation, input handling, and event management, which OpenGL lacks. It offers functions like glutCreateWindow, glutDisplayFunc, and glutMainLoop, enabling portable interactive graphics applications without OS-specific code.

## Answer

OpenGL itself only draws graphics; it has no functions for creating windows, handling the keyboard and mouse, or managing events, because these depend on the operating system. **GLUT (OpenGL Utility Toolkit)** is added to provide these in a simple, **platform-independent** way:
- creating and managing windows (`glutCreateWindow`, `glutInitDisplayMode`),
- handling input and events through callbacks (keyboard, mouse, resize, idle),
- simple menus, timers and ready-made shapes (`glutSolidTeapot`, `glutWireCube`).

So the same OpenGL program can run on Windows, Linux and macOS without rewriting window code, and it makes small programs and teaching examples easy.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is GLUT needed with OpenGL?
   A. OpenGL cannot draw triangles
   B. OpenGL has no colour support
   C. OpenGL only draws; it has no functions for windows, input or events
   D. GLUT replaces the GPU
   Answer: C. Those functions depend on the OS. (Key point: Why GLUT)

2. What does GLUT achieve?
   A. It runs only on Linux
   B. It makes programs slower
   C. It removes the need for callbacks
   D. The same program runs on Windows, Linux and macOS without rewriting window code
   Answer: D. It gives platform-independent window and input handling. (Key point: Platform independence)

3. Which of these does GLUT provide?
   A. Window creation, input via callbacks, menus and ready-made shapes
   B. Texture mapping algorithms
   C. Hidden surface removal
   D. Phong shading
   Answer: A. Examples: glutCreateWindow, glutKeyboardFunc, glutSolidTeapot. (Key point: GLUT features)

## Related in other subjects

- [Distribution system used in INPS](https://www.bctengineer.com/question.md?key=semester_8%2Ftransmission_and_distribution_system_design%3Ainps-distribution-system-type) — Transmission and Distribution System Design, chapter 5
- [Default arguments and function overloading](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Adefault-args-function-overloading) — Object Oriented Programming, chapter 3, asked 5×
