windows mobile 6 遊戲開發入門

Download Windows Mobile 6 遊戲開發入門

Post on 11-Nov-2014

3.599 views

Category:

Documents

4 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

  • 1. Windows Mobile 6 MCPD/MCT/MVP
  • 2. Windows Mobile Windows Mobile Windows Mobile GAPI, GAPINET, GAPIDraw, GAPIDrawNET DirectX, DirectX Mobile, Managed DirectX DirectX Mobile Windows Mobile DirectX
  • 3. Windows Mobile Microsoft Visual Studio Native Managed Server side MFC ATL .NET Compact ASP .NET Win32 Framework Mobile Controls Software Platform (APIs) Device Management Communication Presentation Data Access Multimedia Remote API Connection Manager Home Screen SQL CE GAPI Configuration* TAPI* User Interface/Shell ADO CE Camera Bluetooth SMS* HTML Control XML D3DM Security MAPI* DOM CE DB Location* Notif Broker* POOM* OLE DB Pocket Watson ActiveSync* Windows Mobile Windows CE CE DB Pocket Outlook ActiveSync Pocket Internet Explorer SQL CE Windows Media Player Drivers Device Processor Display Radio GSM/GPRS WiFi Hardware Memory USB or Serial CDMA/1xRTT Bluetooth * = Managed wrappers
  • 4. Windows Mobile
  • 5. Windows Mobile GDI/GDI+ , Bitmap, MakeTransparentSetResolution , Image RotateFlip GAPI/GAPINet GAPIDraw/GAPIDrawNet Pocket PC 2003Windows Mobile 5.0 DirectX/Managed DirectX/DirectX Mobile Direct3D
  • 6. GAPI/GAPINET, GAPIDraw/GAPIDrawNET GAPI Game API, (8KB) GAPINET GAPIC.NET , C#VB.NET
  • 7. GAPI/GAPINET, GAPIDraw/GAPIDrawNET() GAPIDraw Windows Mobile, , C++ GAPIDrawNET GAPIDraw .NET
  • 8. GAPIDraw GapiDrawDirectX DirectDraw, DirectDraw , blit, , , , , , , .NET(VB.NETC#) (Open Source)
  • 9. GAPI GXBeginDraw DCHandle(HDC) GXCloseDisplay GAPI GXCloseInput GAPI GXEndDraw GXBeginDraw GXEndDraw GXGetDefaultKeys GXGetDisplayProperties GXDisplayProperties
  • 10. GAPI() GXIsDisplayDRAMBuffer GXOpenDisplay GXOpenInput , , Windows CEShell, GAPI GXResume GXSuspendGAPI WM_SETFOCUS GXSetViewport GAPI(View Port) GXSuspend , WM_KILLFOCUS
  • 11. GAPI
  • 12. DirectX Microsoft Windows, , , : Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, DirectInput Managed DirectX (MDX) Visual Basic .NETC# DirectX Managed DirectX: 1.1, 2.0, XNA DirectX Mobile Windows MobileDirectX
  • 13. DirectX 1992Servan Keondjian RenderMorphics, 3D , Reality Lab Microsoft1995RenderMorphics , Windows 953D, DirectX DirectXWindows Vista DirectX 10.0 DirectX 11.0
  • 14. DirectX Direct3D 3D, DirectDraw 2D, DirectInput , , , , , , DirectSound WAV, . DirectMusic
  • 15. DirectX () DirectMusic DirectSound. , 3D, , MIDI, WAV , DirectMusic Producer DirectPlay , GPRS, Bluetooth, Wi-Fi DirectShow /, TV DirectSetup DirectX
  • 16. DirectX For Windows Mobile Direct3D Mobile Windows MobileDirect3D Microsoft Windows Mobile 5.0 DirectDraw Platform Invocation DirectInput Windows Mobile 5.0/6.0 DirectInput, GAPI, DirectSound Waveform Audio API
  • 17. Direct3D Mobile Direct3D Mobile DirectX 9, DirectX 8 3D 3D / , IEEE 32-bit 16.16 Fixed Point,
  • 18. Windows MobileDirectDraw DirectDraw 2 Platform Invocation ,
  • 19. DirectX Mobile DirectX DirectX Mobile
  • 20. DirectX Device:, DirectDraw Device, Direct3D Device, DirectSound Device, Caps:Direct3D Device PresentParameters :Direct3D Device Surface:, Video SurfaceDescription:Surface SurfaceCaps:Surface
  • 21. DirectX() Buffer: DirectSound:Buffer, SecondaryBuffer Direct3D:VertexBuffer, IndexBuffer ColorKey: Pool:Direct3DVertexBuffer VideoMemory: SystemMemory: Managed:,
  • 22. Vertex BufferIndex Buffer Vertex Buffer Index Buffer
  • 23. DirectX Mobile Microsoft.WindowsMobile.DirectX.dll DirectX(Device) Device Device Vertex Buffer
  • 24. DirectX(Device) C# //Direct3D Mobile device PresentParameters sPresentParameters = new PresentParameters(); sPresentParameters.Windowed = true; sPresentParameters.SwapEffect = SwapEffect.Discard; sPresentParameters.BackBufferFormat = Format.Unknown; sPresentParameters.EnableAutoDepthStencil = true; sPresentParameters.AutoDepthStencilFormat = DepthFormat.D16; //Direct3D Mobile device m_oDevice = new Device(0, DeviceType.Default, this, CreateFlags.None, sPresentParameters);
  • 25. DirectX(Device) VB Direct3D Mobile device Dim sPresentParameters As PresentParameters = New _ PresentParameters() sPresentParameters.Windowed = True sPresentParameters.SwapEffect = SwapEffect.Discard sPresentParameters.BackBufferFormat = Format.Unknown sPresentParameters.EnableAutoDepthStencil = True sPresentParameters.AutoDepthStencilFormat = _ DepthFormat.D16 'Direct3D Mobile device m_oDevice = New Device(0, DeviceType.Default, Me, _ CreateFlags.None, sPresentParameters)
  • 26. Device //Device Caps m_sDeviceCaps = m_oDevice.DeviceCaps; //Device floating point values if (m_sDeviceCaps.DeviceCaps.NativeFloat) { Trace.WriteLine("Device Supports Floating Point Values"); } //Devicedirectional lights if (m_sDeviceCaps.VertexProcessingCaps.SupportsDirectionalLights) { Trace.WriteLine("Device Supports Directional Lights"); }
  • 27. Vertex Buffer //Vertex Buffer m_oVB = new VertexBuffer( typeof(CustomVertex.PositionNormal), 100, m_oDevice, 0, CustomVertex.PositionNormal.Format, eD3DMPool); //VerTex Buffer PopulateVertexBuffer(m_oVB);
  • 28. VerTex Buffer m_oDevice.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Bisque, 1.0F, 0); m_oDevice.BeginScene(); SetupMatrices(); SetupLights(); SetupMaterials(); m_oDevice.SetStreamSource(0, m_oVB, 0); m_oDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 98); m_oDevice.EndScene(); m_oDevice.Present();
  • 29. // if (SystemSettings.ScreenOrientation != ScreenOrientation.Angle0) { // // ... }
  • 30. : GAPI Mou