Skip to content

Commit fe63db6

Browse files
committed
Fix linux surface creation; update copyright year; update README.md
1 parent d2204d7 commit fe63db6

File tree

8 files changed

+43
-14
lines changed

8 files changed

+43
-14
lines changed

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Boost Software License - Version 1.0 - August 17th, 2003
22

3-
Copyright (c) 2019-2021 Timur Gafarov.
3+
Copyright (c) 2019-2022 Timur Gafarov.
44

55
Permission is hereby granted, free of charge, to any person or organization
66
obtaining a copy of the software and accompanying documentation covered by

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Dynamic binding to [gfx-rs/wgpu-native](https://github.com/gfx-rs/wgpu-native) b
88
Usage:
99
```
1010
"dependencies": {
11-
"bindbc-wgpu": "0.11.0"
11+
"bindbc-wgpu": "0.12.0"
1212
}
1313
```
1414

demo/main.d

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
/*
2+
Copyright (c) 2019-2022 Timur Gafarov.
3+
4+
Boost Software License - Version 1.0 - August 17th, 2003
5+
6+
Permission is hereby granted, free of charge, to any person or organization
7+
obtaining a copy of the software and accompanying documentation covered by
8+
this license (the "Software") to use, reproduce, display, distribute,
9+
execute, and transmit the Software, and to prepare derivative works of the
10+
Software, and to permit third-parties to whom the Software is furnished to
11+
do so, all subject to the following:
12+
13+
The copyright notices in the Software and this entire statement, including
14+
the above license grant, this restriction and the following disclaimer,
15+
must be included in all copies of the Software, in whole or in part, and
16+
all derivative works of the Software, unless such copies or derivative
17+
works are solely in the form of machine-executable object code generated by
18+
a source language processor.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
23+
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
24+
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
25+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
*/
128
module main;
229

330
import core.stdc.stdlib;
@@ -306,10 +333,10 @@ WGPUSurface createSurface(SDL_SysWMinfo wmInfo)
306333
{
307334
auto x11_display = wmInfo.info.x11.display;
308335
auto x11_window = wmInfo.info.x11.window;
309-
WGPUSurfaceDescriptorFromXlib sfdX11 = {
336+
WGPUSurfaceDescriptorFromXlibWindow sfdX11 = {
310337
chain: {
311338
next: null,
312-
sType: WGPUSType.SurfaceDescriptorFromXlib
339+
sType: WGPUSType.SurfaceDescriptorFromXlibWindow
313340
},
314341
display: x11_display,
315342
window: x11_window
@@ -320,6 +347,11 @@ WGPUSurface createSurface(SDL_SysWMinfo wmInfo)
320347
};
321348
surface = wgpuInstanceCreateSurface(null, &sfd);
322349
}
350+
else if (wmInfo.subsystem == SDL_SYSWM_WAYLAND)
351+
{
352+
// TODO: support Wayland
353+
quit("Unsupported subsystem, sorry");
354+
}
323355
else
324356
{
325357
quit("Unsupported subsystem, sorry");
@@ -329,14 +361,14 @@ WGPUSurface createSurface(SDL_SysWMinfo wmInfo)
329361
{
330362
// Needs test!
331363
SDL_Renderer* renderer = SDL_CreateRenderer(window.sdlWindow, -1, SDL_RENDERER_PRESENTVSYNC);
332-
auto m_layer = SDL_RenderGetMetalLayer(renderer);
364+
auto metalLayer = SDL_RenderGetMetalLayer(renderer);
333365

334366
WGPUSurfaceDescriptorFromMetalLayer sfdMetal = {
335367
chain: {
336368
next: null,
337369
sType: WGPUSType.SurfaceDescriptorFromMetalLayer
338370
},
339-
layer: m_layer
371+
layer: metalLayer
340372
};
341373
WGPUSurfaceDescriptor sfd = {
342374
label: null,

src/bindbc/wgpu/funcs.d

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2019-2021 Timur Gafarov.
2+
Copyright (c) 2019-2022 Timur Gafarov.
33
44
Boost Software License - Version 1.0 - August 17th, 2003
55
@@ -99,9 +99,6 @@ __gshared
9999
alias da_wgpuCommandEncoderCopyTextureToTexture = void function(WGPUCommandEncoder commandEncoder, const(WGPUImageCopyTexture)* source, const(WGPUImageCopyTexture)* destination, const(WGPUExtent3D)* copySize);
100100
da_wgpuCommandEncoderCopyTextureToTexture wgpuCommandEncoderCopyTextureToTexture;
101101

102-
//alias da_wgpuCommandEncoderFillBuffer = void function(WGPUCommandEncoder commandEncoder, WGPUBuffer destination, ulong destinationOffset, ulong size, ubyte value);
103-
//da_wgpuCommandEncoderFillBuffer wgpuCommandEncoderFillBuffer;
104-
105102
alias da_wgpuCommandEncoderFinish = WGPUCommandBuffer function(WGPUCommandEncoder commandEncoder, const(WGPUCommandBufferDescriptor)* descriptor);
106103
da_wgpuCommandEncoderFinish wgpuCommandEncoderFinish;
107104

src/bindbc/wgpu/loader.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2019-2021 Timur Gafarov.
2+
Copyright (c) 2019-2022 Timur Gafarov.
33
44
Boost Software License - Version 1.0 - August 17th, 2003
55

src/bindbc/wgpu/package.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2019-2020 Timur Gafarov.
2+
Copyright (c) 2019-2022 Timur Gafarov.
33
44
Boost Software License - Version 1.0 - August 17th, 2003
55

src/bindbc/wgpu/types.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2019-2021 Timur Gafarov.
2+
Copyright (c) 2019-2022 Timur Gafarov.
33
44
Boost Software License - Version 1.0 - August 17th, 2003
55

src/bindbc/wgpu/types2.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2019-2021 Timur Gafarov.
2+
Copyright (c) 2019-2022 Timur Gafarov.
33
44
Boost Software License - Version 1.0 - August 17th, 2003
55

0 commit comments

Comments
 (0)