www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Trivial simple OpenGl working example

reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
Hi!

I searching trivial simple D/OpenGL working in 2021 year example.

It may be triangle.
It may be based on any library: SDL, GLFW, Derelict, etc.

Can you help me ?
Jul 08
next sibling parent reply drug <drug2004 bk.ru> writes:
08.07.2021 16:51, Виталий Фадеев пишет:
 Hi!
 
 I searching trivial simple D/OpenGL working in 2021 year example.
 
 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.
 
 Can you help me ?
 
https://github.com/drug007/gfm7/tree/master/examples/simpleshader it's not trivial though but it works (tested in linux) just `dub fetch gfm7` then go to `path\to\gfm7\examples\simpleshader` and run `dub`. All kudos to Guillaume Piolat, original author of gfm library.
Jul 08
next sibling parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote:
 08.07.2021 16:51, Виталий Фадеев пишет:
 Hi!
 
 I searching trivial simple D/OpenGL working in 2021 year 
 example.
 
 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.
 
 Can you help me ?
 
https://github.com/drug007/gfm7/tree/master/examples/simpleshader it's not trivial though but it works (tested in linux) just `dub fetch gfm7` then go to `path\to\gfm7\examples\simpleshader` and run `dub`. All kudos to Guillaume Piolat, original author of gfm library.
Thank, drug. But llok at this: vital unknown:~/src/dtest/working-example/gfm7/examples/simpleshader$ dub run Fetching bindbc-opengl 0.15.0 (getting selected version)... Fetching colorize 1.0.5 (getting selected version)... Fetching gfm 8.0.6 (getting selected version)... Fetching bindbc-sdl 0.19.2 (getting selected version)... Fetching intel-intrinsics 1.4.0 (getting selected version)... Fetching bindbc-loader 0.3.2 (getting selected version)... Performing "debug" build using /usr/bin/dmd for x86_64. colorize 1.0.5: building configuration "library"... gfm7:logger 1.1.1: building configuration "library"... bindbc-loader 0.3.2: building configuration "noBC"... bindbc-opengl 0.15.0: building configuration "dynamic"... intel-intrinsics 1.4.0: building configuration "library"... gfm:math 8.0.6: building configuration "library"... gfm7:opengl 1.1.1: building configuration "unittest"... bindbc-sdl 0.19.2: building configuration "dynamic"... gfm7:sdl2 1.1.1: building configuration "library"... ../../sdl2/gfm/sdl2/timer.d(69,13): Warning: statement is not reachable Error: warnings are treated as errors Use -wi if you wish to treat warnings only as informational. /usr/bin/dmd failed with exit code 1. Error. Has dub flag for disable "warnings are treated as errors" ?
Jul 08
next sibling parent reply drug <drug2004 bk.ru> writes:
08.07.2021 17:20, Виталий Фадеев пишет:
 
 vital unknown:~/src/dtest/working-example/gfm7/examples/simpleshader$ 
 dub run
 Fetching bindbc-opengl 0.15.0 (getting selected version)...
 Fetching colorize 1.0.5 (getting selected version)...
 Fetching gfm 8.0.6 (getting selected version)...
 Fetching bindbc-sdl 0.19.2 (getting selected version)...
 Fetching intel-intrinsics 1.4.0 (getting selected version)...
 Fetching bindbc-loader 0.3.2 (getting selected version)...
 Performing "debug" build using /usr/bin/dmd for x86_64.
 colorize 1.0.5: building configuration "library"...
 gfm7:logger 1.1.1: building configuration "library"...
 bindbc-loader 0.3.2: building configuration "noBC"...
 bindbc-opengl 0.15.0: building configuration "dynamic"...
 intel-intrinsics 1.4.0: building configuration "library"...
 gfm:math 8.0.6: building configuration "library"...
 gfm7:opengl 1.1.1: building configuration "unittest"...
 bindbc-sdl 0.19.2: building configuration "dynamic"...
 gfm7:sdl2 1.1.1: building configuration "library"...
 ../../sdl2/gfm/sdl2/timer.d(69,13): Warning: statement is not reachable
 Error: warnings are treated as errors
         Use -wi if you wish to treat warnings only as informational.
 /usr/bin/dmd failed with exit code 1.
 
 Error.
 Has dub flag for disable "warnings are treated as errors" ?
