I was recently looking up how to assign a unique ID based on each
different implementation of a templated type (NOT per instance,
but per unique type). For example:
class MyTemplate(T) {
//the ? where the actual number would go
const int type_id = ?;
}
void main() {
auto a = new
On Friday, 12 July 2013 at 03:56:50 UTC, JS wrote:
sure, each type name is unique. All you have to do is convert
them to an int... use a hash or some other method or just use
the string names. If you need the id's to be continuous try to
use an set(array) of the type names. Not sure if the
On Friday, 12 July 2013 at 04:42:28 UTC, Jonathan M Davis wrote:
On Friday, July 12, 2013 05:15:43 Roderick Gibson wrote:
I was recently looking up how to assign a unique ID based on
each
different implementation of a templated type (NOT per instance,
but per unique type). For example:
class
On Friday, 12 July 2013 at 04:42:28 UTC, Jonathan M Davis wrote:
Now, it's probably possible to use static constructors to use
global mutable
state to intialize all of those IDs when the program starts up,
which would
initialize the IDs to incrementing values, so they could be
immutable if you
On Tuesday, 2 July 2013 at 06:54:58 UTC, bearophile wrote:
Roderick Gibson:
Variant is a possiblity. How is the performance with large
containers of these, since these structures will likely hold
the majority of the data in the game?
You probably have to benchmark yourself. (But I have
On Tuesday, 2 July 2013 at 21:45:57 UTC, bearophile wrote:
Roderick Gibson:
I should know the types at compile time, so I will be using it
most likely, but reading the docs it looks like Algebraic is
built on top of the same structure as Variant. Is there any
difference in implementation
I'm asking because I'm doing some game development in D and I've
come upon the entity component architecture, and it looks like a
good way to handle the complexity and interdependency that games
seem to have.
The components wind up being plain old data types (I currently
use structs), with
On Monday, 1 July 2013 at 12:16:50 UTC, bearophile wrote:
Roderick Gibson:
auto entities = new Entities();
auto entity_id = entities.createEntity();
entities.addComponent!(position)(entity_id, pos);
entities.addComponent!(movement)(entity_id, mov);
entities.addComponent!(collision)(entity_id
On Monday, 22 April 2013 at 20:57:56 UTC, Dementor561 wrote:
On Monday, 22 April 2013 at 20:47:32 UTC, Minas Mina wrote:
If you aren't comfortable with either C++ or D I would suggest
to do the tutorials with C++, as there are no OpenGL tutorials
for D. Don't try to learn two things at the
On Sunday, 21 April 2013 at 15:21:00 UTC, Dementor561 wrote:
On Saturday, 20 April 2013 at 22:25:42 UTC, Roderick Gibson
wrote:
On Saturday, 20 April 2013 at 15:49:47 UTC, Dementor561 wrote:
I have all the needed files to use Direlect3, and I have
Mono-D installed on Xamarin, I was wondering
On Sunday, 21 April 2013 at 15:21:00 UTC, Dementor561 wrote:
On Saturday, 20 April 2013 at 22:25:42 UTC, Roderick Gibson
wrote:
On Saturday, 20 April 2013 at 15:49:47 UTC, Dementor561 wrote:
I have all the needed files to use Direlect3, and I have
Mono-D installed on Xamarin, I was wondering
On Sunday, 21 April 2013 at 19:49:14 UTC, Dementor561 wrote:
Well, sorta. When I add import derelict.glfw3.glfw3; it says
the library could not be resolved... Do I need to add something
to the library somewhere?
Any library you use you have to add to the project linker
settings. Derelict3
So I needed a coherent noise generator and decided to look at libnoise.
Noticing it was rather small I decided I would just port it over to d
and be done with it, as I expected it would help me understand d a bit
better (it has).
My problems all seem to stem from the const qualifier, which is
On 2/7/2012 7:58 PM, Daniel Murphy wrote:
It seems the problem you've run into is that a class reference cannot be
tail-const.
Pointers can be tail-const like this:
const(Data)*
but there is no way currently (there are proposals) to make only the data
and not the reference const.
A workaround
On 10/9/2011 5:18 PM, deadalnix wrote:
Le 09/10/2011 12:00, Zardoz a écrit :
Recently I've been asked if I could give a speech about D in my
university. It
will be of one hour of long.
I not respond yet, but I think that I will do it. Actually I have the
problem
that I don't know well how
On 10/7/2011 7:33 PM, Andrej Mitrovic wrote:
You don't have to rewrite Vector for multiple dimensions, methinks:
class Vector(T...) {
this(T t) {}
}
void main()
{
alias Vector!(float, float) vec2f;
auto v = new vec2f(1.0,1.0);
}
You'll probably have to play with `static if`,
On 10/7/2011 11:35 PM, Ali Çehreli wrote:
On Fri, 07 Oct 2011 18:29:26 -0700, Roderick Gibson wrote:
This may be the completely wrong approach, but I am basically thinking
of something like this (I am aware this will not compile, it's
psuedocode):
class Vector(T) {
... //definition
On 10/5/2011 7:46 AM, Ola Ost wrote:
I had exactly this problem too, I asked on the Derelict forums:
http://www.dsource.org/forums/viewtopic.php?t=5856sid=8ebff671fafec3bd8962ddfceaf99eb8
At the moment I've resolved this by building Derelict with make, first a normal
full
build, then a second
This may be the completely wrong approach, but I am basically thinking
of something like this (I am aware this will not compile, it's psuedocode):
class Vector(T) {
... //definition here
}
alias Vector(float, float) vec2f;
auto v = new vec2f(1.0,1.0);
I am making a templated Vector
It's my first foray into the arcana of makefiles and command line compiling.
My makefile looks like this:
IMPORT = -IC:\Dlang\dmd2\src\ext\Derelict2\import
LIB_PATHS = -LC:\Dlang\dmd2\src\ext\Derelict2\lib
LIB_INCLUDES = DerelictSDL.lib DerelictGL.lib DerelictUtil.lib
all:
dmd
On 9/29/2011 2:15 PM, Nick Sabalausky wrote:
Nick Sabalauskya@a.a wrote in message
news:j62msu$205t$1...@digitalmars.com...
Roderick Gibsonknit...@gmail.com wrote in message
news:j62d4i$1d8l$1...@digitalmars.com...
It's my first foray into the arcana of makefiles and command line
compiling.
On 9/29/2011 2:39 PM, Nick Sabalausky wrote:
Roderick Gibsonknit...@gmail.com wrote in message
news:j62nvo$2237$1...@digitalmars.com...
On 9/29/2011 2:15 PM, Nick Sabalausky wrote:
Nick Sabalauskya@a.a wrote in message
news:j62msu$205t$1...@digitalmars.com...
Roderick
22 matches
Mail list logo