www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D is totally useless

reply "Temtaime" <temtaime gmail.com> writes:
I'm new in D, so i'm tried to write some in that langugage.
That's story about how i tried to port OGL sample, that renders 
one triangle.

I was very surprised when i found, that D doesn't have equivalent 
of gl/gl.h. Any C++ compiler has it.

Okay, i'm investigate in it and found OpenGL in deimos.
It doesn't support a lot of OGL function such as glPushMatrix and 
others.

Okay, then i found derelict3. It has a lot of OGl functions and 
it's okay.
When i tried to rewrite example to D, i was shocked.

core.sys.windows.windows doesn't have a lot of functions. It 
doesn't contain simple function DestroyWindow for example.
It's intresting, but go ahead, i found derelict.util.wintypes 
with missing functions. I've got a lot of "conflicts with" 
errors, because some of functions was in derelict's wintypes too. 
I've solved it. When i tried to link my program, i've got a lot 
of "undefined reference" errors. Okay, i've built and link 
derelict libraries. Then errors became stranger:
DerelictUtil.lib(traits)  Offset 204C4H Record Type 0091
  Error 1: Previous Definition Different : _D67 
DMD\windows\bin\..\..\src\phobos\std\traits.d.17012__ModuleInfoZ

So i can't to rewrite simple OpenGL example that consists of 50 
lines.
This example works on every C++ compiler without building/finding 
any libraries.

Dlang's standard windows.h heade is useless, because a lot of 
functions/structs definitions is missing.

Dlang is a toy in outer space.
One can only to write a+b program in schools on it.

Now i'm understand, that's why D doesn't have popularity after 
10+ years of existence.
May 01 2013
next sibling parent reply =?UTF-8?B?UmFwaGHDq2wgSmFrc2U=?= <raphael.jakse gmail.com> writes:
Le 01/05/2013 10:42, Temtaime a écrit :
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders one
 triangle.
You can do much better with the D programming langage. See : - http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html - http://www.emhsoft.com/ttrooper/ So yes, you can do OpenGL with D, and it works.
May 01 2013
parent reply "Carlos" <checoimg gmail.com> writes:
On Wednesday, 1 May 2013 at 08:53:18 UTC, Raphaël Jakse wrote:
 Le 01/05/2013 10:42, Temtaime a écrit :
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that 
 renders one
 triangle.
You can do much better with the D programming langage. See : - http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html - http://www.emhsoft.com/ttrooper/ So yes, you can do OpenGL with D, and it works.
But where can this be learned ? Do you know any books on the subject ?
May 01 2013
next sibling parent reply "evilrat" <evilrat666 gmail.com> writes:
On Thursday, 2 May 2013 at 02:07:23 UTC, Carlos wrote:
 On Wednesday, 1 May 2013 at 08:53:18 UTC, Raphaël Jakse wrote:
 Le 01/05/2013 10:42, Temtaime a écrit :
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that 
 renders one
 triangle.
You can do much better with the D programming langage. See : - http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html - http://www.emhsoft.com/ttrooper/ So yes, you can do OpenGL with D, and it works.
But where can this be learned ? Do you know any books on the subject ?
learn what? opengl is C API specification, any resource about opengl will work, the only thing required for apply it to D is to know D basics. but unfortunately for D itself it is really hard to find good tutorials
May 01 2013
next sibling parent reply "Rob T" <alanb ucora.com> writes:
On Thursday, 2 May 2013 at 04:27:10 UTC, evilrat wrote:
 learn what? opengl is C API specification, any resource about 
 opengl will work, the only thing required for apply it to D is 
 to know D basics. but unfortunately for D itself it is really 
 hard to find good tutorials
I use this on-line book on D. http://ddili.org/ders/d.en/index.html Unfortunately, not 100% translated yet, but it's still an active project being worked on so I expect eventually it will get filly translated. A really nice thing about it, is that it gets updated to reflect the latest changes and additions to D. --rt
May 02 2013
parent reply "Diggory" <diggsey googlemail.com> writes:
The wgl*** functions and "SwapBuffers" ARE part of the windows 
api even though they are implemented in opengl32.dll (they are 
declared in wingdi.h IIRC)
May 02 2013
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-05-02 22:23, Diggory wrote:
 The wgl*** functions and "SwapBuffers" ARE part of the windows api even
 though they are implemented in opengl32.dll (they are declared in
 wingdi.h IIRC)