I failed to reproduce that. What platform you use and what is the compiler version?
Jul 08
parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote:
 08.07.2021 17:20, Виталий Фадеев пишет:
 [...]
I failed to reproduce that. What platform you use and what is the compiler version?
drug, Linux, Ubuntu, x64 00:34:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux DMD64 D Compiler v2.097.0 DUB version 1.26.0, built on Jun 3 2021 2.0.14
Jul 08
parent reply drug <drug2004 bk.ru> writes:
08.07.2021 18:46, Виталий Фадеев пишет:
 On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote:
 08.07.2021 17:20, Виталий Фадеев пишет:
 [...]
I failed to reproduce that. What platform you use and what is the compiler version?
drug, Linux, Ubuntu, x64 2021 x86_64 x86_64 x86_64 GNU/Linux DMD64 D Compiler v2.097.0 DUB version 1.26.0, built on Jun  3 2021 2.0.14
Yes, it's reproducible with dmd 2.097. Trivial fix is deleting that line `../../sdl2/gfm/sdl2/timer.d:69` then it works.
Jul 08
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 15:57:53 UTC, drug wrote:
 08.07.2021 18:46, Виталий Фадеев пишет:
 On Thursday, 8 July 2021 at 15:30:07 UTC, drug wrote:
 08.07.2021 17:20, Виталий Фадеев пишет:
 [...]
I failed to reproduce that. What platform you use and what is the compiler version?
drug, Linux, Ubuntu, x64 00:34:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux DMD64 D Compiler v2.097.0 DUB version 1.26.0, built on Jun  3 2021 2.0.14
Yes, it's reproducible with dmd 2.097. Trivial fix is deleting that line `../../sdl2/gfm/sdl2/timer.d:69` then it works.
Thank, drug. I think some like this: env DFLAGS=-wi dub run or like this "buildRequirements": [ "allowWarnings" ] without gfm/sdl2/timer.d editing. Yes, you right. It can be removed. I will do it. try { SDL2Timer timer = cast(SDL2Timer)param; return timer.onTimer(interval); } catch (Throwable e) { // No Throwable is supposed to cross C callbacks boundaries // Crash immediately exit(-1); return 0; // <--HERE WARMING } It is worked! Thank!
Jul 08
prev sibling parent reply Dennis <dkorpel gmail.com> writes:
On Thursday, 8 July 2021 at 14:20:16 UTC, Виталий Фадеев wrote:
 Has dub flag for disable "warnings are treated as errors" ?
You have to edit the package file to include `buildRequirements "allowWarnings"`, see https://dub.pm/package-format-sdl.html#build-requirements
Jul 08
parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 16:01:37 UTC, Dennis wrote:
 On Thursday, 8 July 2021 at 14:20:16 UTC, Виталий Фадеев wrote:
 Has dub flag for disable "warnings are treated as errors" ?
You have to edit the package file to include `buildRequirements "allowWarnings"`, see https://dub.pm/package-format-sdl.html#build-requirements
Dennis. thank. { "targetType": "executable", "name": "simpleshader", "sourcePaths": [ "." ], "importPaths": [ "." ], "mainSourceFile": "simpleshader.d", "dependencies": { "gfm7:sdl2": {"path": "../../",. "buildRequirements": [ "allowWarnings" ] }, "gfm7:opengl": {"path": "../../"}, "gfm7:logger": {"path": "../../"} }, "versions": [ "SDL_205", "GL_33", "GL_ARB"], .... "buildRequirements": [ "allowWarnings" ] } No effect. Same error. I fix source code, as drug say.
Jul 08
parent reply drug <drug2004 bk.ru> writes:
08.07.2021 19:11, Виталий Фадеев пишет:

 I fix source code, as drug say.
 
 
I've fixed the issue upstream, shortly gfm7 v1.1.2 will be available.
Jul 08
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 16:32:44 UTC, drug wrote:
 08.07.2021 19:11, Виталий Фадеев пишет:

 I fix source code, as drug say.
 
 
I've fixed the issue upstream, shortly gfm7 v1.1.2 will be available.
Drug, thank! I using!
Jul 08
prev sibling parent reply Guillaume Piolat <first.name domain.tld> writes:
On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote:
 08.07.2021 16:51, Виталий Фадеев пишет:
 Hi!
 
 I searching trivial simple D/OpenGL working in 2021 year 
 example.
 
 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.
 
 Can you help me ?
 
https://github.com/drug007/gfm7/tree/master/examples/simpleshader it's not trivial though but it works (tested in linux) just `dub fetch gfm7` then go to `path\to\gfm7\examples\simpleshader` and run `dub`. All kudos to Guillaume Piolat, original author of gfm library.
If like me you hate OpenGL :) you can can also get software-rendered DPI-aware triangles with the "turtle" package: https://code.dlang.org/packages/turtle (Courtesy of Cerjones for the software renderer. )
Jul 08
parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 16:11:17 UTC, Guillaume Piolat wrote:
 On Thursday, 8 July 2021 at 14:09:30 UTC, drug wrote:
 08.07.2021 16:51, Виталий Фадеев пишет:
 Hi!
 
 I searching trivial simple D/OpenGL working in 2021 year 
 example.
 
 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.
 
 Can you help me ?
 
