<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu" -->

---
title: Most Normal C++ Project: Coding a B2 Bomber in GTA 3
description: A developer walks through porting the open-source GTA 3 reverse-engineering project RE3 to macOS, debugging mouse input, window sizing, and CPU spikes to build...
canonical: https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Most Normal C++ Project: Coding a B2 Bomber in GTA 3 | daily.dev
og:description: A developer walks through porting the open-source GTA 3 reverse-engineering project RE3 to macOS, debugging mouse input, window sizing, and CPU spikes to build...
og:url: https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu
og:image: https://api.daily.dev/og/posts/zIvaQ73Gu.png
og:image:alt: Most Normal C++ Project: Coding a B2 Bomber in GTA 3
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Most Normal C++ Project: Coding a B2 Bomber in GTA 3

**[YouTube](https://daily.dev/sources/youtube)** · 92 min read · 2 upvotes · 0 comments

## Summary

A developer walks through porting the open-source GTA 3 reverse-engineering project RE3 to macOS, debugging mouse input, window sizing, and CPU spikes to build a fast developer iteration loop, then rewrites the Dodo plane's flight physics from scratch and adds a custom B2 stealth bomber with its own Blender model, collision, and bomb-dropping feature. The video emphasizes methodical software engineering practices: verifying assumptions, using source search tools, reading documentation, profiling CPU usage, and isolating fixes to avoid breaking unrelated systems.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=OQM42Ee0fn8>

## Questions this post answers

### How do you fix GLFW mouse input not registering when the cursor is captured at fullscreen startup on macOS?

The issue happens because a cursor-is-in-window flag starts false and only updates via a cursor-enter callback, which never fires if the cursor is already captured when the window opens. The fix adds two extra conditions to the mouse-read gate: checking whether the cursor is captured via GLFW_CURSOR_DISABLED, or whether it is hovered via glfwGetWindowAttrib with GLFW_HOVERED, alongside the original foreground-app check.

_Developers wrestling with platform-specific input bugs can find deep debugging walkthroughs like this on daily.dev._

### How can I reduce high CPU usage caused by a game engine's event polling loop?

Replace continuous unconditional event polling with an interruptible wait using GLFW's glfwWaitEventsTimeout, which pauses the thread until either an event arrives or the remaining frame time elapses. In the RE3 GTA 3 engine port, this change dropped CPU usage from over 90% to roughly 10-25%, since profiling showed over 90% of samples were spent in Mac OS event polling rather than useful frame work.

_Anyone chasing CPU-spike bugs in game loops can dig into profiling techniques like this via daily.dev._

### Why is the GTA 3 Dodo plane so hard to fly in the original game?

The Dodo's flight model never applies forward thrust after takeoff, unlike the RC helicopter model in the same engine which has an explicit thrust and acceleration section. Once airborne, the Dodo only coasts on speed gained from its wheels and gradually loses lift, which is why pitching the nose down to trade altitude for speed is the known trick to keep it flying.

_Developers reverse-engineering game physics quirks like this can track deep-dive breakdowns on daily.dev._

## Similar posts on daily.dev

- [Code is Chaotic: The Art of Turning Your Game Bugs Into Features](https://daily.dev/posts/code-is-chaotic-the-art-of-turning-your-game-bugs-into-features-fhxhadztk) · Medium · 2 upvotes · 0 comments
- [GTA.js, a reimplementation of the 1997 Grand Theft Auto engine in JavaScript and WebGL](https://daily.dev/posts/gta-js-a-reimplementation-of-the-1997-grand-theft-auto-engine-in-javascript-and-webgl-ysmb4jged) · Bram.us · 343 upvotes · 22 comments

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#c++](https://daily.dev/tags/c++), [#reverse-engineering](https://daily.dev/tags/reverse-engineering)

[View this post on daily.dev](https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Most Normal C++ Project: Coding a B2 Bomber in GTA 3","url":"https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu"},"datePublished":"2026-09-24T21:24:45.512Z","dateModified":"2026-09-24T21:30:32.298Z","description":"A developer walks through porting the open-source GTA 3 reverse-engineering project RE3 to macOS, debugging mouse input, window sizing, and CPU spikes to build...","image":"https://i.ytimg.com/vi/OQM42Ee0fn8/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/OQM42Ee0fn8/sddefault.jpg","isAccessibleForFree":true,"articleSection":"YouTube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"YouTube","logo":"https://media.daily.dev/image/upload/s--W5zMumpP--/f_auto/v1725350181/logos/youtube","url":"https://daily.dev/sources/youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"game-development,c++,reverse-engineering","timeRequired":"PT92M","video":{"@type":"VideoObject","name":"Most Normal C++ Project: Coding a B2 Bomber in GTA 3","description":"A developer walks through porting the open-source GTA 3 reverse-engineering project RE3 to macOS, debugging mouse input, window sizing, and CPU spikes to build...","thumbnailUrl":"https://i.ytimg.com/vi/OQM42Ee0fn8/sddefault.jpg","uploadDate":"2026-09-24T21:24:45.512Z","duration":"PT92M","url":"https://api.daily.dev/r/zIvaQ73Gu","embedUrl":"https://www.youtube.com/embed/OQM42Ee0fn8"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"YouTube","item":"https://daily.dev/sources/youtube"},{"@type":"ListItem","position":3,"name":"Most Normal C++ Project: Coding a B2 Bomber in GTA 3"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/most-normal-c-project-coding-a-b2-bomber-in-gta-3-zivaq73gu#faq","mainEntity":[{"@type":"Question","name":"How do you fix GLFW mouse input not registering when the cursor is captured at fullscreen startup on macOS?","acceptedAnswer":{"@type":"Answer","text":"The issue happens because a cursor-is-in-window flag starts false and only updates via a cursor-enter callback, which never fires if the cursor is already captured when the window opens. The fix adds two extra conditions to the mouse-read gate: checking whether the cursor is captured via GLFW_CURSOR_DISABLED, or whether it is hovered via glfwGetWindowAttrib with GLFW_HOVERED, alongside the original foreground-app check. Developers wrestling with platform-specific input bugs can find deep debugging walkthroughs like this on daily.dev."}},{"@type":"Question","name":"How can I reduce high CPU usage caused by a game engine's event polling loop?","acceptedAnswer":{"@type":"Answer","text":"Replace continuous unconditional event polling with an interruptible wait using GLFW's glfwWaitEventsTimeout, which pauses the thread until either an event arrives or the remaining frame time elapses. In the RE3 GTA 3 engine port, this change dropped CPU usage from over 90% to roughly 10-25%, since profiling showed over 90% of samples were spent in Mac OS event polling rather than useful frame work. Anyone chasing CPU-spike bugs in game loops can dig into profiling techniques like this via daily.dev."}},{"@type":"Question","name":"Why is the GTA 3 Dodo plane so hard to fly in the original game?","acceptedAnswer":{"@type":"Answer","text":"The Dodo's flight model never applies forward thrust after takeoff, unlike the RC helicopter model in the same engine which has an explicit thrust and acceleration section. Once airborne, the Dodo only coasts on speed gained from its wheels and gradually loses lift, which is why pitching the nose down to trade altitude for speed is the known trick to keep it flying. Developers reverse-engineering game physics quirks like this can track deep-dive breakdowns on daily.dev."}}]}
```

