informa
/
2 MIN READ
News

Feature: 'A 2D Render Base Using Policy Based Design'

In this Gamasutra technical article, Chinese casual games programmer Zhaolin Feng gives us his tuto...
In this Gamasutra technical article, Chinese casual games programmer Zhaolin Feng gives us his tutorial on creating a fluid 2D render base, using a technique inspired by Scott Meyers' Modern C++ Design. In his intro, Feng explains that even though creating a polygonal 2D engine can achieve great results through hardware acceleration, a more traditional 2D solution might be preferable for maximum compatibility: "When developing casual games, a problem we often face is trying to create a pure 2D render base without 3D acceleration and creating the exact same effect. But before diving into the solution, I think it’s important to explain a bit more about why we need a 2D fallback in the first place. [...] If you are making a casual game like the ones on Popcap or Real Arcade, you can’t assume everyone has a gear with 3D acceleration. And even if they do, they may not have the driver installed properly, because the target audiences of casual games are the ones like our mums and dads. So in order to support these machines, we’ll need a pure 2D fallback. The main job of a 2D render base is moving pixels. I mean something like win32 API BitBlt() or StretchBlt() which transfer pixels from a specified source rectangle to a specified destination rectangle, altering the pixels according to the selected raster operation. You may feel confused by now. What’s the fuss with BitBlt? Everyone knows how to use it. I can even use DirectDraw if I like! But this is never an easy task if you think about it seriously. The culprit this time is combination explosion. Let me explain it to you." You can now read the full Gamasutra feature on the subject, including full code examples and downloadable source for Feng's 2D solution (no registration required, please feel free to link to this column from external websites).

Latest Jobs

Treyarch

Playa Vista, Los Angeles, CA, USA
9.12.23
Senior Level Designer (Zombies)

PlayStation Studios Creative Arts

Petaling Jaya, Selangor, Malaysia
9.14.23
Lead/ Senior Asset Artist

Treyarch

Playa Vista, Los Angeles, CA, USA
8.22.23
Senior Gameplay Systems Engineer - Treyarch

High Moon Studios

Carlsbad, CA, USA
9.18.23
VFX Artist
More Jobs   

CONNECT WITH US

Explore the
Advertise with
Follow us

Game Developer Job Board

Game Developer

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
Advertise with

Game Developer

Engage game professionals and drive sales using an array of Game Developer media solutions to meet your objectives.

Learn More
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more