https://github.com/drug007/gfm7/tree/master/examples/simpleshader it's not trivial though but it works (tested in linux) just `dub fetch gfm7` then go to `path\to\gfm7\examples\simpleshader` and run `dub`. All kudos to Guillaume Piolat, original author of gfm library.
If like me you hate OpenGL :) you can can also get software-rendered DPI-aware triangles with the "turtle" package: https://code.dlang.org/packages/turtle (Courtesy of Cerjones for the software renderer. )
Thank, Guillaume Piolat. I using CPU Pentium B970 It is old CPU, but even it contains a graphics accelerator. Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1), has 4 conveers on GPU. Smartphones also contains GPU. Because OpenGL has high priority. CPU render, may be later. Thanks, I noticed turtle, dg2d. It has clipping, it usefull. What about text rendering ?
Jul 08
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Jul 09, 2021 at 05:11:06AM +0000, Виталий Фадеев via
Digitalmars-d-learn wrote:
[...]
 I using CPU Pentium B970 It is old CPU, but even it contains a
 graphics accelerator.
 Mesa DRI Intel(R) HD Graphics 2000 (SNB GT1), has 4 conveers on GPU.
 Smartphones also contains GPU.
 Because OpenGL has high priority.
[...]
 What about text rendering ?
Generally, text rendering on OpenGL is a huge pain to implement. This is not specific to D, but to OpenGL in general, because OpenGL itself does not have direct support for text rendering at all. The usual route is to use an existing text-rendering library like FreeType to rasterize your text, then upload it as a texture to the GPU and render it as a quad. If you want to do a more modern approach, you could use signed distance fields, but that requires some deep knowledge of how shaders work unless you can find an off-the-shelf library that does it for you. You may still end up needing FreeType or equivalent anyway, to get the SDFs in the first place. Here's something to start you off, if you don't already have an approach in mind: https://learnopengl.com/In-Practice/Text-Rendering T -- Chance favours the prepared mind. -- Louis Pasteur
Jul 09
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Friday, 9 July 2021 at 19:15:44 UTC, H. S. Teoh wrote:
 On Fri, Jul 09, 2021 at 05:11:06AM +0000, Виталий Фадеев via 
 Digitalmars-d-learn wrote: [...]
 [...]
[...]
 [...]
