February 16, 2012
On 2/16/2012 3:32 AM, Chris Pons wrote:
> On Wednesday, 15 February 2012 at 15:41:02 UTC, Kiith-Sa wrote:
>> On Wednesday, 15 February 2012 at 06:51:11 UTC, RedShift wrote:
>>> Can I use OpenGL or DirectX with D? If so, where can I find a guide
>>> to get everything setup?
>>
>> Derelict provides bindings for OpenGL and SDL (and many other
>> game-related libraries) - these are used exactly the same way they are
>> used in C/C++, so any
>> OpenGL/SDL tutorials for C/C++ apply.
>>
>> Derelict has a few of its own functions that can/need to be called
>> when initializing, described in its documentation.
>>
>> The current stable version of Derelict supports only OpenGL up to 2.1
>> and SDL 1.2, but support for OpenGL 3.0+ and SDL2 is being worked on.
>>
>> For the current development version, see
>>
>> https://github.com/aldacron/Derelict3
>>
>> (Derelict moved to GitHub recently)
>
> Ok, So let me get this straight. I can use Derelict with OpenGL 3. ish,
> and support for 4.0 is on the way.

No -ish to it :-) Up to 3.3 is fully supported. However, 3.x support was sort of hacked on to the existing framework and isn't entirely intuitive. It has to do with the way ARB extensions are reused in 3.x and how that doesn't fit well with DerelictGL's internal architecture. A recent post on the Derelict forums describes what to do.

>
> I can also use any tutorials to learn Opengl?

Any tutorials for C or C++ will work just the same for D.

>
> That is really good news.
>
>

February 16, 2012
On 2/16/2012 4:07 AM, Chris Pons wrote:
> I am sorry about the double post. I am in the middle of trying to
> install derelict following this tutorial:
>
> http://h3.gd/dmedia/?n=Tutorials.SdlGlTutorial1
>
> However, when I get to the third step I get this error:
>
>
> Error 1 Error: module gl is in file 'derelict\opengl\gl.d' which cannot
> be read D:\Documents\Projects\Test\Test\main.d 3
>
> I am assuming this means that gl.d can not be found. However, my
> derelict source files are in
>
> .../dmd2/src/ext/derelict/

Probably not a good idea to put this in the dmd directory. It makes it less easy to upgrade dmd.

>
> In my VS project under the options panel, I pointed my DMD install path
> to D:\Documents\Projects\DMD2 .
>
> Do I need to set the Import and Library path as well?

Yes. When you compile Derelict2, .di files are generated in the import subdirectory and the libraries in the lib subdirectory. I would just pass -I<derelict-root>/import on the command line, and add pragma(lib, "path/to/DerelictSomething.lib" or (libDerelictSomething.a) to your source modules.
1 2
Next ›   Last »