Jump to page: 1 2 3
Thread overview
Trivial simple OpenGl working example
Jul 08, 2021
drug
Jul 08, 2021
drug
Jul 08, 2021
drug
Jul 08, 2021
Dennis
Jul 08, 2021
drug
Jul 08, 2021
Guillaume Piolat
Jul 09, 2021
H. S. Teoh
Jul 08, 2021
Dennis
Jul 08, 2021
Adam D Ruppe
Jul 08, 2021
Ferhat Kurtulmuş
Jul 09, 2021
Ferhat Kurtulmuş
Jul 09, 2021
Ferhat Kurtulmuş
Jul 10, 2021
Danny Arends
Jul 10, 2021
Danny Arends
July 08, 2021
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 ?

July 08, 2021
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.
July 08, 2021

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.

July 08, 2021
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" ?
July 08, 2021
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.
July 08, 2021
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!
July 08, 2021
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!
July 08, 2021
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?
July 08, 2021
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
# uname -a
Linux unknown 5.11.0-22-generic #23-Ubuntu SMP Thu Jun 17 00:34:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

# dmd --version
DMD64 D Compiler v2.097.0

# dub --version
DUB version 1.26.0, built on Jun  3 2021

#  pkg-config --modversion sdl2
2.0.14
July 08, 2021
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
> # uname -a
> Linux unknown 5.11.0-22-generic #23-Ubuntu SMP Thu Jun 17 00:34:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
> 
> # dmd --version
> DMD64 D Compiler v2.097.0
> 
> # dub --version
> DUB version 1.26.0, built on Jun  3 2021
> 
> #  pkg-config --modversion sdl2
> 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.
« First   ‹ Prev
1 2 3