Generally, text rendering on OpenGL is a huge pain to implement. This is not specific to D, but to OpenGL in general, because OpenGL itself does not have direct support for text rendering at all. The usual route is to use an existing text-rendering library like FreeType to rasterize your text, then upload it as a texture to the GPU and render it as a quad. [...]
Thank, H. S. Teoh!
Jul 09
prev sibling next sibling parent reply Dennis <dkorpel gmail.com> writes:
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 I searching trivial simple D/OpenGL working in 2021 year 
 example.
https://github.com/dkorpel/glfw-d/tree/master/examples/triangle-gl Uses bindbc-opengl + glfw-d (my package), example uses OpenGL 3.3. Should works on Windows and Linux out of the box, if not, please open an issue.
Jul 08
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 14:09:38 UTC, Dennis wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 I searching trivial simple D/OpenGL working in 2021 year 
 example.
https://github.com/dkorpel/glfw-d/tree/master/examples/triangle-gl Uses bindbc-opengl + glfw-d (my package), example uses OpenGL 3.3. Should works on Windows and Linux out of the box, if not, please open an issue.
Dennis, Thank! Worked! I happy!
Jul 08
prev sibling next sibling parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 It may be based on any library: SDL, GLFW, Derelict, etc.
my library http://arsd-official.dpldocs.info/arsd.simpledisplay.html#topic-modern-opengl arsd-official:simpledisplay dependency on dub, or just download color.d and simpledisplay.d from https://github.com/adamdruppe/arsd and compile them with your sample program (dmd yourprog.d color.d simpledisplay.d) and you should be able to run with it. but my bindings aren't as complete as the others suggested here.
Jul 08
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 14:20:25 UTC, Adam D Ruppe wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 It may be based on any library: SDL, GLFW, Derelict, etc.
my library http://arsd-official.dpldocs.info/arsd.simpledisplay.html#topic-modern-opengl arsd-official:simpledisplay dependency on dub, or just download color.d and simpledisplay.d from https://github.com/adamdruppe/arsd and compile them with your sample program (dmd yourprog.d color.d simpledisplay.d) and you should be able to run with it. but my bindings aren't as complete as the others suggested here.
Adam, thank!
Jul 08
prev sibling next sibling parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 Hi!

 I searching trivial simple D/OpenGL working in 2021 year 
 example.

 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.

 Can you help me ?
this one of mine [1] was very simple in the beginning. It even runs on browser now. [1] https://github.com/aferust/drawee
Jul 08
parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Thursday, 8 July 2021 at 17:20:14 UTC, Ferhat Kurtulmuş wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 Hi!

 I searching trivial simple D/OpenGL working in 2021 year 
 example.

 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.

 Can you help me ?
