Verwijderd schreef op donderdag 25 juni 2009 @ 19:39:
Ja, ik heb wel dingen op het scherm gekregen, met GDI, maar ging vrij traag.. En verder directX voorbeeld programmaatjes gedraaid. Ook wel bronnen gelezen over directdraw, maar wat nou de meest gebruikelijke en snelle methode is voor windows mobile 6/6.5 en 7 is me nog niet geheel duidelijk.
DirectDraw is over het algemeen iig een stuk sneller dan GDI en ook DirectX in gewoon 2D lijkt me een stuk sneller maar ik heb helaas geen data over telefoons.
Maar met wat snel zoeken vond ik wel dit op MSDN (gaat over windows mobile 5 maar denk ik net zo toepasselijk)
History of Windows Mobile Game Development
Prior to the addition of Direct3D and DirectDraw to Windows Mobile 5.0, developers used the Game API (GAPI) or Graphical Device Interface (GDI). GAPI has been deprecated and the use of Direct3D and DirectDraw are now encouraged. This change is appropriate because Direct3D and DirectDraw provide all of the graphical abilities that GAPI provides in addition to many more. Developers still use GDI as necessary because it provides support for many two-dimensional drawing functions. The following section discusses the abilities of each of these APIs.
A Comparison of GAPI, GDI, DirectDraw, and Direct3D Mobile
The following APIs have different strengths and weaknesses for graphics in game development. The following sections discuss the features that are natively included in each of the APIs.
GAPI
GAPI provides the most basic graphics features. It gives you direct, exclusive access to the video frame buffer in most cases. In some cases, instead of providing direct access to the actual frame buffer, it returns a pointer to a shadow surface. This shadow surface allows older games that do not provide support for the capability bits to run on newer devices that use different display layouts. In either case, GAPI provides no basic two-dimensional or three-dimensional drawing abilities. GAPI and GDI do not always work well together. To guarantee the desired results, you must implement all drawing, or perform two-dimensional drawing to an off-screen device context by using GDI, and then copy the result to the frame buffer that GAPI provides.
GDI
GDI provides you with the ability to create general graphical output to be displayed onscreen. GDI functions allow you to draw lines, curves, closed figures, text, and bitmap images, which can all be applied to games. GDI greatly makes use of Windows messages for determining when and what the application needs to redraw onscreen. You need to implement any three-dimensional drawing that uses GDI in the software. GDI does not provide direct access to the frame buffer, so page flipping and back buffer drawing are somewhat irrelevant to exclusive GDI development.
DirectDraw
DirectDraw provides support for hardware-accelerated two-dimensional graphics manipulation. It retains compatibility with GDI, so you can continue to use GDI to perform any drawing that GDI supports. DirectDraw supports blitting, page flipping on supported devices, back buffers, overlays, and some alpha blending. DirectDraw allows windowed or full-screen access in addition to exclusive access mode to the video frame buffer. You need to implement any three-dimensional drawing that is to be used in DirectDraw in the software. The DirectDraw implementation in Windows Mobile 5.0 is based on the IDirectDraw4 interface on the desktop computer, and the header files are based on the header files from DirectX 6. You should check any features that are defined in the device capability bits prior to using them in DirectDraw. For example, page flipping may or may not be supported on some devices, but you can obtain that information by querying the device capabilities.
Direct3D Mobile
Direct3D Mobile provides hardware-accelerated three-dimensional graphics manipulation independent of the device. It contains support for back buffers, page flipping, and blitting. Direct3D Mobile allows windowed and full-screen access, and it does not allow direct access to the frame buffer. Drawing typically occurs to the back buffer, so the lack of direct access to the frame buffer is not a problem. Direct3D Mobile is compatible with GDI—provided that the driver allows the surface to be locked. The device capability bits indicate if the driver allows this feature. You should check the device capability bits before using any driver optional features in Direct3D Mobile.
Direct3D Mobile also provides support for three-dimensional features such as rendering polygons, shading, texturing, transformations, clipping, and lighting. Figure 1 shows a screenshot from the Direct3D Mobile sample application (which is included in this article's download code sample) that demonstrates many of these features. Direct3D Mobile compares most closely to the Direct3D 8 implementation from the Windows desktop computer, but it also contains some elements of Direct3D 9.
Af gaande op dit stukje zou ik voor DirectDraw gaan voor een 2D winmobile game.