File tree 3 files changed +18
-7
lines changed
3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -29283,13 +29283,11 @@ extern "C" {
29283
29283
pub struct VkInstance_T {
29284
29284
_unused: [u8; 0],
29285
29285
}
29286
- pub type VkInstance = *mut VkInstance_T;
29287
29286
#[repr(C)]
29288
29287
#[derive(Debug, Copy, Clone)]
29289
29288
pub struct VkSurfaceKHR_T {
29290
29289
_unused: [u8; 0],
29291
29290
}
29292
- pub type VkSurfaceKHR = *mut VkSurfaceKHR_T;
29293
29291
pub type SDL_vulkanInstance = VkInstance;
29294
29292
pub type SDL_vulkanSurface = VkSurfaceKHR;
29295
29293
extern "C" {
@@ -29488,6 +29486,10 @@ extern "C" {
29488
29486
h: *mut ::std::os::raw::c_int,
29489
29487
);
29490
29488
}
29489
+ /// <div rustbindgen replaces="VkInstance"></div>
29490
+ pub type VkInstance = usize;
29491
+ /// <div rustbindgen replaces="VkSurfaceKHR"></div>
29492
+ pub type VkSurfaceKHR = u64;
29491
29493
pub type __builtin_va_list = [__va_list_tag; 1usize];
29492
29494
#[repr(C)]
29493
29495
#[derive(Debug, Copy, Clone)]
Original file line number Diff line number Diff line change 1
1
#include <SDL.h>
2
2
#include <SDL_syswm.h>
3
3
#include <SDL_vulkan.h>
4
+
5
+ /**
6
+ * <div rustbindgen replaces="VkInstance"></div>
7
+ */
8
+ typedef uintptr_t VkInstance_int ;
9
+
10
+ /**
11
+ * <div rustbindgen replaces="VkSurfaceKHR"></div>
12
+ */
13
+ typedef uint64_t VkSurfaceKHR_int ;
Original file line number Diff line number Diff line change @@ -18,9 +18,8 @@ use get_error;
18
18
19
19
use sys;
20
20
21
+ pub use sys:: { VkInstance , VkSurfaceKHR } ;
21
22
22
- type VkInstance = usize ;
23
- type VkSurfaceKHR = u64 ;
24
23
25
24
pub struct WindowSurfaceRef < ' a > ( & ' a mut SurfaceRef , & ' a Window ) ;
26
25
@@ -1147,11 +1146,11 @@ impl Window {
1147
1146
/// [`vkCreateInstance`](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCreateInstance.html)
1148
1147
/// function in the Vulkan library.
1149
1148
pub fn vulkan_create_surface ( & self , instance : VkInstance ) -> Result < VkSurfaceKHR , String > {
1150
- let mut surface: sys :: VkSurfaceKHR = ptr :: null_mut ( ) ;
1151
- if unsafe { sys:: SDL_Vulkan_CreateSurface ( self . context . raw , instance as * mut _ , & mut surface) } == sys:: SDL_bool :: SDL_FALSE {
1149
+ let mut surface: VkSurfaceKHR = 0 ;
1150
+ if unsafe { sys:: SDL_Vulkan_CreateSurface ( self . context . raw , instance, & mut surface) } == sys:: SDL_bool :: SDL_FALSE {
1152
1151
Err ( get_error ( ) )
1153
1152
} else {
1154
- Ok ( surface as VkSurfaceKHR )
1153
+ Ok ( surface)
1155
1154
}
1156
1155
}
1157
1156
You can’t perform that action at this time.
0 commit comments