DirectX 8. Начинаем работу с DirectX Graphics (Ваткин, Dempski) - страница 29

> }

> ShowWindow(hWnd, SW_SHOW);

> UpdateWindow(hWnd);

> while (lpMsg.message != WM_QUIT) {

>  if(PeekMessage(&lpMsg, 0, 0, 0, PM_REMOVE)) {

>   TranslateMessage(&lpMsg);

>   DispatchMessage(&lpMsg);

>  } else if(g_bActive) {

>   MainLoop();

>  }

> }

> return lpMsg.wParam;

>}

The longest function in our application, WinMain(). As usual, we setup our window class, create our window, show and update it, and go into the message loop. The loop is different from usual because we dont want the processing of our game to interfere with the processing of messages. We use our g_bActive flag to see if its safe to call our game loop, which involves blitting things onto the screen, and at the end of it all we finally return lpMsg.wParam (I'm honestly not sure why, but thats how it's done in every other Win32 app, so oh well).

Pretty simple, huh? 135 lines of code and we're already blitting stuff to the screen. Feel free to explore these classes further, and experiment with things like color keying, loading surfaces from bitmaps, ect. This is a very cool shortcut to using DDraw. It makes things easy without sacrificing control (you can always go back and edit the classes if you want) or performance. One thing to note is that on my computer if I don't draw anything onto the screen using this framework, the application will lock up (which is why I've included text output here). This shouldn't be much of an issue, seeing as how your game will more than likely be blitting things onto the screen (unless there's some new art style which I'm not aware of).

Have fun!

Разработка графического движка 

#1: Введение

Об авторе

Константин Поздняков заканчивает Кемеровский Государственный Университет на кафедре ЮНЕСКО по НИТ. Его диплом достаточно тесно связан с трехмерной графикой и Direct3D в частности. Разрабатывает свой собственный движок. Недавно получил статус MCP (Microsoft Certified Professional) по Visual C++ 6 Desktop. Разработкой игр занимается очень серьезно, планирует связать свою карьеру именно с игровым трехмерным программированием. 

Составляющие Игрового Графического Движка 

Эта статья ставит своей целью описать (по возможности наиболее полно) возможности игрового движка современного уровня. Я попытался классифицировать потребности в реализации, требуемой от программиста. Здесь не обсуждаются подробно реализации каждого конкретного элемента. Этому будут посвящены следующие статьи, а не этот обзор. 

Современный игровой движок должен уметь:

1. Рисовать интерфейс.

2. Рисовать курсор.