This commit is contained in:
parent
9a6a0e7393
commit
20c39b86f4
9 changed files with 62 additions and 22 deletions
8
configure
vendored
8
configure
vendored
|
|
@ -55,7 +55,8 @@ param_set("examples", 1);
|
||||||
param_set("allow-sloppy-focus", 0);
|
param_set("allow-sloppy-focus", 0);
|
||||||
|
|
||||||
# (option that only makes sense on Windows)
|
# (option that only makes sense on Windows)
|
||||||
param_set("directx", 0);
|
param_set("dxd8", 0);
|
||||||
|
param_set("dxd9", 0);
|
||||||
|
|
||||||
my %features = (
|
my %features = (
|
||||||
"classic-theme" => "use classic theme",
|
"classic-theme" => "use classic theme",
|
||||||
|
|
@ -73,7 +74,8 @@ my %features = (
|
||||||
"gnustep" => "use gnustep",
|
"gnustep" => "use gnustep",
|
||||||
"dbus" => "use DBus on supported platform",
|
"dbus" => "use DBus on supported platform",
|
||||||
"allow-sloppy-focus" => "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus",
|
"allow-sloppy-focus" => "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus",
|
||||||
"directx" => "(Windows only) build DirectX widget"
|
"directx8" => "(Windows only) build DXD8 widget",
|
||||||
|
"directx9" => "(Windows only) build DXD9 widget"
|
||||||
);
|
);
|
||||||
my @features_keys = (
|
my @features_keys = (
|
||||||
"1classic-theme", "1stb-image",
|
"1classic-theme", "1stb-image",
|
||||||
|
|
@ -82,7 +84,7 @@ my @features_keys = (
|
||||||
"1vulkan", "2vulkan-string-helper",
|
"1vulkan", "2vulkan-string-helper",
|
||||||
"1shared", "1static",
|
"1shared", "1static",
|
||||||
"1wayland", "1gnustep",
|
"1wayland", "1gnustep",
|
||||||
"1dbus", "1directx"
|
"1dbus", "1direct8", "1directx9"
|
||||||
);
|
);
|
||||||
|
|
||||||
sub def_platform {
|
sub def_platform {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
#include <Mw/Widget/D3D8.h>
|
#include <Mw/Widget/D3D8.h>
|
||||||
|
|
||||||
|
#ifdef MW_DIRECTX8
|
||||||
|
|
||||||
MwWidget window, d3d8;
|
MwWidget window, d3d8;
|
||||||
LPDIRECT3D8 d3d;
|
LPDIRECT3D8 d3d;
|
||||||
LPDIRECT3DDEVICE8 d3ddev;
|
LPDIRECT3DDEVICE8 d3ddev;
|
||||||
|
|
@ -89,3 +91,5 @@ int main() {
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
#include <Mw/Widget/D3D9.h>
|
#include <Mw/Widget/D3D9.h>
|
||||||
|
|
||||||
|
#ifdef MW_DIRECTX9
|
||||||
|
|
||||||
MwWidget window, d3d8;
|
MwWidget window, d3d8;
|
||||||
LPDIRECT3D9 d3d;
|
LPDIRECT3D9 d3d;
|
||||||
LPDIRECT3DDEVICE9 d3ddev;
|
LPDIRECT3DDEVICE9 d3ddev;
|
||||||
|
|
@ -91,3 +93,5 @@ int main() {
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#error D3D8 widget only avaliable for Win32 backends
|
#error D3D8 widget only avaliable for Win32 backends
|
||||||
|
#undef MW_DIRECTX8
|
||||||
#else
|
#else
|
||||||
#ifdef MW_DIRECTX8
|
#ifdef MW_DIRECTX8
|
||||||
#include <d3d8.h>
|
#include <d3d8.h>
|
||||||
|
|
@ -37,6 +38,7 @@ MWDECL MwClass MwD3D8Class;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MW_DIRECTX8
|
||||||
MwInline LPDIRECT3D8 MwDirectXGetD3D8(MwWidget handle) {
|
MwInline LPDIRECT3D8 MwDirectXGetD3D8(MwWidget handle) {
|
||||||
LPDIRECT3D8 out = NULL;
|
LPDIRECT3D8 out = NULL;
|
||||||
MwVaWidgetExecute(handle, "mwDirectXGetD3D8", &out, NULL);
|
MwVaWidgetExecute(handle, "mwDirectXGetD3D8", &out, NULL);
|
||||||
|
|
@ -47,6 +49,16 @@ MwInline LPDIRECT3DDEVICE8 MwDirectXGetD3Dev8(MwWidget handle) {
|
||||||
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev8", &out);
|
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev8", &out);
|
||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
MwInline void* MwDirectXGetD3D8(MwWidget handle) {
|
||||||
|
(void)handle;
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
MwInline void* MwDirectXGetD3Dev8(MwWidget handle) {
|
||||||
|
(void)handle;
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#error D3D9 widget only avaliable for Win32 backends
|
#error D3D9 widget only avaliable for Win32 backends
|
||||||
|
#undef MW_DIRECTX9
|
||||||
#else
|
#else
|
||||||
#ifdef MW_DIRECTX9
|
#ifdef MW_DIRECTX9
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
|
@ -36,6 +37,7 @@ MWDECL MwClass MwD3D9Class;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MW_DIRECTX9
|
||||||
MwInline LPDIRECT3D9 MwDirectXGetD3D9(MwWidget handle) {
|
MwInline LPDIRECT3D9 MwDirectXGetD3D9(MwWidget handle) {
|
||||||
LPDIRECT3D9 out = NULL;
|
LPDIRECT3D9 out = NULL;
|
||||||
MwVaWidgetExecute(handle, "mwDirectXGetD3D9", &out, NULL);
|
MwVaWidgetExecute(handle, "mwDirectXGetD3D9", &out, NULL);
|
||||||
|
|
@ -46,6 +48,16 @@ MwInline LPDIRECT3DDEVICE9 MwDirectXGetD3Dev9(MwWidget handle) {
|
||||||
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev9", &out);
|
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev9", &out);
|
||||||
return out;
|
return out;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
MwInline void* MwDirectXGetD3D9(MwWidget handle) {
|
||||||
|
(void)handle;
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
MwInline void* MwDirectXGetD3Dev9(MwWidget handle) {
|
||||||
|
(void)handle;
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
pl/rules.pl
18
pl/rules.pl
|
|
@ -178,7 +178,8 @@ new_object("src/widget/window.c");
|
||||||
|
|
||||||
new_object("src/widget/opengl.c");
|
new_object("src/widget/opengl.c");
|
||||||
new_object("src/widget/vulkan.c");
|
new_object("src/widget/vulkan.c");
|
||||||
new_object("src/widget/directx.c");
|
new_object("src/widget/d3d8.c");
|
||||||
|
new_object("src/widget/d3d9.c");
|
||||||
|
|
||||||
if (param_get("opengl")) {
|
if (param_get("opengl")) {
|
||||||
add_cflags("-DMW_OPENGL");
|
add_cflags("-DMW_OPENGL");
|
||||||
|
|
@ -186,8 +187,11 @@ if (param_get("opengl")) {
|
||||||
if (param_get("vulkan")) {
|
if (param_get("vulkan")) {
|
||||||
add_cflags("-DMW_VULKAN");
|
add_cflags("-DMW_VULKAN");
|
||||||
}
|
}
|
||||||
if (param_get("directx")) {
|
if (param_get("directx8")) {
|
||||||
add_cflags("-DMW_DIRECTX");
|
add_cflags("-DMW_DIRECTX8");
|
||||||
|
}
|
||||||
|
if (param_get("directx9")) {
|
||||||
|
add_cflags("-DMW_DIRECTX9");
|
||||||
}
|
}
|
||||||
|
|
||||||
new_object("src/dialog/*.c");
|
new_object("src/dialog/*.c");
|
||||||
|
|
@ -234,8 +238,12 @@ if (param_get("vulkan")) {
|
||||||
new_example("examples/vkdemos/vulkan");
|
new_example("examples/vkdemos/vulkan");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param_get("directx")) {
|
if (param_get("directx8")) {
|
||||||
new_example("examples/dxdemos/directx9");
|
new_example("examples/dxdemos/d3d8");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param_get("directx9")) {
|
||||||
|
new_example("examples/dxdemos/d3d9");
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,7 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
#ifndef MW_DIRECTX8
|
#ifdef MW_DIRECTX8
|
||||||
#define MW_DIRECTX8_NO_INCLUDE
|
|
||||||
MWDECL MwClass MwDX8Class;
|
|
||||||
|
|
||||||
MwClass MwDX8Class = NULL;
|
|
||||||
#else
|
|
||||||
#include <Mw/Widget/D3D8.h>
|
#include <Mw/Widget/D3D8.h>
|
||||||
|
|
||||||
typedef struct gdid3d8 {
|
typedef struct gdid3d8 {
|
||||||
void* d3d8dll;
|
void* d3d8dll;
|
||||||
IDirect3D8* (*Direct3DCreate8)(UINT sdk_version);
|
IDirect3D8* (*Direct3DCreate8)(UINT sdk_version);
|
||||||
|
|
@ -104,4 +98,8 @@ MwClassRec MwDX8ClassRec = {wcreate_d3d8, /* create */
|
||||||
NULL, /* props_change */
|
NULL, /* props_change */
|
||||||
NULL, NULL, NULL};
|
NULL, NULL, NULL};
|
||||||
MwClass MwD3D8Class = &MwDX8ClassRec;
|
MwClass MwD3D8Class = &MwDX8ClassRec;
|
||||||
|
#else
|
||||||
|
MWDECL MwClass MwDX8Class;
|
||||||
|
|
||||||
|
MwClass MwDX8Class = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,7 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
#ifndef MW_DIRECTX9
|
#ifdef MW_DIRECTX9
|
||||||
#define MW_DIRECTX9_NO_INCLUDE
|
|
||||||
MWDECL MwClass MwDX9Class;
|
|
||||||
|
|
||||||
MwClass MwDX9Class = NULL;
|
|
||||||
#else
|
|
||||||
#include <Mw/Widget/D3D9.h>
|
#include <Mw/Widget/D3D9.h>
|
||||||
|
|
||||||
typedef struct gdid3d9 {
|
typedef struct gdid3d9 {
|
||||||
void* d3d9dll;
|
void* d3d9dll;
|
||||||
IDirect3D9* (*Direct3DCreate9)(UINT sdk_version);
|
IDirect3D9* (*Direct3DCreate9)(UINT sdk_version);
|
||||||
|
|
@ -93,4 +87,8 @@ MwClassRec MwDX9ClassRec = {wcreate_d3d9, /* create */
|
||||||
NULL, /* props_change */
|
NULL, /* props_change */
|
||||||
NULL, NULL, NULL};
|
NULL, NULL, NULL};
|
||||||
MwClass MwD3D9Class = &MwDX9ClassRec;
|
MwClass MwD3D9Class = &MwDX9ClassRec;
|
||||||
|
#else
|
||||||
|
MWDECL MwClass MwDX9Class;
|
||||||
|
|
||||||
|
MwClass MwDX9Class = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ sub scan {
|
||||||
while (my $file = readdir($dh)) {
|
while (my $file = readdir($dh)) {
|
||||||
if ( !(($dir . "/" . $file) eq "src/widget/opengl.c")
|
if ( !(($dir . "/" . $file) eq "src/widget/opengl.c")
|
||||||
&& !(($dir . "/" . $file) eq "src/widget/vulkan.c")
|
&& !(($dir . "/" . $file) eq "src/widget/vulkan.c")
|
||||||
|
&& !(($dir . "/" . $file) eq "src/widget/d3d8.c")
|
||||||
|
&& !(($dir . "/" . $file) eq "src/widget/d3d9.c")
|
||||||
&& !(($dir . "/" . $file) eq "external/stb_truetype.c")
|
&& !(($dir . "/" . $file) eq "external/stb_truetype.c")
|
||||||
&& !(($dir . "/" . $file) eq "external/stb_image.c")
|
&& !(($dir . "/" . $file) eq "external/stb_image.c")
|
||||||
&& ($file =~ /\.c$/))
|
&& ($file =~ /\.c$/))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue