1 /********************************************************************
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.
8 * The rest of the code is COPYRIGHT PARROT 2010
10 ********************************************************************
11 * PARROT - A.R.Drone SDK Windows Client Example
12 *-----------------------------------------------------------------*/
14 * @file directx_rendering.h
15 * @brief Header file for the DirectX rendering of the drone video stream.
17 * @author Stephane Piskorski <stephane.piskorski.ext@parrot.fr>
20 *******************************************************************/
24 //-----------------------------------------------------------------------------
\r
25 // Display manager for the Win32 SDK Demo application
\r
26 // Based on the Microsoft DirectX SDK tutorials
\r
27 //-----------------------------------------------------------------------------
\r
30 #include <Windows.h>
\r
31 #include <mmsystem.h>
\r
33 #pragma warning( disable : 4996 ) // disable deprecated warning
\r
34 #include <strsafe.h>
\r
35 #pragma warning( default : 4996 )
\r
37 #include <win32_custom.h>
\r
41 D3DXVECTOR3 position; // The position
\r
42 D3DCOLOR color; // The color
\r
43 FLOAT tu, tv; // The texture coordinates
\r
46 // Our custom FVF, which describes our custom vertex structure
\r
47 #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
\r
51 //-----------------------------------------------------------------------------
\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
62 //-----------------------------------------------------------------------------
\r
63 // Name: D3DChangeTexture()
\r
64 // Desc: Loads the texture from an external RGB buffer
\r
65 //-----------------------------------------------------------------------------
\r
69 void D3DChangeTexture(unsigned char* rgbtexture);
\r
70 void D3DChangeTextureSize(int w,int h);
\r
75 //-----------------------------------------------------------------------------
\r
77 // Desc: Releases all previously initialized objects
\r
78 //-----------------------------------------------------------------------------
\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
87 // Desc: Draws the scene
\r
88 //-----------------------------------------------------------------------------
\r
90 //-----------------------------------------------------------------------------
\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
100 #include <VP_Api/vp_api_thread_helper.h>
101 PROTO_THREAD_ROUTINE(directx_renderer_thread, data);