wgl*** is the Windows specific OpenGL functions? Then it make sense to be part of the Windows API. -- /Jacob Carlborg
May 02 2013
next sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Friday, 3 May 2013 at 06:15:20 UTC, Jacob Carlborg wrote:
 On 2013-05-02 22:23, Diggory wrote:
 The wgl*** functions and "SwapBuffers" ARE part of the windows 
 api even
 though they are implemented in opengl32.dll (they are declared 
 in
 wingdi.h IIRC)
wgl*** is the Windows specific OpenGL functions? Then it make sense to be part of the Windows API.
yes they are. but that set of function is quite similar on both windows(wgl_***) and linux(glx_*** stuff)(mac has both carbon/cocoa specific stuff), however there are some differences in os level stuff like swap buffers and other, if wgl*** winapi decls will be added to phobos i wish there are also be added similar linux/x11 stuff, though i don't and don't plan to use linux that stuff will help a lot for all coders(standardization and so on) -_-
May 03 2013
prev sibling parent "WhatMeWorry" <kc_heaser yahoo.com> writes:
You sir need Derelict3:    https://github.com/aldacron/Derelict3

It not only has the gl.h you are looking for but FreeGlut, OGG, 
openAL, SDL2, etc.
May 04 2013
prev sibling parent reply "Jesse Phillips" <Jessekphillips+D gmail.com> writes:
On Thursday, 2 May 2013 at 20:23:53 UTC, Diggory wrote:
 The wgl*** functions and "SwapBuffers" ARE part of the windows 
 api even though they are implemented in opengl32.dll (they are 
 declared in wingdi.h IIRC)
You recalled correctly, and according to MS these describe OpenGL 1.1. Anyway, OpenGL, and the gl.h file is not part of the Windows API. But I'd defiantly be for all the .h files in the SDK to be translated for Phobos.
May 03 2013
parent "Idan Arye" <GenericNPC gmail.com> writes:
On Friday, 3 May 2013 at 16:48:42 UTC, Jesse Phillips wrote:
 On Thursday, 2 May 2013 at 20:23:53 UTC, Diggory wrote:
 The wgl*** functions and "SwapBuffers" ARE part of the windows 
 api even though they are implemented in opengl32.dll (they are 
 declared in wingdi.h IIRC)
You recalled correctly, and according to MS these describe OpenGL 1.1. Anyway, OpenGL, and the gl.h file is not part of the Windows API. But I'd defiantly be for all the .h files in the SDK to be translated for Phobos.
You can't use OpenGL without creating a context(a window), and for that you a windowing system - either a general one(Win32/X/GTK/Qt) or an OpenGL-toolkit(GLUT/GLFW/SDL)(Yes, I know SDL is not an OpenGL toolkit, but it can function as one). Phobos does not have any windowing system - the Win32 binding are about the Windows filesystem and DLL loading, not about creating, managing and using graphical windows. That means you'll have to get an external library anyways to use OpenGL.
May 04 2013
prev sibling parent "Carlos" <checoimg gmail.com> writes:
On Thursday, 2 May 2013 at 04:27:10 UTC, evilrat wrote:
 On Thursday, 2 May 2013 at 02:07:23 UTC, Carlos wrote:
 On Wednesday, 1 May 2013 at 08:53:18 UTC, Raphaël Jakse wrote:
 Le 01/05/2013 10:42, Temtaime a écrit :
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that 
 renders one
 triangle.
You can do much better with the D programming langage. See : - http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html - http://www.emhsoft.com/ttrooper/ So yes, you can do OpenGL with D, and it works.
But where can this be learned ? Do you know any books on the subject ?
learn what? opengl is C API specification, any resource about opengl will work, the only thing required for apply it to D is to know D basics. but unfortunately for D itself it is really hard to find good tutorials
Ok
May 02 2013
prev sibling parent =?UTF-8?B?UmFwaGHDq2wgSmFrc2U=?= <raphael.jakse gmail.com> writes:
Le 02/05/2013 04:07, Carlos a écrit :
 On Wednesday, 1 May 2013 at 08:53:18 UTC, Raphaël Jakse wrote:
 Le 01/05/2013 10:42, Temtaime a écrit :
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders one
 triangle.
You can do much better with the D programming langage. See : - http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html - http://www.emhsoft.com/ttrooper/ So yes, you can do OpenGL with D, and it works.
But where can this be learned ? Do you know any books on the subject ?
Sorry for the delay. Unfortunately I'm still out of any OpenGL development. As a result, I don't have any book to suggest. I just know it is possible to develop OpenGL apps with D but I never tried myself.
May 05 2013
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2013-05-01 10:42, Temtaime wrote:

 core.sys.windows.windows doesn't have a lot of functions. It doesn't
 contain simple function DestroyWindow for example.