this one of mine [1] was very simple in the beginning. It even runs on browser now. [1] https://github.com/aferust/drawee
Ferhat Kurtulmuş, thank you! I has error on build: ``` The following compiler flags have been specified in the package description file. They are handled by DUB and direct use in packages is discouraged. Alternatively, you can set the DFLAGS environment variable to pass custom flags to the compiler, or use one of the suggestions below: -c: Automatically issued by DUB, do not specify in dub.json Performing "debug" build using /usr/bin/dmd for x86_64. bcaa 0.0.7: target for configuration "default" is up to date. bindbc-loader 0.2.1: target for configuration "yesBC" is up to date. bindbc-opengl 0.12.0: target for configuration "dynamicBC" is up to date. bindbc-sdl 0.13.0: target for configuration "staticBC" is up to date. chipmunkd 1.0.1+7.0.1: target for configuration "library" is up to date. dvector 0.0.5: target for configuration "library" is up to date. earcutd 0.0.2: target for configuration "default" is up to date. drawee 0.0.1: building configuration "default"... Linking... /usr/bin/ld: cannot find -lchipmunk collect2: error: ld returned 1 exit status Error: linker exited with status 1 /usr/bin/dmd failed with exit code 1. ``` And second chance: ``` --build-mode=allAtOnce --combined --arch=wasm32-unknown-unknown-wasm -v Using dub registry url 'https://code.dlang.org/' Refreshing local packages (refresh existing: true)... Looking for local package map at /var/lib/dub/packages/local-packages.json Looking for local package map at /home/vital/.dub/packages/local-packages.json Looking for local package map at /home/vital/src/dtest/working-example-5/drawee/.dub/packages/local-packages.json Ignoring version specification (>=0.0.0) for path based dependency . Ignoring version specification (>=0.0.0) for path based dependency . Ignoring version specification (>=0.0.0) for path based dependency . Refreshing local packages (refresh existing: false)... Looking for local package map at /var/lib/dub/packages/local-packages.json Looking for local package map at /home/vital/.dub/packages/local-packages.json Looking for local package map at /home/vital/src/dtest/working-example-5/drawee/.dub/packages/local-packages.json Found dependency bindbc-opengl 0.12.0 Found dependency bindbc-loader 0.2.1 Found dependency dvector 0.0.5 Found dependency earcutd 0.0.2 Found dependency bcaa 0.0.7 Found dependency bindbc-sdl 0.13.0 Found dependency bettercmath 0.3.1 Found dependency chipmunkd 1.0.1+7.0.1 Refreshing local packages (refresh existing: false)... Looking for local package map at /var/lib/dub/packages/local-packages.json Looking for local package map at /home/vital/.dub/packages/local-packages.json Looking for local package map at /home/vital/src/dtest/working-example-5/drawee/.dub/packages/local-packages.json Found dependency bindbc-opengl 0.12.0 Found dependency bindbc-loader 0.2.1 Found dependency dvector 0.0.5 Found dependency earcutd 0.0.2 Found dependency bcaa 0.0.7 Found dependency bindbc-sdl 0.13.0 Found dependency bettercmath 0.3.1 Found dependency chipmunkd 1.0.1+7.0.1 The following compiler flags have been specified in the package description file. They are handled by DUB and direct use in packages is discouraged. Alternatively, you can set the DFLAGS environment variable to pass custom flags to the compiler, or use one of the suggestions below: -c: Automatically issued by DUB, do not specify in dub.json Generating using build Configuring dependent drawee, deps:"bindbc-sdl" Configuring dependent bindbc-sdl, deps: Performing "release" build using ldc2 for . Target '/home/vital/src/dtest/working-example-5/drawee/.dub/build/wasm-release-wasm--ldc_v1.24.0-F903DBE30DDE459672D4DB82B AB44CF/libdrawee.a' doesn't exist, need rebuild. drawee 0.0.1: building configuration "wasm"... ldc2 --output-o --output-bc -c -mtriple=wasm32-unknown-unknown-wasm -lib -of.dub/build/wasm-release-wasm--ldc_v1.24.0-F903DBE30DDE459672D4DB82 5AB44CF/libdrawee.a -release -enable-inlining -Hkeep-all-bodies -O3 -w -betterC --oq -od=.dub/build/wasm-release-wasm--ldc_v1.24.0-F903DBE30DDE45967 D4DB82B5AB44CF//obj -d-version=BindSDL_Static -d-version=BindSDL_TTF -d-version=BindSDL_Image -d-version=GL_41 -d-version=Have_drawee -d-version=Have_bcaa -d-version=Have_bettercmath -d-version=Have_chipmunkd -d-version=Have_dvector -d-version=Have_earcutd -d-version=Have_bindbc_sdl -Isource/ -I/home/vital/.dub/packages/bcaa-0.0.7/bcaa/source -I/home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/ -I/home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/ -I/home/vital/.dub/packages/dvector-0.0.5/dvector/source -I/home/vital/.dub/packages/earcutd-0.0.2/earcutd/source -I/home/vital/.dub/packages/bindbc-sdl-0.13.0/bindbc-sdl/source/ source/app.d source/boilerplate.d source/drawobjects.d source/enemyimp.d source/gamemath.d source/gl4.d source/globals.d source/heroimp.d source/msgnode.d source/obstacleimp.d source/primitives.d source/railimp.d source/tween.d /home/vital/.dub/packages/bcaa-0.0.7/bcaa/source/bcaa.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/sour e/bettercmath/box.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source bettercmath/cmath.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/b ttercmath/easings.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/bett rcmath/hexagrid2d.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/ ettercmath/matrix.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/sourc /bettercmath/misc.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/b ttercmath/package.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/bet ercmath/transform.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/bett rcmath/valuerange.d /home/vital/.dub/packages/bettercmath-0.3.1/bettercmath/source/ ettercmath/vector.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src chipmunk/chipmunk.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipmun /chipmunk_private.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipmun /chipmunk_structs.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipm nk/chipmunk_types.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipmu k/chipmunk_unsafe.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/ hipmunk/cpArbiter.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd src/chipmunk/cpBB.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/s c/chipmunk/cpBody.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chi munk/cpConstraint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipmunk/cp ampedRotarySpring.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipm nk/cpDampedSpring.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/ch pmunk/cpGearJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chip unk/cpGrooveJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chi munk/cpHastySpace.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/sr /chipmunk/cpMarch.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/c ipmunk/cpPinJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chi munk/cpPivotJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/ch pmunk/cpPolyShape.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/c ipmunk/cpPolyline.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipm nk/cpRatchetJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src chipmunk/cpRobust.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipmunk/ pRotaryLimitJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/sr /chipmunk/cpShape.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chip unk/cpSimpleMotor.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chi munk/cpSlideJoint.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/sr /chipmunk/cpSpace.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/chipm nk/cpSpatialIndex.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/src/ch pmunk/cpTransform.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/s c/chipmunk/cpVect.d /home/vital/.dub/packages/chipmunkd-1.0.1_7.0.1/chipmunkd/sr /chipmunk/package.d /home/vital/.dub/packages/dvector-0.0.5/dvec or/source/dvector.d /home/vital/.dub/packages/earcutd-0.0.2/earc td/source/earcutd.d -L-allow-undefined -vcolumns packs/phobos/std/range/package.d(920,58): Deprecation: storage class ref has no effect in type aliases packs/druntime/src/core/sys/wasi/core.d(14,13): Error: version identifier WASI is reserved and cannot be set FAIL .dub/build/wasm-release-wasm--ldc_v1.24.0-F903DBE30DDE459672D4DB82B5AB44CF/ drawee staticLibrary ldc2 failed with exit code 1. ``` dub run dub build --config=wasm --compiler=ldc2 --build=release --build-mode=allAtOnce --combined --arch=wasm32-unknown-unknown-wasm -v Each ends with error.
Jul 08
parent reply Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 9 July 2021 at 05:17:28 UTC, Виталий Фадеев wrote:
 On Thursday, 8 July 2021 at 17:20:14 UTC, Ferhat Kurtulmuş 
 wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 Hi!
 Each ends with error.
