Re: Linking a .h file

2019-05-25 Thread Timur Gafarov via Digitalmars-d-learn

23.05.2019 13:12, infinityplusb пишет:
I'm trying to use Dagon (https://github.com/gecko0307/dagon) for what I 
thought would be a simple enough project.
Initially the one thing I needed to do was to install Nuklear and 
Freetype 2.8.1 `Under other OSes you have to install them manually` as 
I'm running on Ubuntu.


I'm using dub and thought this would be a simple matter of adding some 
parameters to the .sdl file, however I'm finding it tricky figuring out 
what to add (or if I'm oversimplifying or overcomplicating things).


So I've found either a .h file here (https://github.com/vurtun/nuklear) 
or here has something I can compile to a .so file 
(https://github.com/Timu5/bindbc-nuklear).
However no matter where I put files or whatever dub.sdl parameters I 
use, I can't seem to get it to work.

My current sdl looks like:

name "test"
description "Test"
targetType "executable"
dependency "dagon" version="0.10.0"
libs "nuklear" platform="posix"
lflags "-L/usr/local/lib/"


My latest error is
```
error while loading shared libraries: libnuklear.so.4.0.2: cannot open 
shared object file: No such file or directory


```

If it's a simple dub config thing, can someone handhold me through what 
the best way to get this to work is? Otherwise which file (.h or .so) 
should I put where for it to get picked up?


TIA


bindbc-nuklear expects nuklear.so in /usr/local/lib. Or you can compile 
Dagon without optional libraries, using "Minimal" subconfiguration in 
your dub.json:


"subConfigurations": {
"dagon": "Minimal"
}

Fonts and GUI will be unavailable then. You can also use "NoNuklear" and 
"NoFreetype" subconfigurations.


Re: Project Highlight: Timur Gafarov

2016-09-16 Thread Timur Gafarov via Digitalmars-d-announce

16.09.2016 18:12, c-v-i пишет:

On Friday, 16 September 2016 at 12:53:44 UTC, Mike Parker wrote:

What started out as a highlight of Timur's open source game, Atrium,
turned into an introduction to several of his D projects. And it looks
like I've managed to make this announcement without a typo in the
title this week. If you notice any mistakes in the blog post, please
let me know!

The post:
https://dlang.org/blog/2016/09/16/project-highlight-timur-gafarov/

reddit:
https://www.reddit.com/r/programming/comments/531po8/from_the_d_blog_introducing_an_open_source_game/



can someone build atrium ?


For all people who can't build Atrium: you either have an old source 
tree or trying to build one of the releases. Trunk in it's current state 
should compile with DMD 2.070 or LDC 1.0 - at least, under Windows and 
Linux, both 32 and 64 bit. Support for other OSes, configurations, 
compilers and DMD versions is not guaranteed.


Re: Atrium - 3D game written in D

2015-11-08 Thread Timur Gafarov via Digitalmars-d-announce

07.11.2015 21:17, Manuel König пишет:

Am Fri, 6 Nov 2015 12:04:03 +0300
schrieb Timur Gafarov <gecko0...@gmail.com>:


Atrium (code name) is a work-in-progress science fiction game with
physics based puzzles (gravity effects, force fields, etc) akin to
Portal or Inverto. The game is fully written in D, it uses custom
graphics engine based on OpenGL and SDL. Physics engine is also
written from scratch.

Source code:
https://github.com/gecko0307/atrium

IndieDB page:
http://www.indiedb.com/games/atrium

A precompiled demo for Windows:
https://www.dropbox.com/s/qh8gai2n94qe8jj/atrium-testbuild-051115.zip?dl=0


This looks very nice, congrats! I'm especially interested in the physics
and character controller part, because I'm currently developing a
character controller myself, but just a sphere character in a static
triangle world for now.

Finding a robust and fast sliding algorithm for sliding a sphere along
triangles in a given direction seems to be the hardest part. I'm
investigating two approaches, which can be simplified to:

1) move until we hit any geometry, compute new slide direction, repeat
2) move first, then project the character out of the world geometry