Declarations are basically added on a need to need basis. -- /Jacob Carlborg
May 01 2013
prev sibling next sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Wednesday, 1 May 2013 at 08:42:40 UTC, Temtaime wrote:
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders 
 one triangle.

 I was very surprised when i found, that D doesn't have 
 equivalent of gl/gl.h. Any C++ compiler has it.

 Okay, i'm investigate in it and found OpenGL in deimos.
 It doesn't support a lot of OGL function such as glPushMatrix 
 and others.

 Okay, then i found derelict3. It has a lot of OGl functions and 
 it's okay.
 When i tried to rewrite example to D, i was shocked.

 core.sys.windows.windows doesn't have a lot of functions. It 
 doesn't contain simple function DestroyWindow for example.
 It's intresting, but go ahead, i found derelict.util.wintypes 
 with missing functions. I've got a lot of "conflicts with" 
 errors, because some of functions was in derelict's wintypes 
 too. I've solved it. When i tried to link my program, i've got 
 a lot of "undefined reference" errors. Okay, i've built and 
 link derelict libraries. Then errors became stranger:
 DerelictUtil.lib(traits)  Offset 204C4H Record Type 0091
  Error 1: Previous Definition Different : _D67 
 DMD\windows\bin\..\..\src\phobos\std\traits.d.17012__ModuleInfoZ

 So i can't to rewrite simple OpenGL example that consists of 50 
 lines.
 This example works on every C++ compiler without 
 building/finding any libraries.

 Dlang's standard windows.h heade is useless, because a lot of 
 functions/structs definitions is missing.

 Dlang is a toy in outer space.
 One can only to write a+b program in schools on it.

 Now i'm understand, that's why D doesn't have popularity after 
 10+ years of existence.
don't mix mainstream language popularity drawn with all that tools and libraries over such "enthusiastic" language like D, for me(and i believe for many others too) D is an instrument of creation, like a brush in an artist hands. with such few tools available for D you can still do almost anything much better and faster than with any that tools available for C++. D has lots of advantages, but sure it has some disadvantages, like you said it's still "young", meaning that there is not so much support available from community like for C++, there are not so much commercial acceptance still like C++ has, that makes it so "successful", not because it is so good... well it is your opinion anyway, and no one is goind to ask you keep using D, but personally i just hate when someone start whine or complain about "how bad it is" just because of few fails. D requires some time investment and strong will in order to make it useful, if one don't have it, it will be a waste of time. i just wish you good luck using C++ or whatever, and please don't blame D because that is you don't want to bother to overcome any difficulties, and if i'm wrong just be kind and ask people here on forum before throwing crap on a language. and finally concerning opengl - don't bother with deimos or other stuff only if you are interested in creating your own low level wrapper libs. get helper libs such like derelict3(!) and glfw(it's too can be found in derelict) and you will be happy. just give D a chance and it will pay you back. p.s. that's not language is broken, but a linker/compiler and other essentials tools(which aren't broken in fact). p.p.s. sorry if i got you feel bad, and for being such boring when writing all this stuff.
May 01 2013
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Wednesday, 1 May 2013 at 08:42:40 UTC, Temtaime wrote:
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders 
 one triangle.

 I was very surprised when i found, that D doesn't have 
 equivalent of gl/gl.h. Any C++ compiler has it.

 Okay, i'm investigate in it and found OpenGL in deimos.
 It doesn't support a lot of OGL function such as glPushMatrix 
 and others.

 Okay, then i found derelict3. It has a lot of OGl functions and 
 it's okay.
 When i tried to rewrite example to D, i was shocked.

 core.sys.windows.windows doesn't have a lot of functions. It 
 doesn't contain simple function DestroyWindow for example.
 It's intresting, but go ahead, i found derelict.util.wintypes 
 with missing functions. I've got a lot of "conflicts with" 
 errors, because some of functions was in derelict's wintypes 
 too. I've solved it. When i tried to link my program, i've got 
 a lot of "undefined reference" errors. Okay, i've built and 
 link derelict libraries. Then errors became stranger:
 DerelictUtil.lib(traits)  Offset 204C4H Record Type 0091
  Error 1: Previous Definition Different : _D67 
 DMD\windows\bin\..\..\src\phobos\std\traits.d.17012__ModuleInfoZ

 So i can't to rewrite simple OpenGL example that consists of 50 
 lines.
 This example works on every C++ compiler without 
 building/finding any libraries.

 Dlang's standard windows.h heade is useless, because a lot of 
 functions/structs definitions is missing.

 Dlang is a toy in outer space.
 One can only to write a+b program in schools on it.

 Now i'm understand, that's why D doesn't have popularity after 
 10+ years of existence.
