July 09, 2021

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".

July 09, 2021
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
July 10, 2021
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!
July 10, 2021
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

July 10, 2021
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:

# glslc app/src/main/assets/data/shaders/wavefront.vert -o app/src/main/assets/data/shaders/vert.spv

# glslc app/src/main/assets/data/shaders/wavefront.frag -o app/src/main/assets/data/shaders/frag.spv

# dub
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


July 10, 2021
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:
>
> # glslc app/src/main/assets/data/shaders/wavefront.vert -o app/src/main/assets/data/shaders/vert.spv
>
> # glslc app/src/main/assets/data/shaders/wavefront.frag -o app/src/main/assets/data/shaders/frag.spv
>
> # dub
> 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
July 12, 2021
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

1 2 3
Next ›   Last »