Snelle 2d graphics in windows mobile 6 en hoger

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Hallo, ik ben een beetje aan het klooien met programmeren voor android, iphone en windows mobile, ivm een nieuwe telefoon binnenkort :)

Nu vroeg ik me af wat de meest gebruikelijke en handige manier is om snelle 2d graphics in windows mobile 6 / 6.5 en aankomende versie 7 te realiseren.

Kan dat het beste in directx/direct3d door alleen 2 dimensies te gebruiken, of bestaat er een aparte manier voor snelle 2d graphics? Directdraw bijv. of is dat verouderd?

Ik begreep dat lockbits opzich wel snel werken via bitmap, maar iemand verder nog een idee?

[ Voor 8% gewijzigd door Verwijderd op 25-06-2009 02:23 ]


Acties:
  • 0 Henk 'm!

  • Woy
  • Registratie: April 2000
  • Niet online

Woy

Moderator Devschuur®
Wat heb je zelf al geprobeerd? Heb je al een proef projectje gemaakt met verschillende technieken en dat gemeten?

Of heb je bronnen gevonden waarin het een en ander beweert word?

Het zou voor de discussie wel leuk zijn als je dus iets meer informatie geeft, want op deze manier is het gewoon een vraag dumpen.

“Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.”


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
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.

Acties:
  • 0 Henk 'm!

  • roy-t
  • Registratie: Oktober 2004
  • Laatst online: 19-09 10:19
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.

~ Mijn prog blog!


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
Bedankt voor je reactie :)

Dat stukje had ik ook gelezen. Alleen gaat dat inderdaad over windows mobile 5 en is kennelijk ook te gebruiken in windows mobile 6, maar of dat ook geldt voor windows mobile 6.5 en 7...

Wat is eigenlijk gebruikelijk in normaal windows voor 2d graphics? Ik kom veel tegen: XNA, Allegro, directdraw en nog meer..

Acties:
  • 0 Henk 'm!

  • .oisyn
  • Registratie: September 2000
  • Laatst online: 03:42

.oisyn

Moderator Devschuur®

Demotivational Speaker

Als je puur sprite-based graphics gebruikt zou ik voor D3D gaan. De meeste telefoons zijn wel hardware accelerated op dat gebied, en dan is dat een stuk sneller en uitgebreider dan de basis blit functies die DirectDraw je biedt.

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


Acties:
  • 0 Henk 'm!

  • roy-t
  • Registratie: Oktober 2004
  • Laatst online: 19-09 10:19
Verwijderd schreef op vrijdag 26 juni 2009 @ 20:13:
Bedankt voor je reactie :)

Dat stukje had ik ook gelezen. Alleen gaat dat inderdaad over windows mobile 5 en is kennelijk ook te gebruiken in windows mobile 6, maar of dat ook geldt voor windows mobile 6.5 en 7...

Wat is eigenlijk gebruikelijk in normaal windows voor 2d graphics? Ik kom veel tegen: XNA, Allegro, directdraw en nog meer..
Nouja je kunt er uithalen dan directdraw door de hardware versneld wordt en dus een stuk sneller zal zijn :). Verder is XNA gewoon een managed wrapper om DirectX maar sowieso niet van toepassing omdat dit er nog niet is voor windows mobile (wel voor de Zune). GDI wordt vaak gebruikt om controls of 'even een grafiekje' te tekenen in mijn ervaring. Ik zou als ik jou was een testcase schrijven om te zien of DIrectDraw 'sneller genoeg' is voor je applicatie en n.a.v. je beslissing nemen maar ik denk wel dat DD de meest logische keus is omdat je dan nog dezelfde functies hebt als GDI (weinig aan te passen).

Edit:

Maar .Oisyn heeft waarschijnlijk gelijk dat Direct3DMobile nog sneller is/kan zijn.

[ Voor 7% gewijzigd door roy-t op 26-06-2009 21:51 ]

~ Mijn prog blog!

Pagina: 1