perl
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
IoIxD 2026-09-17 22:02:27 -07:00
commit 20c39b86f4
9 changed files with 62 additions and 22 deletions

8
configure vendored
View file

@ -55,7 +55,8 @@ param_set("examples", 1);
param_set("allow-sloppy-focus", 0);
# (option that only makes sense on Windows)
param_set("directx", 0);
param_set("dxd8", 0);
param_set("dxd9", 0);
my %features = (
"classic-theme" => "use classic theme",
@ -73,7 +74,8 @@ my %features = (
"gnustep" => "use gnustep",
"dbus" => "use DBus on supported platform",
"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 = (
"1classic-theme", "1stb-image",
@ -82,7 +84,7 @@ my @features_keys = (
"1vulkan", "2vulkan-string-helper",
"1shared", "1static",
"1wayland", "1gnustep",
"1dbus", "1directx"
"1dbus", "1direct8", "1directx9"
);
sub def_platform {

View file

@ -5,6 +5,8 @@
#include <Mw/Milsko.h>
#include <Mw/Widget/D3D8.h>
#ifdef MW_DIRECTX8
MwWidget window, d3d8;
LPDIRECT3D8 d3d;
LPDIRECT3DDEVICE8 d3ddev;
@ -89,3 +91,5 @@ int main() {
MwLoop(window);
}
#endif

View file

@ -6,6 +6,8 @@
#include <Mw/Milsko.h>
#include <Mw/Widget/D3D9.h>
#ifdef MW_DIRECTX9
MwWidget window, d3d8;
LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 d3ddev;
@ -91,3 +93,5 @@ int main() {
MwLoop(window);
}
#endif

View file

@ -22,6 +22,7 @@
#ifndef _WIN32
#error D3D8 widget only avaliable for Win32 backends
#undef MW_DIRECTX8
#else
#ifdef MW_DIRECTX8
#include <d3d8.h>
@ -37,6 +38,7 @@ MWDECL MwClass MwD3D8Class;
extern "C" {
#endif
#ifdef MW_DIRECTX8
MwInline LPDIRECT3D8 MwDirectXGetD3D8(MwWidget handle) {
LPDIRECT3D8 out = NULL;
MwVaWidgetExecute(handle, "mwDirectXGetD3D8", &out, NULL);
@ -47,6 +49,16 @@ MwInline LPDIRECT3DDEVICE8 MwDirectXGetD3Dev8(MwWidget handle) {
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev8", &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
}

View file

@ -20,6 +20,7 @@
#ifndef _WIN32
#error D3D9 widget only avaliable for Win32 backends
#undef MW_DIRECTX9
#else
#ifdef MW_DIRECTX9
#include <d3d9.h>
@ -36,6 +37,7 @@ MWDECL MwClass MwD3D9Class;
extern "C" {
#endif
#ifdef MW_DIRECTX9
MwInline LPDIRECT3D9 MwDirectXGetD3D9(MwWidget handle) {
LPDIRECT3D9 out = NULL;
MwVaWidgetExecute(handle, "mwDirectXGetD3D9", &out, NULL);
@ -46,6 +48,16 @@ MwInline LPDIRECT3DDEVICE9 MwDirectXGetD3Dev9(MwWidget handle) {
MwVaWidgetExecute(handle, "mwDirectXGetD3Dev9", &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
}

View file

@ -178,7 +178,8 @@ new_object("src/widget/window.c");
new_object("src/widget/opengl.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")) {
add_cflags("-DMW_OPENGL");
@ -186,8 +187,11 @@ if (param_get("opengl")) {
if (param_get("vulkan")) {
add_cflags("-DMW_VULKAN");
}
if (param_get("directx")) {
add_cflags("-DMW_DIRECTX");
if (param_get("directx8")) {
add_cflags("-DMW_DIRECTX8");
}
if (param_get("directx9")) {
add_cflags("-DMW_DIRECTX9");
}
new_object("src/dialog/*.c");
@ -234,8 +238,12 @@ if (param_get("vulkan")) {
new_example("examples/vkdemos/vulkan");
}
if (param_get("directx")) {
new_example("examples/dxdemos/directx9");
if (param_get("directx8")) {
new_example("examples/dxdemos/d3d8");
}
if (param_get("directx9")) {
new_example("examples/dxdemos/d3d9");
}
1;

View file

@ -1,13 +1,7 @@
#include <Mw/Milsko.h>
#ifndef MW_DIRECTX8
#define MW_DIRECTX8_NO_INCLUDE
MWDECL MwClass MwDX8Class;
MwClass MwDX8Class = NULL;
#else
#ifdef MW_DIRECTX8
#include <Mw/Widget/D3D8.h>
typedef struct gdid3d8 {
void* d3d8dll;
IDirect3D8* (*Direct3DCreate8)(UINT sdk_version);
@ -104,4 +98,8 @@ MwClassRec MwDX8ClassRec = {wcreate_d3d8, /* create */
NULL, /* props_change */
NULL, NULL, NULL};
MwClass MwD3D8Class = &MwDX8ClassRec;
#else
MWDECL MwClass MwDX8Class;
MwClass MwDX8Class = NULL;
#endif

View file

@ -1,13 +1,7 @@
#include <Mw/Milsko.h>
#ifndef MW_DIRECTX9
#define MW_DIRECTX9_NO_INCLUDE
MWDECL MwClass MwDX9Class;
MwClass MwDX9Class = NULL;
#else
#ifdef MW_DIRECTX9
#include <Mw/Widget/D3D9.h>
typedef struct gdid3d9 {
void* d3d9dll;
IDirect3D9* (*Direct3DCreate9)(UINT sdk_version);
@ -93,4 +87,8 @@ MwClassRec MwDX9ClassRec = {wcreate_d3d9, /* create */
NULL, /* props_change */
NULL, NULL, NULL};
MwClass MwD3D9Class = &MwDX9ClassRec;
#else
MWDECL MwClass MwDX9Class;
MwClass MwDX9Class = NULL;
#endif

View file

@ -59,6 +59,8 @@ sub scan {
while (my $file = readdir($dh)) {
if ( !(($dir . "/" . $file) eq "src/widget/opengl.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_image.c")
&& ($file =~ /\.c$/))