You've posted this to D.learn, yet you don't seem to be asking for help. You merely appear to have come here to tell us how rubbish we are. It's quite possible that there is a very easy solution to your current problem, however I'm not a windows man myself, so unfortunately I'm unlikely to be of much help. However, I will say this: If something is genuinely missing that you need, just ask for it to be included. Or, you could add it yourself and create a pull request for it. At a brief glance it looks fairly trivial to add new functions to core.sys.windows.windows (which btw you can import as std.c.windows).
May 01 2013
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Wednesday, 1 May 2013 at 08:42:40 UTC, Temtaime wrote:
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders 
 one triangle.

 I was very surprised when i found, that D doesn't have 
 equivalent of gl/gl.h. Any C++ compiler has it.

 Okay, i'm investigate in it and found OpenGL in deimos.
 It doesn't support a lot of OGL function such as glPushMatrix 
 and others.

 Okay, then i found derelict3. It has a lot of OGl functions and 
 it's okay.
 When i tried to rewrite example to D, i was shocked.

 core.sys.windows.windows doesn't have a lot of functions. It 
 doesn't contain simple function DestroyWindow for example.
 It's intresting, but go ahead, i found derelict.util.wintypes 
 with missing functions. I've got a lot of "conflicts with" 
 errors, because some of functions was in derelict's wintypes 
 too. I've solved it. When i tried to link my program, i've got 
 a lot of "undefined reference" errors. Okay, i've built and 
 link derelict libraries. Then errors became stranger:
 DerelictUtil.lib(traits)  Offset 204C4H Record Type 0091
  Error 1: Previous Definition Different : _D67 
 DMD\windows\bin\..\..\src\phobos\std\traits.d.17012__ModuleInfoZ

 So i can't to rewrite simple OpenGL example that consists of 50 
 lines.
 This example works on every C++ compiler without 
 building/finding any libraries.

 Dlang's standard windows.h heade is useless, because a lot of 
 functions/structs definitions is missing.

 Dlang is a toy in outer space.
 One can only to write a+b program in schools on it.

 Now i'm understand, that's why D doesn't have popularity after 
 10+ years of existence.
A modern example of openGL usage in D: https://github.com/kiith-sa/ICE It looks from the readme like he may have had some similar problem with linking on windows.
May 01 2013
prev sibling next sibling parent reply "Damian" <damianday hotmail.co.uk> writes:
On Wednesday, 1 May 2013 at 08:42:40 UTC, Temtaime wrote:
 I'm new in D, so i'm tried to write some in that langugage.
 That's story about how i tried to port OGL sample, that renders 
 one triangle.

 I was very surprised when i found, that D doesn't have 
 equivalent of gl/gl.h. Any C++ compiler has it.

 Okay, i'm investigate in it and found OpenGL in deimos.
 It doesn't support a lot of OGL function such as glPushMatrix 
 and others.

 Okay, then i found derelict3. It has a lot of OGl functions and 
 it's okay.
 When i tried to rewrite example to D, i was shocked.

 core.sys.windows.windows doesn't have a lot of functions. It 
 doesn't contain simple function DestroyWindow for example.
 It's intresting, but go ahead, i found derelict.util.wintypes 
 with missing functions. I've got a lot of "conflicts with" 
 errors, because some of functions was in derelict's wintypes 
 too. I've solved it. When i tried to link my program, i've got 
 a lot of "undefined reference" errors. Okay, i've built and 
 link derelict libraries. Then errors became stranger:
 DerelictUtil.lib(traits)  Offset 204C4H Record Type 0091
  Error 1: Previous Definition Different : _D67 
 DMD\windows\bin\..\..\src\phobos\std\traits.d.17012__ModuleInfoZ

 So i can't to rewrite simple OpenGL example that consists of 50 
 lines.
 This example works on every C++ compiler without 
 building/finding any libraries.

 Dlang's standard windows.h heade is useless, because a lot of 
 functions/structs definitions is missing.

 Dlang is a toy in outer space.
 One can only to write a+b program in schools on it.

 Now i'm understand, that's why D doesn't have popularity after 
 10+ years of existence.
The lack of proper windows headers is very discerning for windows users and many have argued that D should come with these by default, I do think that it does hurt D's reputation when a windows uses as to jump through hoops just to display a window. Having said that there is this: https://github.com/AndrejMitrovic/WindowsAPI , which is a nice port of the WinAPI, as for OpenGL last time I looked Derelict was the way to go. There are a couple of tools like rdmd that will make building your application a bit easier.
May 01 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-05-01 16:18, Damian wrote:

 The lack of proper windows headers is very discerning for windows users
 and many have argued that D should come with these by default, I do think
 that it does hurt D's reputation when a windows uses as to jump through
 hoops just to display a window.
