Windows API Tutorials

Здесь есть возможность читать онлайн «Windows API Tutorials» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: Программирование, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Windows API Tutorials: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Windows API Tutorials»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Windows API Tutorials — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Windows API Tutorials», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

unsigned long ColorValue (COLORREF color) {

switch (_bpp) {

case 16:

return ColorValue16 (color);

case 24:

return ColorValue24 (color);

case 32:

return ColorValue32 (color);

default:

throw "PixelFormat: only 16, 24 and 32 bits supported";

}

}

private:

int _bpp; // bits per pixel 4, 8, 16, 24, or 32

unsigned long _redMask;

unsigned long _greenMask;

unsigned long _blueMask;

unsigned _redShift;

unsigned _greenShift;

unsigned _blueShift;

unsigned long _mask;

};

unsigned HiBitShift (unsigned val) {

unsigned i = 0;

while (val != 0) {

val >>= 1;

++i;

}

return i;

}

void PixelFormat::Init (SurfaceDesc & desc) {

DDPIXELFORMAT & format = desc.PixelFormat ();

if (format.dwFlags != DDPF_RGB) throw "Direct Draw: Non-RGB formats not supported";

_bpp = format.dwRGBBitCount;

_redMask = format.dwRBitMask;

_greenMask = format.dwGBitMask;

_blueMask = format.dwBBitMask;

_mask = ~(_redMask | _greenMask | _blueMask);

switch (_bpp) {

case 16:

_redShift = HiBitShift (_redMask) + 8;

_greenShift = HiBitShift (_greenMask) + 8;

_blueShift = HiBitShift (_blueMask) + 8;

break;

case 24:

break;

case 32:

break;

default:

throw "Only 16, 24 and 32 bit graphics supported";

}

}

Notice that this tutorial only scratches the surface of DirectX. There are several versions of DirectDraw. There is Direct3D for three-dimensional graphics (although it seems like Open GL might be a better platform). Sound can be dealt with using DirectSound and input devices have their DirectInput. All these subsystems can be encapsulated using similar techniques.

Joining the Tutorial Project

This is an exprerimental subscription service — a new method of distributing and updating sources. It uses our version control system, Code Co-op, to create a project on your machine and enlist you as an anonymous project member. You will be able to download the sources of all the tutorials in the form of Code Co-op synchronization scripts.

When we modify the sources, you'll be able to obtain modification scripts that will automatically update your copy of the project. These scripts will only contain changes , so the updates will be much smaller than the original sources.

Download and install Code Co-op (less than 1mb).

During installation, configure your machine as standalone. Notice: the whole procedure is free. Normally, you have to buy a license to use Code Co-op. However, you don't need a license to be an "observer" in a project. Additionally, for the first 31 days after installation, you'll have access to the full functionality of the program. You're welcome to experiment with it.

Notice also that the installation of Code Co-op (unlike many other programs) does not replace any dll's in your system directory. So, after you've defected from all projects and ran uninstall from the Control Panel, there will be no trace of our program on your computer!

Join the Tutorial project.

Start Code Co-op. Select Join from the Project menu. Fill out the following dialog:

Make sure the items circled in red are filled in as in the picture. Type in a path where you want the sources on your machine (the database path will default to its subdirectory, Co-op). Provide your name and e-mail address (we'll notify you about updates, but no spam!).

The dispatcher will try to email a join request to tutorial@relisoft.com. If your e-mail program is not Simple MAPI compatible, it will fail. Don't worry: delete the join script from your local outbox (in the example above it would be at New">c:\your path\tutorial\Co-op\Outbox") and send us a note (may be empty) to tutorial@relisoft.com, so that we can notify you about updates.

Download initisal scripts .

This is a zipped file. Unzip its contents into the local inbox of your project (it's the Inbox subdirectory of your project's database). In the example above, the path would be c:\your path\tutorial\Co-op\Inbox. (Do not put it in the Global Inbox!)

Synchronize the Project.

Start Code Co-op, (visit the Tutorial project, if necessary).

Click on the Mailbox tab if necessary,

Click on the Synchronize button.

If there are more scripts in the mailbox, repeat the following steps.

In the Mailbox area, click on the Synchronize button. You'll be transferred to the Synch Area ,

Click the Accept Synch button.

Update the Project Occasionally

When you get a notification from us, download the appropriate script(s), copy them into your local inbox and perform the synchronization. If you're not using Code Co-op for anything else, you may remove the Dispatcher from your Startup group.

If you purchase a license, or already have one…

Code Co-op will ask you if you want to change your status in the Tutorial project to that of a "voting member." The answer is no . Code Co-op will then send a license update script to us, but we'll disregard it.

Defecting from the Tutorial Project

If you're no longer interested in updates to our tutorials, select Defect from the Project menu. A defect script will be sent to us. If you don't have automatic emailing, just delete the script and send a note to tutorial@relisoft.comwith Defect in the subject line. We'll remove you from our subscription list.

Примечания

1

It really cracked me up when I read the introduction to the chapter on Aggregation in the otherwise fine (although somehow dorky) book "Inside COM" by Dale Rogerson. If he knew the real story, he wouldn't be so adamant in his defense of aggregation.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Windows API Tutorials»

Представляем Вашему вниманию похожие книги на «Windows API Tutorials» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Windows API Tutorials»

Обсуждение, отзывы о книге «Windows API Tutorials» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x