Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / sys / d3dvideosink / directx / directx9 / dx9_d3d.h
1 /* GStreamer
2  * Copyright (C) 2011 David Hoyt <dhoyt@hoytsoft.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __DIRECTX_DIRECTX9_DX9_D3D_H__
21 #define __DIRECTX_DIRECTX9_DX9_D3D_H__
22
23 #include <windows.h>
24
25 #include "../d3d.h"
26
27 #define DX9_D3D_API_CALL_FUNC(api, func_name, ...)              (DIRECTX_CALL_COMPONENT_SYMBOL(DIRECTX_D3D(api), D3D9DispatchTable, func_name, __VA_ARGS__))
28 #define DX9_D3D_COMPONENT_CALL_FUNC(component, func_name, ...)  (DIRECTX_CALL_COMPONENT_SYMBOL(component, D3D9DispatchTable, func_name, __VA_ARGS__))
29
30 /* Structs */
31 typedef struct _D3D9 D3D9;
32 typedef struct _D3D9DispatchTable D3D9DispatchTable;
33
34 /* Functions */
35 typedef gpointer /* IDirect3D9* */ (WINAPI *LPDIRECT3DCREATE9) (UINT);
36
37 struct _D3D9DispatchTable 
38 {
39   LPDIRECT3DCREATE9 Direct3DCreate9;
40 };
41
42 /* Global data */
43 struct _D3D9 
44 {
45   D3D9DispatchTable vtable;
46 };
47
48 /* Global vars */
49 static D3D9 dx9_d3d;
50
51 /* Function declarations */
52
53 void dx9_d3d_init(DirectXAPIComponent* component, gpointer data);
54 DirectXD3D* dx9_d3d_create(const DirectXAPI* api);
55 gboolean dx9_d3d_resize(const DirectXD3D* d3d);
56 gboolean dx9_d3d_device_lost(const DirectXD3D* d3d);
57 gboolean dx9_d3d_notify_device_reset(const DirectXD3D* d3d);
58 gboolean dx9_d3d_release(const DirectXD3D* d3d);
59
60 DIRECTX_D3D_API(
61   DIRECTX_9, 
62   dx9_d3d.vtable, 
63   dx9_d3d_init, 
64   dx9_d3d_create, 
65   dx9_d3d_resize, 
66   dx9_d3d_device_lost, 
67   dx9_d3d_notify_device_reset, 
68   dx9_d3d_release
69 )
70
71 #endif /* __DIRECTX_DIRECTX9_DX9_D3D_H__ */