You're complaining about Windows. I can tell you that it doesn't look good for anyone. To get a window on Mac OS X you need to interact with Objective-C (no I don't want to use Carbon), which is possible but it's a pain in the ass. -- /Jacob Carlborg
May 01 2013
prev sibling parent reply "Temtaime" <temtaime gmail.com> writes:
I had investigate a little more in it.
Thanks to Jack Applegame, we made a copy of gl/gl.h and 
opengl32.lib for DMD.

http://acomirei.ru/u/gl.d
http://acomirei.ru/u/opengl32.lib

I hope it will be included in DMD, now it's first draft of our 
work.
May 01 2013
parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
Temtaime wrote:

 I had investigate a little more in it.
 Thanks to Jack Applegame, we made a copy of gl/gl.h and
 opengl32.lib for DMD.
 
 http://acomirei.ru/u/gl.d
 http://acomirei.ru/u/opengl32.lib
 
 I hope it will be included in DMD, now it's first draft of our
 work.
Why on the Earth would you include opengl32 in the DMD package?? -- Dejan Lekic dejan.lekic (a) gmail.com http://dejan.lekic.org
May 01 2013
next sibling parent reply "Temtaime" <temtaime gmail.com> writes:
And why not?
If not, then you should drop support of platform specific headers 
like windows.d.

Because it's full of a drawing and many other functions. OpenGL 
is part of WinAPI.
May 01 2013
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote:
 Because it's full of a drawing and many other functions. OpenGL 
 is part of WinAPI.
Is that strictly speaking true? I didn't think opengl was part of the windows api (WinAPI) itself. Anyway, afaik opengl is not provided by c/c++ compilers. Opengl is just pre-installed on most OSs, along with its c/c++ headers, meaning it is ready to include/import and link to. It is a separate library and headers, installed separately from the compiler. However, one could make an argument that opengl is sufficiently ubiquitous that d bindings should be shipped with the compiler, similar to the core OS bindings. I personally think not, but if you disagree then I suggest making a separate thread in the main D newsgroup/forum proposing it.
May 01 2013
parent reply "Jesse Phillips" <Jessekphillips+d gmail.com> writes:
On Wednesday, 1 May 2013 at 22:33:40 UTC, John Colvin wrote:
 On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote:
 Because it's full of a drawing and many other functions. 
 OpenGL is part of WinAPI.
Is that strictly speaking true? I didn't think opengl was part of the windows api (WinAPI) itself.
It is not. DirectX isn't even part of the WinAPI and that is what Microsoft backs.
May 01 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 5/1/13 6:20 PM, Jesse Phillips wrote:
 On Wednesday, 1 May 2013 at 22:33:40 UTC, John Colvin wrote:
 On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote:
 Because it's full of a drawing and many other functions. OpenGL is
 part of WinAPI.
Is that strictly speaking true? I didn't think opengl was part of the windows api (WinAPI) itself.
It is not. DirectX isn't even part of the WinAPI and that is what Microsoft backs.
Probably would make for a good deimos addition. Andrei
May 02 2013
parent "Jesse Phillips" <Jessekphillips+D gmail.com> writes:
On Thursday, 2 May 2013 at 07:39:29 UTC, Andrei Alexandrescu 
wrote:
 On 5/1/13 6:20 PM, Jesse Phillips wrote:
 On Wednesday, 1 May 2013 at 22:33:40 UTC, John Colvin wrote:
 On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote:
 Because it's full of a drawing and many other functions. 
 OpenGL is
 part of WinAPI.
Is that strictly speaking true? I didn't think opengl was part of the windows api (WinAPI) itself.
It is not. DirectX isn't even part of the WinAPI and that is what Microsoft backs.
Probably would make for a good deimos addition. Andrei
Agreed probably would be a good pull request for https://github.com/D-Programming-Deimos/OpenGL
May 02 2013
prev sibling parent David <d dav1d.de> writes:
Am 01.05.2013 21:36, schrieb Dejan Lekic:
 Temtaime wrote:
 
 I had investigate a little more in it.
 Thanks to Jack Applegame, we made a copy of gl/gl.h and
 opengl32.lib for DMD.

 http://acomirei.ru/u/gl.d
 http://acomirei.ru/u/opengl32.lib

 I hope it will be included in DMD, now it's first draft of our
 work.
Why on the Earth would you include opengl32 in the DMD package??
Why on the Earth would you include curl in the DMD package?? - Oh wait...
May 05 2013