Both approaches work reasonably well, but there are scenarios where
they don't work so well (mostly pathetic scenarios). I'll
definitely look how you solved the problem and maybe tinker with your
physics code :)



I took rather idiomatic approach: move, detect collisions, generate 
contact points, then solve them iteratively. Sliding is obtained 
somewhat automatically.


Re: Atrium - 3D game written in D

2015-11-06 Thread Timur Gafarov via Digitalmars-d-announce

06.11.2015 12:29, stewart пишет:

On Friday, 6 November 2015 at 09:04:05 UTC, Timur Gafarov wrote:

Atrium (code name) is a work-in-progress science fiction game with
physics based puzzles (gravity effects, force fields, etc) akin to
Portal or Inverto. The game is fully written in D, it uses custom
graphics engine based on OpenGL and SDL. Physics engine is also
written from scratch.

Source code:
https://github.com/gecko0307/atrium

IndieDB page:
http://www.indiedb.com/games/atrium

A precompiled demo for Windows:
https://www.dropbox.com/s/qh8gai2n94qe8jj/atrium-testbuild-051115.zip?dl=0



Great looking game, nice work. Are there any plans to distribute the
GUI/Gfx and physics components as separate libraries?


Stew


They already exist as separate libs:
https://github.com/gecko0307/dmech
https://github.com/gecko0307/dgl

DGL (graphics engine) is currently falling behind from the game and may 
contain bugs, but I eventually update it.


Atrium - 3D game written in D

2015-11-06 Thread Timur Gafarov via Digitalmars-d-announce
Atrium (code name) is a work-in-progress science fiction game with 
physics based puzzles (gravity effects, force fields, etc) akin to 
Portal or Inverto. The game is fully written in D, it uses custom 
graphics engine based on OpenGL and SDL. Physics engine is also written 
from scratch.


Source code:
https://github.com/gecko0307/atrium

IndieDB page:
http://www.indiedb.com/games/atrium

A precompiled demo for Windows:
https://www.dropbox.com/s/qh8gai2n94qe8jj/atrium-testbuild-051115.zip?dl=0


Re: Atrium - 3D game written in D

2015-11-06 Thread Timur Gafarov via Digitalmars-d-announce

06.11.2015 13:51, Andrea Fontana пишет:

On Friday, 6 November 2015 at 09:04:05 UTC, Timur Gafarov wrote:

Atrium (code name) is a work-in-progress science fiction game with
physics based puzzles (gravity effects, force fields, etc) akin to
Portal or Inverto. The game is fully written in D, it uses custom
graphics engine based on OpenGL and SDL. Physics engine is also
written from scratch.

Source code:
https://github.com/gecko0307/atrium

IndieDB page:
http://www.indiedb.com/games/atrium

A precompiled demo for Windows:
https://www.dropbox.com/s/qh8gai2n94qe8jj/atrium-testbuild-051115.zip?dl=0



Any demo for linux too?


Linux demo will be available very soon.


Re: Atrium - 3D game written in D

2015-11-06 Thread Timur Gafarov via Digitalmars-d-announce

06.11.2015 13:51, NVolcz пишет:

On Friday, 6 November 2015 at 09:04:05 UTC, Timur Gafarov wrote:

Atrium (code name) is a work-in-progress science fiction game with
physics based puzzles (gravity effects, force fields, etc) akin to
Portal or Inverto. The game is fully written in D, it uses custom
graphics engine based on OpenGL and SDL. Physics engine is also
written from scratch.

Source code:
https://github.com/gecko0307/atrium

IndieDB page:
http://www.indiedb.com/games/atrium

A precompiled demo for Windows:
https://www.dropbox.com/s/qh8gai2n94qe8jj/atrium-testbuild-051115.zip?dl=0



Very cool!
How have it been to work with the GC?
Reddit it! Maybe with an writeup?


I tried to fully avoid GC, using my own malloc-based allocator. This 
lead to the fact that the code is not very D-ish, but it proves that 
there's perfectly possible to write real-world GC-free applications in D.


Re: Devisualization.Image

2014-11-18 Thread Timur Gafarov via Digitalmars-d-announce

