Re: OpenGL with D tutorials

2016-05-22 Thread Rishub Nagpal via Digitalmars-d-learn

On Sunday, 22 May 2016 at 12:13:07 UTC, ixid wrote:
What is the best OpenGL tutorial with D to use? I've tried to 
use d-gamedev-intro and opengl-tutorials and seem to get 
errors, files that are no longer included are needed (dgl)? and 
deprecation messages.


Perhaps use a C++ tutorial : http://www.learnopengl.com/
You can attempt to do the examples in D using GFM


Re: Game Development Using D

2016-05-21 Thread Rishub Nagpal via Digitalmars-d-learn

On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote:

Hi,

I want to try to create a game using D. I'm a complete newbie 
though (other than having C/C++ experience). Where would I 
start? Does D have an openGL binding? I am assuming I'll need 
to leverage a good amount C APIs? Any list of these that would 
be useful it a game setting?


Obviously this all depends on *how* much work I want to do. 
Ideally, I'd like a collection of tools that will get me 
roughly the equivalent of what XNA provides.


Also forgot to add this : 
http://defenestrate.eu/_static/ossvikend/intro-gamedev-d/slides/index.html


It's an intro to D game dev




Re: Game Development Using D

2016-05-21 Thread Rishub Nagpal via Digitalmars-d-learn

On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote:

Hi,

I want to try to create a game using D. I'm a complete newbie 
though (other than having C/C++ experience). Where would I 
start? Does D have an openGL binding? I am assuming I'll need 
to leverage a good amount C APIs? Any list of these that would 
be useful it a game setting?


Obviously this all depends on *how* much work I want to do. 
Ideally, I'd like a collection of tools that will get me 
roughly the equivalent of what XNA provides.


I use GFM, https://github.com/d-gamedev-team/gfm

It's pretty easy to use and saves alot of headache. Downside is 
that the documentation is somewhat outdated (namely close() 
functions are deprecated, you have to use the destroy attribute, 
or typecons).


SDL + OpenGL is easy with GFM.

here is a good opengl tutorial : http://www.learnopengl.com/


How to make a logger (possible bug)

2016-05-17 Thread Rishub Nagpal via Digitalmars-d-learn

https://dlang.org/phobos/std_experimental_logger_filelogger.html

import std.experimental.logger;

void main()
{
auto l1 = new FileLogger("logFile", "loggerName");
}

throws an error:

Error: none of the overloads of '__ctor' are callable using 
argument types (string, string), candidates are:


Is this an error in the documentation?


Dub failing to detect Shared Libraries

2014-08-05 Thread Rishub Nagpal via Digitalmars-d-learn
I am porting DerelictBGFX to linux, but I am having some 
problems. When I run the dub command in my example directory, I 
get the following error :


derelict.util.exception.SharedLibLoadException@../../../.dub/packages/derelict-util-1.0.2/source/derelict/util/exception.d(35): 
Failed to load one or more shared libraries:
	libbgfx-shared-libRelease.so - libbgfx-shared-libRelease.so: 
cannot open shared object file: No such file or directory
	libbgfx-shared-libDebug.so - libbgfx-shared-libDebug.so: cannot 
open shared object file: No such file or directory



Here is the file I edited to detect those libaries : 
https://github.com/shrub77/DerelictBgfx/blob/master/source/derelict/bgfx/bgfx.d#L55


Here is the dub.json :
{
name: 00-helloworld,

sourcePaths: [.],
targetType: executable,
mainSourceFile: helloworld.d,

dependencies:
{
gfm:sdl2: =1.1.4,
derelict-bgfx: {path: ../../, version: ~master}
}
}

Where should I put the *.so files so they can be detected 
properly by dub?


Rishub



Passing an array by reference?

2014-07-24 Thread Rishub Nagpal via Digitalmars-d-learn

  1 class Test
  2 {
  3 int[][] array;
  4 this(ref int[][] d)
  5 {
  6 array = d;
  7 }
  8
  9 }
 10
 11 void main()
 12 {
 13 Test t = new Test([[1,1],[1,1]]);   //does not compile
 14 }
 15


what is the best way to pass a literal ([[1,2],[3,4]]) by 
reference? Is using ref the best way? I am still a bit fuzzy with 
in/out and scope