Programming Microsoft Windows Ce Net 3Rd [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Programming Microsoft Windows Ce Net 3Rd [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Drawing to the Screen

Of course, the meat of GAPI is the ability it provides an application to write to the display buffer. To gain access to the buffer, a GAPI application calls

void * GXBeginDraw();

This function returns the address of the frame buffer, or 0 if the buffer cannot be accessed for some reason. At this point, a GAPI application has free rein to modify the frame buffer using the pixel computations described in the previous section.

The pointer returned isn't necessarily the lowest address of the frame buffer. Some systems are configured with negative offsets in the cbxPitch or cbyPitch values. This really isn't important as long as you rigorously use the pitch values to compute pixel addresses in the frame buffer.





Note

One word of caution: although having a pointer to the frame buffer is powerful, it's also dangerous. The pointer directly accesses an area of system memory that itself directly accesses the physical address space of the hardware. Errant pointers can, and most likely will, be destructive to data on your device. A classic symptom is the file system reporting corrupt data in the object store. This can easily happen if incorrect pointer arithmetic results in writing of the physical RAM that contains the object store. Programmers should be exceedingly careful when checking that they access only the frame buffer and not other parts of the system address space.


When the drawing to the frame buffer is complete, call the following function:

int GXEndDraw();

This call does little on systems with direct access to the frame buffer. However, on systems that don't provide direct access to the frame buffer, calling GXEndDraw signals the display driver to copy the data from the phantom frame buffer to the actual frame buffer. Regardless of whether the application has direct access to the frame buffer, all GAPI applications should call GXEndDraw, if only for forward compatibility.

/ 169