Dear Vitaly (Google translates it like that :)), I didn't touch that game for a while. I have just tried to compile and those are the steps to build and run it: Using a Windows 10 x64. (Webassembly build needs crazy efforts, don't try it for now. If you are on a posix system please delete *.a folders from the root folder because they are for webassembly) 1) Open the dub.json or dub.selections.json, and change "bcaa": "~>0.0.5" to "bcaa": "0.0.5" (Recently a contributor and I have made some breaking changes in bcaa). 2) Have those lib and dll files in the root folder of the project: chipmunk.lib // I manually compiled this one libfreetype-6.dl libjpeg-9.dll libpng16-16.dll libtiff-5.dll libwebp-7.dll SDL2_image.dll SDL2_image.lib SDL2_ttf.dll SDL2_ttf.lib SDL2.dll SDL2.lib zlib1.dll basically, those are win 64-bit builds of SDL2, its friends, and their dependencies. If you provide an email, I can send them to you via wetransfer. For posix builds, you will have to figure those out.
Jul 08
parent Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= <aferust gmail.com> writes:
On Friday, 9 July 2021 at 06:16:08 UTC, Ferhat Kurtulmuş wrote:
 On Friday, 9 July 2021 at 05:17:28 UTC, Виталий Фадеев wrote:
[...]
 [...]
