milsko/include/Mw/Widget/Direct3D9.h

56 lines
1.1 KiB
C
Raw Normal View History

2026-09-17 20:58:41 -07:00
/*!
* @file Mw/Widget/DirectX.h
* @brief DirectX widget.
* @warning Only avaliable on Windows.
*/
2026-09-18 16:43:15 +09:00
#ifndef __MW_WIDGET_DIRECT3D9_H__
#define __MW_WIDGET_DIRECT3D9_H__
2026-09-17 20:58:41 -07:00
#include <Mw/Core.h>
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
2026-09-18 16:43:15 +09:00
#if !defined(MW_DIRECT3D9_NO_INCLUDE)
2026-09-17 20:58:41 -07:00
/* https://github.com/microsoft/Windows-classic-samples/issues/317 */
#if defined(__MINGW32__) || defined(__MINGW64__)
2026-09-18 16:43:15 +09:00
#undef NTDDI_VERSION
#undef _WIN32_WINNT
2026-09-17 20:58:41 -07:00
#define NTDDI_VERSION 0x07000000
#define _WIN32_WINNT 0x0A00
#endif
2026-09-17 21:44:55 -07:00
#ifndef _WIN32
#error D3D9 widget only avaliable for Win32 backends
2026-09-18 16:43:15 +09:00
#undef MW_DIRECT3D9
2026-09-17 21:44:55 -07:00
#else
2026-09-17 20:58:41 -07:00
#include <d3d9.h>
#endif
2026-09-17 21:44:55 -07:00
#endif
2026-09-17 20:58:41 -07:00
/*!
* @brief D3D9 widget class
*/
2026-09-18 16:43:15 +09:00
MWDECL MwClass MwDirect3D9Class;
2026-09-17 20:58:41 -07:00
#ifdef __cplusplus
extern "C" {
#endif
2026-09-18 16:47:13 +09:00
MwInline LPDIRECT3D9 MwDirect3D9GetDirect3D9(MwWidget handle) {
2026-09-17 20:58:41 -07:00
LPDIRECT3D9 out = NULL;
2026-09-18 16:47:13 +09:00
MwVaWidgetExecute(handle, "mwDirect3D9GetDirect3D9", &out, NULL);
2026-09-17 20:58:41 -07:00
return out;
};
2026-09-18 16:47:13 +09:00
MwInline LPDIRECT3DDEVICE9 MwDirect3D9GetDirect3DDevice9(MwWidget handle) {
2026-09-17 20:58:41 -07:00
LPDIRECT3DDEVICE9 out = NULL;
2026-09-18 16:47:13 +09:00
MwVaWidgetExecute(handle, "mwDirect3D9GetDirect3DDevice9", &out);
2026-09-17 20:58:41 -07:00
return out;
};
#ifdef __cplusplus
}
#endif
#endif