4403c22ba0da7107059ab5375a4782aa75ca6860
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Win32 / sdk_demo / Sources / UI / directx_rendering.h
1 /********************************************************************
2  *
3  *  Parts of the DirectX code are from a tutorial by Microsoft
4  *      which can be found in the Microsoft DirectX SDK June 2010.
5  *  Copyright (c) Microsoft Corporation. All rights reserved.
6  *
7  *  
8  *  The rest of the code is COPYRIGHT PARROT 2010
9  *
10  ********************************************************************
11  *       PARROT - A.R.Drone SDK Windows Client Example
12  *-----------------------------------------------------------------*/
13 /**
14  * @file directx_rendering.h 
15  * @brief Header file for the DirectX rendering of the drone video stream.
16  *
17  * @author Stephane Piskorski <stephane.piskorski.ext@parrot.fr>
18  * @date   Sept, 8. 2010
19  *
20  *******************************************************************/
21
22 \r
23 \r
24 //-----------------------------------------------------------------------------\r
25 // Display manager for the Win32 SDK Demo application\r
26 // Based on the Microsoft DirectX SDK tutorials\r
27 //-----------------------------------------------------------------------------\r
28 \r
29 \r
30 #include <Windows.h>\r
31 #include <mmsystem.h>\r
32 #include <d3dx9.h>\r
33 #pragma warning( disable : 4996 ) // disable deprecated warning \r
34 #include <strsafe.h>\r
35 #pragma warning( default : 4996 )\r
36 \r
37 #include <win32_custom.h>\r
38 \r
39 struct CUSTOMVERTEX\r
40 {\r
41     D3DXVECTOR3 position; // The position\r
42     D3DCOLOR color;    // The color\r
43     FLOAT tu, tv;   // The texture coordinates\r
44 };\r
45 \r
46 // Our custom FVF, which describes our custom vertex structure\r
47 #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)\r
48 \r
49 \r
50 \r
51 //-----------------------------------------------------------------------------\r
52 // Name: InitD3D()\r
53 // Desc: Initializes Direct3D\r
54 //-----------------------------------------------------------------------------\r
55 HRESULT InitD3D( HWND hWnd );\r
56 //-----------------------------------------------------------------------------\r
57 // Name: InitGeometry()\r
58 // Desc: Create the textures and vertex buffers\r
59 //-----------------------------------------------------------------------------\r
60 HRESULT InitGeometry();\r
61 \r
62 //-----------------------------------------------------------------------------\r
63 // Name: D3DChangeTexture()\r
64 // Desc: Loads the texture from an external RGB buffer\r
65 //-----------------------------------------------------------------------------\r
66 #ifdef __cplusplus\r
67 extern "C" {\r
68 #endif\r
69         void D3DChangeTexture(unsigned char* rgbtexture);\r
70         void D3DChangeTextureSize(int w,int h);\r
71 #ifdef __cplusplus\r
72 }\r
73 #endif\r
74 \r
75 //-----------------------------------------------------------------------------\r
76 // Name: Cleanup()\r
77 // Desc: Releases all previously initialized objects\r
78 //-----------------------------------------------------------------------------\r
79 VOID Cleanup();\r
80 //-----------------------------------------------------------------------------\r
81 // Name: SetupMatrices()\r
82 // Desc: Sets up the world, view, and projection transform matrices.\r
83 //-----------------------------------------------------------------------------\r
84 VOID SetupMatrices();\r
85 //-----------------------------------------------------------------------------\r
86 // Name: Render()\r
87 // Desc: Draws the scene\r
88 //-----------------------------------------------------------------------------\r
89 VOID Render();\r
90 //-----------------------------------------------------------------------------\r
91 // Name: MsgProc()\r
92 // Desc: The window's message handler\r
93 //-----------------------------------------------------------------------------\r
94 LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );\r
95 //-----------------------------------------------------------------------------\r
96
97 #ifdef __cplusplus\r
98 extern "C" {\r
99 #endif
100         #include <VP_Api/vp_api_thread_helper.h>
101         PROTO_THREAD_ROUTINE(directx_renderer_thread, data);
102 #ifdef __cplusplus\r
103 }\r
104 #endif