Dear Vitaly (Google translates it like that :)), I didn't touch that game for a while. I have just tried to compile and those are the steps to build and run it: [...]
You may also need to use the exact version of "bettercmath": "0.3.1".
Jul 08
prev sibling parent reply Danny Arends <Danny.Arends gmail.com> writes:
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 Hi!

 I searching trivial simple D/OpenGL working in 2021 year 
 example.

 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.

 Can you help me ?
OpenGL is being replaced by vulcan, just to plug my little project: http://github.com/DannyArends/CalderaD Pretty beafy, but well vulkan is a lot more verbose compared to OpenGL
Jul 10
parent reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Saturday, 10 July 2021 at 08:36:07 UTC, Danny Arends wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 Hi!

 I searching trivial simple D/OpenGL working in 2021 year 
 example.

 It may be triangle.
 It may be based on any library: SDL, GLFW, Derelict, etc.

 Can you help me ?
OpenGL is being replaced by vulcan, just to plug my little project: http://github.com/DannyArends/CalderaD Pretty beafy, but well vulkan is a lot more verbose compared to OpenGL
Thank, Danny Arends! I see you. I got error: app/src/main/assets/data/shaders/vert.spv app/src/main/assets/data/shaders/frag.spv Performing "debug" build using /usr/bin/dmd for x86_64. bindbc-loader 0.3.2: target for configuration "yesBC" is up to date. bindbc-sdl 0.21.4: target for configuration "dynamicBC" is up to date. calderad ~master: building configuration "default"... Running pre-build commands... /bin/sh: 1: glslc.exe: not found Command failed with exit code 127: glslc.exe app/src/main/assets/data/shaders/wavefront.vert -o app/src/main/assets/data/shaders/vert.spv
Jul 10
parent reply Danny Arends <Danny.Arends gmail.com> writes:
On Saturday, 10 July 2021 at 12:41:19 UTC, Виталий Фадеев wrote:
 On Saturday, 10 July 2021 at 08:36:07 UTC, Danny Arends wrote:
 On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote:
 [...]
OpenGL is being replaced by vulcan, just to plug my little project: http://github.com/DannyArends/CalderaD Pretty beafy, but well vulkan is a lot more verbose compared to OpenGL
Thank, Danny Arends! I see you. I got error: app/src/main/assets/data/shaders/vert.spv app/src/main/assets/data/shaders/frag.spv Performing "debug" build using /usr/bin/dmd for x86_64. bindbc-loader 0.3.2: target for configuration "yesBC" is up to date. bindbc-sdl 0.21.4: target for configuration "dynamicBC" is up to date. calderad ~master: building configuration "default"... Running pre-build commands... /bin/sh: 1: glslc.exe: not found Command failed with exit code 127: glslc.exe app/src/main/assets/data/shaders/wavefront.vert -o app/src/main/assets/data/shaders/vert.spv
Just disable shader compilation using dub, the shader only needs to be compiled once. Since you're on linux it fails to execute glslc.exe (the windows executable). If you compiled them yourself you can remove it from dub prebuild commands
Jul 10
parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Saturday, 10 July 2021 at 19:43:07 UTC, Danny Arends wrote:
 On Saturday, 10 July 2021 at 12:41:19 UTC, Виталий Фадеев wrote:
 [...]
Just disable shader compilation using dub, the shader only needs to be compiled once. Since you're on linux it fails to execute glslc.exe (the windows executable). If you compiled them yourself you can remove it from dub prebuild commands
Thanks, Danny Arends! I fixed the configuration in dub.json, and in the application.d I fixed VK_API_VERSION_1_0. It worked! Look in to the pull requests: https://github.com/DannyArends/CalderaD/pulls
Jul 11