Error when using `import`.

Liam McGillivray yoshi.pit.link.mario at gmail.com
Mon Feb 26 23:27:49 UTC 2024


I don't know whether I should continue this topic or start a new 
one now that the problem mentioned in the title is fixed. I have 
now uploaded some of the code to [a GitHub 
repository](https://github.com/LiamM32/Open_Emblem).

To make this game usable, I will need a library for graphics and 
input. I don't have any experience with making GUI programs aside 
from a little bit with Qt and C++.

I have considered the following libraries:
- ~~SDL~~: Seems too low-level for me.
- Allegro via 
[DAllegro5](https://github.com/SiegeLord/DAllegro5): I found some 
C & C++ tutorials for this one, but I don't know how I would do 
it with D. This one looks difficult.
- ~~Imgui via 
[Dimgui](https://github.com/d-gamedev-team/dimgui)~~: While 
[Imgui](https://github.com/ocornut/imgui?tab=readme-ov-file) 
looks well-developed, the Dimgui readme links to [this 
repository](https://github.com/AdrienHerubel/imgui), which looks 
like a very old version of Imgui.
- Godot via 
[Godot-Dlang](https://github.com/godot-dlang/godot-dlang?tab=readme-ov-file#manually-creating-project): A well-developed game engine with an editor that may allow me to get fancier graphics without a huge amount of effort. However, the project page for Godot-Dlang gives a warning that it's unfinished. This may or may not be a problem given that this is just a hobby project. I would be happy to share any problems with the developers.
- SFML via [BindBC-SFML](https://github.com/BindBC/bindbc-sfml): 
SFML appears to be an easier way to get 2D graphics working 
compared to SDL & Allegro when using C++. However, it may take 
more effort to use it with D.
- [AE](https://github.com/CyberShadow/ae): This is a D library 
that provides graphics and other utilities using various C 
libraries. I am beginning to understand this one, as I've been 
looking at the provided demos. However, this one seems to SDL 
functions directly whenever an image is placed on-screen, which I 
don't understand the theory behind.

I have writing the code for the internal game logic as a library 
that can be used by various front-ends for graphics. This would 
let me experiment with different software for graphics, but it 
would make the code more complicated.

So far I have been attempting to get it working with AE for 
graphics, not using the library approach described above. I 
haven't committed it with git, as I have copied and pasted 
substantial code from the AE examples and I will need to look at 
the license before I share it. I have managed to get it to read a 
PNG using libpng, but not display it. I have had trouble with 
this. One of the demos uses a function `s.draw` for displaying an 
image, which isn't defined anywhere in AE, so it might be an SDL 
function. I don't know how it has access to it.

I chose to use D for this project because I have long wanted to 
learn the language, but I wonder if it's overkill for this 
project, given the low performance requirement. Maybe I would be 
better-off using a dynamic interpreted language. The benefit of D 
is largely for the learning experience.


More information about the Digitalmars-d-learn mailing list