15.11.2014 07:48, Rikki Cattermole пишет:

To further Devisualization, I have got the start of an image library.
It should be fairly interface complete now.

For this I really could use help from anyone with experience with PNG
especially with Adam7 interlacing and color correction such as gamma.
Currently missing an exporter. Only imports. Does not import grayscale
or palleted.

Goal: to act as the image representation within memory (including colors).
Usage:
Devisualization.Window uses it for window icon's (untested for x11 can
somebody confirm this does indeed work?).
Devisualization.Font heavily uses it for glyphs and the output of its
rasterization.

[0] https://github.com/Devisualization/image


I have working PNG export in my image processing package, part of dlib: 
https://github.com/gecko0307/dlib

There're also importers for BMP and TGA.


Re: Programming language made in D!

2014-04-10 Thread Timur Gafarov

On 10.04.2014 04:31, Harpo wrote:

Hello. Here is a programming language that is coded in D. The
documentation is included in the file. It is ment to be used as a
general purpose scripting language. Its name is HarpoScript. It has
enough features for general purpose work at the moment, however its not
exactly efficient. If you are interested check it out! Note it is only
compiled for 64bit Linux.

Link:
http://www.mediafire.com/download/cjae0pnxmjpl7au/HarpoScriptR2.tar.gz

Man, why no source code? Or, at least, API documentation or usage example?


Re: Programming language made in D!

2014-04-10 Thread Timur Gafarov

On 10.04.2014 18:47, Harpo wrote:

What do you mean? There are a couple demo programs. I also
include some individual doc that explains what the different
features are. The project may be creative commons at some point.
Running a program is just running the executable with the program
name as the parameter.


I mean without source or library/API it seems no way to embed it in 
host application, which is the point of any scripting language.


Re: dlib - d utility library

2012-09-29 Thread Timur Gafarov

28.09.2012 20:47, Peter Alexander пишет:

On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:

dlib is a growing collection of native D language libraries serving as
a framework for various higher-level projects - such as game engines,
rendering pipelines and multimedia applications. It is written in D2
and has no external external dependencies aside D's standart library,
Phobos.


A note on your Vector implementation. Currently you use the vector
operators, e.g.

Vector!(T,size) opAddAssign (Vector!(T,size) v)
body
{
arrayof[] += v.arrayof[];
return this;
}

This is fine for large vectors, but (correct me if I'm wrong), your
vector class appears to be designed for small vectors. Those vector ops
currently call a asm optimised function that uses SIMD instructions in a
loop - it works well for larger vectors with hundreds of elements, but
for small vectors it's significantly faster to just use:

foreach (i; 0..size)
arrayof[i] += v.arrayof[i];


I've also noticed that you've provided Matrix2x2 and Matrix4x4 as
separate structs from the more generic Matrix. I'm guessing this is for
specialisation. A more idiomatic way to handle this would be to use
template specialisation to provide the optimised versions. That way,
when people use Matrix!(T, 2, 2) they get all the benefits of
Matrix2x2!T as well.


Thanks! I didn't realize that about vectors. I'm interested in 
performance optimization, so I will fix that as soon as possible.


As for matrices - I used Matrix4x4 for a long time (that was just the 
simplest way), and recently introduced that generalized version. 
Eventually I will port everything into it.


dlib - d utility library

2012-09-28 Thread Timur Gafarov
dlib is a growing collection of native D language libraries serving as a 
framework for various higher-level projects - such as game engines, 
rendering pipelines and multimedia applications. It is written in D2 and 
has no external external dependencies aside D's standart library, Phobos.


Currently dlib contains the following packages:

dlib.core - standard algorithms, data structures, useful templates, etc.

dlib.functional - some functional programming idioms (HOFs, combiners, 
quantifiers, etc.)


dlib.math - linear algebra (vectors, matrices, quaternions, etc.)

dlib.geometry - computational geometry (ray casting, primitives, etc.)

dlib.image - image processing (filters, color correction, graphics 
formats I/O, support for 8 and 16-bit RGBA buffers and floating point 
operations).


http://code.google.com/p/dlib/