Windows Mobile 6 Application Track Windows Mobile 6
{ Windows Mobile 6 Application Track Windows Mobile 6 에서의 Direct. X 그래픽 및 게임 개발 고재관 myaustin@korea. com Microsoft Mobile Devices MVP http: //www. PDAlab. org
시작하기 전에 • 주로 다루는 기술 • • Direct. Show Interface for Player Direct. Show Interface for Camera Direct. Show Filter (Render Filter) Direct. Draw Interface • 선물증정 • Quiz/ Q&A/ 느닷없이… • 블루투스 헤드셋/ MS티셔츠/ MS가방/ USB 2. 0 허브/ Windows Mobile Resource DVD & 기념품/ USB 메모리/ 교육만화타이틀 Set/ …
주요내용 // • 모바일 컨텐츠 • Microsoft Visual Studio 2005 & Microsoft Windows Mobile 6 SDK • Direct Show & Filter • Direct Draw • 데모 및 프로그램 코드 실행 • 질문
디바이스 형태 // Professional • 터치스크린 • 큰 해상도 QVGA(240 x 320) VGA(480 x 640) Square(320 x 320) • 화면회전 • 고성능 프로세서 Standard • 키입력 • 일반 해상도 QCIF(176 x 220) QVGA(240 x 320) … • 화면회전 • 비교적 낮은 프로세서 휴대폰 연결형. NET CF 2. 0, SQL Compact Edition 기본 탑재 Direct. Show & Direct. Draw Portable code
Smart Device Project // DEMO
Direct. X // • Wind. G/Wave. Mix 실패 • Game SDK • 구성 • • • Direct. Input Direct. Draw Direct 3 D Direct. Play Direct. Sound Direct 3 DSound Direct. Music Direct. Show Direct. Animation Direct. Setup Media Layer Direct. Show Direct. Play Direct Animation Direct 3 D Retained Mode Foundation Layer Direct. Draw Direct. Sound Direct. Input Direct 3 D Imediate
Direct. X 구조 // • COM 인터페이스 • • • Dll. Register. Server : 레지스트리에 등록 Dll. Unregister. Server : 레지스트리에 해제 Dll. Get. Class. Object : 호출시 연결 Dll. Can. Unload. Now : 호출해제 및 연결해제 IUnknown Template Base HKEY_CLASSES_ROOTCLSID{CLSID} • Query. Interface • 형태를 알 수 없는 COM으로 부터 객체를 추출 • UUID형태로 사용 (레지스트리에 등록됨)
Direct. Show 응용 프로그램 // • 플레이어 • MP 3 플레이어 • 동영상 플레이어 • 유틸리티 • • Video Editing Application AVI to ASF Convert. DVD Players Video Editing Application AVI to ASF Converts • 카메라 • 디지털 사진 촬영 • 디지털 동영상 촬영
Direct. Show 확장 인터페이스 // • IAMDev. Memory. Allocator • IAMDev. Memory. Control • IAMMedia. Content. Ex • IAMovie. Setup • IAMPlay. List. Item • IAMStream. Control • IAMStream. Select • IAsync. Reader • IBase. Filter • IDirect. Draw. Video • IDistributor. Notify • IDMOWrapper. Filter • IEnum. Filters • IEnum. Media. Types • IEnum. Pins • IEnum. Reg. Filters • IFile. Source. Filter • IFilter. Graph 2 • IFilter. Mapper 2 • IGraph. Version • IMedia. Event. Sink • IMedia. Filter • IMedia. Position • IMedia. Sample 2 • IMedia. Stream • IMem. Allocator • IMem. Input. Pin • IMulti. Media. Stream • INon. Delegating. Unknown • IOverlay. Notify • IPin • IQuality. Control • IQual. Prop • IReference. Clock • ISeeking. Pass. Thru • IStream. Sample • IVPBase. Config • IVPBase. Notify • IVPConfig • IVPNotify
Direct. Show 실행과정 // Source Filter (소스필터) File URL H/W IN 추출 OUT Render Filter (랜더필터) Transform Filter (변환필터) IN 분배 Video IN 해석 OUT IN 비디오 IN 해석 OUT IN 오디오 Audio Ex) File Camcorder 카메라모듈 Streaming … Ex) 영상조절 영상/음향효과 … Ex) 화면출력 동영상저장 정지화상저장 …
Direct. Show 구조 // Application Command Event Direct. Show Filter Graph Manager Source Filter Transform Filter File System Legacy VCM/ACM Codec Render Filter Direct. Sound Direct. Draw Sound Card Video Card Kernal Streaming Legacy VFW WDM Capture Device MPEG 2 Decoder File System
Direct. Show Filter 제작 // • Base Class • %WINCEROOT%PUBLICDIRECTXSDKSAMPLESDSHOWB ASECLASSES • Base. Class. lib로 생성 • 프로젝트 생성 • • • COM프로젝트로 생성 COM 공용함수 (Dll. Register. Server, Dll. Unregister. Server) COM 인터페이스 정보 CLSID Base Class 기반의 User Class 생성 사용가 필요한 처리 작업 추가
Direct. Show • • CBase. Reference. Clock • CBase. Renderer • CBase. Stream. Control • CBase. Video. Renderer • CBase. Window • CBasic. Audio • CCrit. Sec • CDisp. Basic • CEnum. Media. Types • CEnum. Pins • CFactory. Template • CGeneric. List • CGuid. Name. List • CLoad. Direct. Draw • CMedia. Control • • CMedia. Sample • CMedia. Event CMedia. Position • CMedia. Type • Base Class // • • • • • CAgg. Direct. Draw CAgg. Draw. Surface CAMEvent CAMMsg. Event CAMSchedule CAMThread CAuto. Lock CBase. Allocator CBase. Basic. Video CBase. Control. Video CBase. Dispatch CBase. Filter CBase. Input. Pin CBase. List CBase. Media. Filter CBase. Object CBase. Output. Pin CBase. Pin • • • • • CMem. Allocator CMsg. Thread COARef. Time COutput. Queue CPos. Pass. Thru CPull. Pin CQueue CRef. Time CRenderer. Input. Pin CRenderer. Pos. Pass. Thru CSource. Position CSource. Seeking CSource. Stream CSystem. Clock CTransform. Filter CTransform. Input. Pin CTransform. Output. Pin CTrans. In. Place. Filter CTrans. In. Place. Input. Pin CTrans. In. Place. Output. Pin CUnknown CVideo. Transform. Filter FOURCCMap
Direct. Show Base Filter // • Source Filter • CSource Class • Transform Filter • CTransform. Filter Class • Render Filter • CBase. Renderer Class
Direct. Show Interface 구성 Class // • IBasic. Audio • CBasic. Audio • IBasic. Video • CBase. Basic. Video , CBase. Control. Video • IMedia. Seeking • CPos. Pass. Thru, CSource. Seeking • IMedia. Control • CMedia. Control • IMedia. Event • CMedia. Event • IVideo. Window • CBase. Control. Window, CBase. Video. Window. &…
Direct. Show 중점사항 // • Add Filter • 호출되는 필터의 교섭과정 확인 필요 • 교섭메소드주의 • Check. Input. Type • Check. Media. Type • Pin특성 파악 • Transform Filter Pin간 연결 확인, Render Filter Pin 사용 • Query. Interface를 통해 필요한 Template 호출 • IBase. Filter 기반 • IBase. Filter를 통해 User Filter 접근
Direct. Show & Filter // DEMO
Direct. Draw CE 그래픽 아키텍쳐 // GAPI GDI Direct. Draw Direct 3 D Mobile D 3 DM Device Driver Interface Layer (DDI) Display Adapter Hardware
Direct. Draw 아키텍쳐 // Windows Mobile 응용프로그램 Direct. Draw Graphics Device Interface (GDI) Device Driver Interface (DDI) Hardware Emulation Layer (HEL) Hardware Abstraction Layer (HAL) Display Adapter Hardware
Direct. Draw Flipping & Blitting // Primary Surface Flipping Back Buffer Blitting Off Screen 1 배경 1 이미지 Off Screen 2 배경 2 이미지 Off Screen 3 캐릭터 1 이미지 Off Screen 4 캐릭터 2이미지 or Off Screen All 단일 화면 처리
Direct. Draw 초기화 // #include <ddraw. h> #define TIMER_ID #define TIMER_RATE 1 500 IDirect. Draw * g_p. DD = NULL; IDirect. Draw. Surface * g_p. DDSPrimary= NULL; IDirect. Draw. Surface * g_p. DDSBack = NULL; DDSURFACEDESC ddsd; // Direct. Draw 오브젝트 생성 Direct. Draw. Create(NULL, &g_p. DD, NULL); // 실행 모드 지정 p. DD->Set. Cooperative. Level( h. Wnd, DDSCL_FULLSCREEN);
Direct. Draw 초기화 // <이어서> // Primary surface 와 Back buffer 1개 설정 ddsd. dw. Size = sizeof(ddsd); ddsd. dw. Flags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd. dds. Caps. dw. Caps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP; ddsd. dw. Back. Buffer. Count = 1; g_p. DD->Create. Surface(&ddsd, &g_p. DDSPrimary, NULL); // Back buffer 지정 g_p. DDSPrimary->Enum. Attached. Surfaces( &g_p. DDSBack, Enum. Function); // Timer 설정 (Filp test) Set. Timer(h. Wnd, TIMER_ID, TIMER_RATE, NULL);
Direct. Draw 사용 // // Back buffer Clear DDBLTFX ddbltfx; memset(&ddbltfx, 0, sizeof(ddbltfx)); ddbltfx. dw. Size = sizeof(ddbltfx); ddbltfx. dw. Fill. Color = RGB(0, 255); // Color g_p. DDSBack->Blt( NULL, DDBLT_COLORFILL | DDBLT_WAITNOTBUSY, &ddbltfx); // Back buffer DC핸들 얻기 HDC hdc; g_p. DDSBack->Get. DC(&hdc) ; . . . // Timer 동작등에 맞추어 수정. . .
Direct. Draw // DEMO
장치를 위한 새로운 기능 지금 시작 하십시요! // • Visual Studio “Orcas” Beta 1 설치 및 구성 • . NET Compact Framework v 3. 5 Beta 1 • . NET Compact Framework v 2 SP 2 • Visual Studio 2005 SP 2 다운로드 및 사용 http: //www. microsoft. com/downloads/details. aspx? Family. ID=ae a 55 f 2 f-07 b 5 -4 a 8 c-8 a 44 -b 4 e 1 b 196 d 5 c 0&displaylang=en • 세션PPT 및 예제 • www. PDAlab. org 자료실 (지금 다운로드 가능) • Microsoft 공식 웹사이트
참고 // • 무료교육 • Windows CE 프로그래밍 기초 • 20시간 http: //www. educ. or. kr/edu/guide_02_view. php? item_id=5 • Windows CE Application Programming Study • 참가문의 : 고재관 • Thanks to : 경품지원 • Axxen UNM 황성규대표 • Microsoft MVP Program Leader 오세영부장
- Slides: 46