www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dlang opengl / gl / glu /glut library.

reply Alain De Vos <devosalain ymail.com> writes:
Is there a library with api index ?
Apr 18 2021
next sibling parent reply Alain De Vos <devosalain ymail.com> writes:
When doing graphics the number of functions explodes.
So one needs always a list, compare to a header file in c.
If there are "modern" alternatives to opengl feel free.
Apr 18 2021
parent Dukc <ajieskola gmail.com> writes:
On Sunday, 18 April 2021 at 23:36:58 UTC, Alain De Vos wrote:
 When doing graphics the number of functions explodes.
 So one needs always a list, compare to a header file in c.
 If there are "modern" alternatives to opengl feel free.
More modern from which perspective? Simpler to use (non-inclusive list of options: SDL2/Allegro/SFML bindings, cairod, DLib, dgame)? Or more modern from GPU acceleration perspective (you're probably wanting derelict-vulkan or derelict-bgfx)?
Apr 21 2021
prev sibling parent reply russhy <russhy gmail.com> writes:
On Sunday, 18 April 2021 at 22:35:26 UTC, Alain De Vos wrote:
 Is there a library with api index ?
https://github.com/BindBC/bindbc-opengl use the version block you need: https://github.com/BindBC/bindbc-opengl#enable-support-for-opengl-versions-30-and-higher
Apr 21 2021
parent reply Alain De Vos <devosalain ymail.com> writes:
First opengl test.
Link library.
```
import std.stdio;
import bindc.opengl;

void main()
{
	writeln("Edit source/app.d to start your project.");
}
x: /home/x/Src/languages/dlang/opengl >
```

dub.json:
```

	"authors": [
		"x"
	],
	"copyright": "Copyright © 2021, x",
	"dependencies": {
		"bindbc-opengl": "~>0.16.0",
	},
	"description": "A minimal D application.",
	"license": "proprietary",
	"name": "opengl"
}

```

dub build
```
dub build
Performing "debug" build using /usr/local/bin/ldc2 for x86_64.
bindbc-loader 0.3.2: target for configuration "noBC" is up to 
date.
bindbc-opengl 0.16.0: target for configuration "dynamic" is up to 
date.
opengl ~master: building configuration "application"...
source/app.d(2,8): Error: module opengl is in file 
'bindc/opengl.d' which cannot be read
import path[0] = source/
import path[1] = 
/home/x/.dub/packages/bindbc-opengl-0.16.0/bindbc-opengl/source/
import path[2] = 
/home/x/.dub/packages/bindbc-loader-0.3.2/bindbc-loader/source/
import path[3] = /usr/local/include/d
/usr/local/bin/ldc2 failed with exit code 1.

```
Apr 21 2021
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 22/04/2021 7:51 AM, Alain De Vos wrote:
 import bindc.opengl;
bindbc
Apr 21 2021
parent reply Alain De Vos <devosalain ymail.com> writes:
My lapsus.
I've got dgame & raylib-d working.
I wander how I start with sdl/opengl.
Apr 21 2021
parent Alain De Vos <devosalain ymail.com> writes:
If i'm correct,
sdl gives you a window
opengl allows to draw in this window
dlang allows to model the world with objects.
"Needing a hello world :)"
Apr 23 2021