update vulkan/opengl
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
b82e13cb2e
commit
5201c46a21
4 changed files with 92 additions and 25 deletions
|
|
@ -15,8 +15,10 @@
|
|||
#error Vulkan is unsupported on the requested platform.
|
||||
#endif
|
||||
|
||||
#if !defined(MW_VULKAN_NO_INCLUDE)
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_core.h>
|
||||
#endif
|
||||
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
|
@ -46,19 +48,19 @@ MWDECL void MwVulkanEnableLayer(const char* ext_name);
|
|||
/*!
|
||||
* @brief Configuration options that can be passed to setup Vulkan before a widget is created.
|
||||
*/
|
||||
typedef struct MwVulkanConfig_T {
|
||||
typedef struct _MwVulkanConfig {
|
||||
/*!
|
||||
* @brief Vulkan API version (default: VK_API_VERSION_1_0)
|
||||
*/
|
||||
uint32_t api_version;
|
||||
MwU32 api_version;
|
||||
/*!
|
||||
* @brief Vulkan version (default: VK_VERSION_1_0)
|
||||
*/
|
||||
uint32_t vk_version;
|
||||
MwU32 vk_version;
|
||||
/*!
|
||||
* @brief Whether or not to enable validation layers (default: false)
|
||||
*/
|
||||
VkBool32 validation_layers;
|
||||
int validation_layers;
|
||||
} MwVulkanConfig;
|
||||
|
||||
/*!
|
||||
|
|
@ -71,7 +73,7 @@ MWDECL void MwVulkanConfigure(MwVulkanConfig cfg);
|
|||
/*!
|
||||
* @brief Field that can be gotten from Vulkan.
|
||||
*/
|
||||
typedef enum MwVulkanField_T {
|
||||
typedef enum _MwVulkanField {
|
||||
/*!
|
||||
* @brief The address of the vulkan widget's vkGetInstanceProcAddr function (PFN_vkGetInstanceProcAddr)
|
||||
*/
|
||||
|
|
@ -120,7 +122,7 @@ MwInline void* MwVulkanGetField(MwWidget handle, MwVulkanField field, int* out)
|
|||
/*!
|
||||
* @brief Return whether Vulkan is installed on the target platform.
|
||||
*/
|
||||
MWDECL VkBool32 MwVulkanSupported(void);
|
||||
MWDECL int MwVulkanSupported(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
69
milsko.xml
69
milsko.xml
|
|
@ -67,10 +67,6 @@
|
|||
<integer name="hasBorder" />
|
||||
<integer name="inverted" />
|
||||
<integer name="modernLook" common="yes" />
|
||||
<integer
|
||||
name="waitMS"
|
||||
common="yes"
|
||||
/> <!-- This is a special property, only applies to toplevel widget -->
|
||||
<integer name="hideInput" />
|
||||
<integer name="singleClickSelectable" />
|
||||
<integer name="flat" />
|
||||
|
|
@ -88,6 +84,9 @@
|
|||
<integer name="darkTheme" common="yes" />
|
||||
<integer name="useMonospace" common="yes" />
|
||||
|
||||
<!-- waitMS is a special property, only applies to toplevel widget -->
|
||||
<integer name="waitMS" common="yes" />
|
||||
|
||||
<string name="title" />
|
||||
<string name="text" />
|
||||
<string name="background" common="yes" />
|
||||
|
|
@ -150,9 +149,20 @@
|
|||
<integer name="MwMB_ICONCLOCK" />
|
||||
</enumeration>
|
||||
<enumeration name="MwClipboardType">
|
||||
<integer name="MwClipboardMain">0</integer>
|
||||
<integer name="MwClipboardMain">0</integer>
|
||||
<integer name="MwClipboardPrimary" />
|
||||
</enumeration>
|
||||
<enumeration name="MwVulkanField">
|
||||
<integer name="MwVulkanField_GetInstanceProcAddr">0</integer>
|
||||
<integer name="MwVulkanField_Instance" />
|
||||
<integer name="MwVulkanField_Surface" />
|
||||
<integer name="MwVulkanField_PhysicalDevice" />
|
||||
<integer name="MwVulkanField_LogicalDevice" />
|
||||
<integer name="MwVulkanField_GraphicsQueueIndex" />
|
||||
<integer name="MwVulkanField_PresentQueueIndex" />
|
||||
<integer name="MwVulkanField_GraphicsQueue" />
|
||||
<integer name="MwVulkanField_PresentQueue" />
|
||||
</enumeration>
|
||||
</enumerations>
|
||||
<constants>
|
||||
<integer name="MwDEFAULT">0x0fffffff</integer>
|
||||
|
|
@ -409,14 +419,14 @@
|
|||
<function name="MwGetClipboard">
|
||||
<arguments>
|
||||
<widget name="handle" />
|
||||
<enum defname="MwClipboardType" pointer="no" name="clipboard_type" />
|
||||
<enumeration defname="MwClipboardType" name="clipboard_type" />
|
||||
</arguments>
|
||||
</function>
|
||||
<function name="MwSetClipboard">
|
||||
<arguments>
|
||||
<widget name="handle" />
|
||||
<string name="text" />
|
||||
<enum defname="MwClipboardType" pointer="no" name="clipboard_type" />
|
||||
<string name="text" />
|
||||
<enumeration defname="MwClipboardType" name="clipboard_type" />
|
||||
</arguments>
|
||||
</function>
|
||||
</functions>
|
||||
|
|
@ -502,6 +512,8 @@
|
|||
</functions>
|
||||
</header>
|
||||
</headers>
|
||||
|
||||
<!-- Widget functions are prefixed with mw<widget name> -->
|
||||
<widgets>
|
||||
<widget name="Box">
|
||||
<properties>
|
||||
|
|
@ -721,15 +733,48 @@
|
|||
</properties>
|
||||
<functions>
|
||||
<function name="Add">
|
||||
<pointer name="parent" />
|
||||
<pixmap name="pixmap" />
|
||||
<string name="item" />
|
||||
<arguments>
|
||||
<pointer name="parent" />
|
||||
<pixmap name="pixmap" />
|
||||
<string name="item" />
|
||||
</arguments>
|
||||
</function>
|
||||
<function name="Delete">
|
||||
<pointer name="item" />
|
||||
<arguments>
|
||||
<pointer name="item" />
|
||||
</arguments>
|
||||
</function>
|
||||
<function name="Reset" />
|
||||
</functions>
|
||||
</widget>
|
||||
|
||||
<!-- They are not alphabetically sorted for reasons -->
|
||||
<widget name="OpenGL">
|
||||
<functions>
|
||||
<function name="MakeCurrent" />
|
||||
<function name="GetProcAddress">
|
||||
<return>
|
||||
<pointer />
|
||||
</return>
|
||||
<arguments>
|
||||
<string name="name" />
|
||||
</arguments>
|
||||
</function>
|
||||
<function name="SwapBuffer" />
|
||||
</functions>
|
||||
</widget>
|
||||
<widget name="Vulkan">
|
||||
<functions>
|
||||
<function name="GetField">
|
||||
<return>
|
||||
<pointer />
|
||||
</return>
|
||||
<arguments>
|
||||
<enumeration defname="MwVulkanField" name="field">
|
||||
<integer pointer="yes" name="out">
|
||||
</arguments>
|
||||
</function>
|
||||
</functions>
|
||||
</widget>
|
||||
</widgets>
|
||||
</milsko>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
#ifdef MW_OPENGL
|
||||
#ifndef MW_OPENGL
|
||||
#define MW_OPENGL_NO_INCLUDE
|
||||
#endif
|
||||
#include <Mw/Widget/OpenGL.h>
|
||||
|
||||
#ifdef MW_OPENGL
|
||||
#ifdef USE_GDI
|
||||
typedef HGLRC(WINAPI* MWwglCreateContext)(HDC);
|
||||
typedef BOOL(WINAPI* MWwglMakeCurrent)(HDC, HGLRC);
|
||||
|
|
|
|||
|
|
@ -4,9 +4,12 @@
|
|||
* ioixd maintains this file. nishi doesn't know vulkan at all
|
||||
*/
|
||||
|
||||
#ifdef MW_VULKAN
|
||||
#ifndef MW_VULKAN
|
||||
#define MW_VULKAN_NO_INCLUDE
|
||||
#endif
|
||||
#include <Mw/Widget/Vulkan.h>
|
||||
|
||||
#ifdef MW_VULKAN
|
||||
#ifdef USE_GDI
|
||||
#define VK_USE_PLATFORM_WIN32_KHR 1
|
||||
#endif
|
||||
|
|
@ -498,7 +501,7 @@ void MwVulkanEnableLayer(const char* name) {
|
|||
arrput(enabledLayers, name);
|
||||
}
|
||||
|
||||
VkBool32 MwVulkanSupported(void) {
|
||||
int MwVulkanSupported(void) {
|
||||
if(vulkan_supported == VULKAN_SUPPORTED_UNKNOWN) {
|
||||
void* lib = vulkan_lib_load();
|
||||
if(lib == NULL) {
|
||||
|
|
@ -509,9 +512,9 @@ VkBool32 MwVulkanSupported(void) {
|
|||
}
|
||||
}
|
||||
if(vulkan_supported == VULKAN_SUPPORTED_YES) {
|
||||
return VK_TRUE;
|
||||
return 1;
|
||||
} else {
|
||||
return VK_FALSE;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -582,7 +585,21 @@ MwClassRec MwVulkanClassRec = {
|
|||
NULL};
|
||||
MwClass MwVulkanClass = &MwVulkanClassRec;
|
||||
#else
|
||||
MWDECL MwClass MwVulkanClass;
|
||||
|
||||
MwClass MwVulkanClass = NULL;
|
||||
|
||||
void MwVulkanEnableExtension(const char* ext_name) {
|
||||
(void)ext_name;
|
||||
}
|
||||
|
||||
void MwVulkanEnableLayer(const char* ext_name) {
|
||||
(void)ext_name;
|
||||
}
|
||||
|
||||
void MwVulkanConfigure(MwVulkanConfig cfg) {
|
||||
(void)cfg;
|
||||
}
|
||||
|
||||
int MwVulkanSupported(void) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue