when I run dub within git bash, dub prompts are not displayed. For instance...

2017-06-10 Thread WhatMeWorry via Digitalmars-d-learn
kheaser@IT-ASST-SB MINGW64 /c/Users/kheaser/Git/Delivery/projects (master) $ dub init 00_01_print_ogl_ver ... All this white space here is me just pressing the Enter key ... to get the default values. Package recipe format (sdl/json) [json]: Name [00_01_print_ogl_ver]: Description [A minim

Dub or Dmd trying to use some funny path to find linker.exe

2017-06-10 Thread WhatMeWorry via Digitalmars-d-learn
Dub or Dmd dies when it can't find the linker. Like so: C:\Users\kheaser\Git\Delivery\projects\00_01_print_ogl_ver>dub run --arch=x86_64 --force Performing "debug" build using dmd for x86_64. derelict-util 2.0.6: building configuration "library"... derelict-al 1.0.3: building configuration "l

Re: First time user of LDC and getting newbie problems.

2017-06-13 Thread WhatMeWorry via Digitalmars-d-learn
On Tuesday, 13 June 2017 at 12:39:53 UTC, Joseph Rushton Wakeling wrote: On Tuesday, 13 June 2017 at 12:38:03 UTC, Joseph Rushton Wakeling wrote: On Sunday, 11 June 2017 at 21:58:27 UTC, WhatMeForget wrote: Just trying to compile a "Hello World" using dub and ldc2. I presume from your command

unresolved external symbol error (How to resolve?)

2017-07-22 Thread WhatMeWorry via Digitalmars-d-learn
Linking... 01_06_coord_systems.obj : error LNK2001: unresolved external symbol _D11common_game12__ModuleInfoZ 01_06_coord_systems.obj : error LNK2001: unresolved external symbol _D14post_processor12__ModuleInfoZ I've gotten plenty of undefined external symbol errors in my time but how does o

Re: I feel the dynamic array .sizeof property is kind of a bait and switch

2017-07-26 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 02:31:33 UTC, Mike Parker wrote: On Wednesday, 26 July 2017 at 02:24:06 UTC, WhatMeForget wrote: [...] Because .sizeof has nothing to do with how many elements are in the array. It tells you how much space the array itself takes up. Totally agree. .length ret

Re: I feel the dynamic array .sizeof property is kind of a bait and switch

2017-07-26 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 26 July 2017 at 02:32:07 UTC, Adam D. Ruppe wrote: I've hand rolled a function which is working for me currently, but with my coding ability, I'd feel much safer with something official :) You could also do (cast(ubyte[]) array).length. This was my (way over complicated) att

Re: real simple delegate question.

2017-08-19 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 18 August 2017 at 20:39:38 UTC, angel wrote: On Friday, 18 August 2017 at 02:38:15 UTC, WhatMeForget wrote: [...] This actually appears correct ... The 1-st example: Each call to makeCalculator() increments a static (i.e. shared among all makeCalculator() instances) variable - cont

Mixed up over mixins.

2017-08-20 Thread WhatMeWorry via Digitalmars-d-learn
It's stuff like this which makes me very frustrated. Or depressed because it demonstrates just how poor a programmer I am: string printStatement(string message) { return `writeln("` ~ message ~ `");`; } void main() { // Mixins are for mixing in generated code into the source code.

Re: Real beginner traits question

2017-09-25 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 25 September 2017 at 06:07:58 UTC, H. S. Teoh wrote: On Mon, Sep 25, 2017 at 05:28:13AM +, WhatMeForget via Digitalmars-d-learn wrote: [...] You're not the only one. I stared at this same piece of documentation for a long time before I figured out what it meant. This is anoth

This used to compile for months and months, and now it aborts with Error writing file derelict-assimp3-1.3.0

2017-09-26 Thread WhatMeWorry via Digitalmars-d-learn
I don't know the first step about how to trouble shoot this? I haven't changed anything with my configuration. Using dub registry url 'http://code.dlang.org/' Refreshing local packages (refresh existing: true)... Looking for local package map at C:\ProgramData\dub\packages\local-packages.js

Re: splitter string/char different behavior

2017-09-30 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 30 September 2017 at 18:21:11 UTC, Jon Degenhardt wrote: On Saturday, 30 September 2017 at 17:17:17 UTC, SrMordred wrote: [...] It's easy to overlook, but documentation for splitter starts out: Lazily splits a range using an element as a separator. An element of a string

Infuriating DUB/DMD build bug.

2017-10-05 Thread WhatMeWorry via Digitalmars-d-learn
I've got a github project and using DUB with DMD and I keep running into this problem. I've tried deleting the entire ...\AppData\Roaming\dub\packages folder, but the problem repeats the very next build attempt. Fetching derelict-util 2.0.6 (getting selected version)... Fetching derelict-ft 1

Any derelict fmod users on Linux out there?

2017-12-07 Thread WhatMeWorry via Digitalmars-d-learn
I've tried debugging this for hours to no avail. It works on Windows and Mac fine. But I'm running Antergos Linux (very much like Arch) and it keeps failing at the System Init line. The code is pretty much a copy of the example of derelict fmod on github. I have no idea what the "bindings" num

Dub project has both .sdl and .json files. Is this normal or did I do something wrong?

2017-12-18 Thread WhatMeWorry via Digitalmars-d-learn
I've been using Dub for a while but from the very beginning I decided to go with SDL 100% of the time, So I've got a dub.sdl file like: name "01_10_camera_view_space" description "A minimal D application." authors "kheaser" copyright "Copyright © 2017, kheaser" license "proprietary" dependen

How to I get the dub package version that I want...

2017-12-22 Thread WhatMeWorry via Digitalmars-d-learn
I can compile the derelict-fmod example with dub.json ... "dependencies": { "derelict-util": ">=1.9.1" ... and dub.selections.json ... "versions": { "derelict-util": "2.1.0" ... dub run Fetching derelict-util 2.

Is there a way to get this associative array initialization to work?

2018-01-09 Thread WhatMeWorry via Digitalmars-d-learn
enum SoundType { MUSIC = 0, SOUND_EFFECT }; struct Sound { string file; SoundType musicOrSfx; void* ptr; // Mix_Chunk* for sfx; Mix_Music* for music; } immutable Sound[string] soundLibrary = // line 148 [ "SCRATCH" : { file : "scratch.wav", musicOrSfx :

How to move an associative array between modules?

2018-01-11 Thread WhatMeWorry via Digitalmars-d-learn
I've built a sound.d module with lots data types, free functions (initAndOpenSound() loadSound()), and enums etc. In my main/app.d module, I've created the the following associative array: void main(string[] argv) { initAndOpenSound(); Track[string] tracks = [ "SCRATCH"

Re: How to move an associative array between modules?

2018-01-12 Thread WhatMeWorry via Digitalmars-d-learn
On Thursday, 11 January 2018 at 23:29:30 UTC, Adam D. Ruppe wrote: On Thursday, 11 January 2018 at 23:20:44 UTC, WhatMeWorry wrote: When I simply move the array out of main() but still in app.d, the compiler returns Error: expression ["SCRATCH":Track("scratch.wav", cast(Sound)1, 0, null),... i

Shouldn't D be added to this list?

2018-02-06 Thread WhatMeWorry via Digitalmars-d-learn
Sorry if this is the wrong place to post, but I just came across this just now: https://www.khronos.org/opengl/wiki/Language_bindings I was thinking that with derelictGL, D should be on this list? If so, I'm not sure how one would go about this?

does the shared keyword work with mutable structs?

2018-03-08 Thread WhatMeWorry via Digitalmars-d-learn
I read where shared classes have not been implemented yet. So I'm using just a struct e below: But the output below is showing that sharing is not happening between Struct in main() and the various spawned threads. I'm I doing something wrong? creating queue in EventBuffer constructor even

Re: does the shared keyword work with mutable structs?

2018-03-09 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 9 March 2018 at 10:42:47 UTC, Kagamin wrote: To make a struct noncopyable, add @disable this(this); to it, then compiler will give an error on an attempt to copy it. I tried the @disable this(this); but now it doesn't even compile? Error: template std.concurrency.spawn cannot deduce

Re: why use string for this example of appender?

2018-04-16 Thread WhatMeWorry via Digitalmars-d-learn
Thanks all. I sometimes feel like Michael Corleone: "Just when I thought I was out, they pull me back in!" :) I realize it is not the place for it, but sometimes I wish the Library Reference explained things in terms of "why".

Does DUB create .dll files?

2016-05-16 Thread WhatMeWorry via Digitalmars-d-learn
I just incorporated DerelictALURE into a project and it compiled and linked fine, but when I ran the executable, it aborted with: derelict.util.exception.SharedLibLoadException@N:\DUB_Packages\DerelictOrg\DerelictUtil\source\derelict\util\exception.d(35): Failed to load one or more sharedlibra

How to Deify char**

2016-05-17 Thread WhatMeWorry via Digitalmars-d-learn
I'm weak enough with C pointers, but when I see char** my brain freezes up like a deer caught in headlights. Can anyone translate the below C call into D? ALURE_API const ALCchar** ALURE_APIENTRY alureGetDeviceNames(ALCboolean all,ALCsizei *count) // my poor attempt to Deify it int coun

Does this C callback call look correct?

2016-05-27 Thread WhatMeWorry via Digitalmars-d-learn
// Specification from ALURE documentation ALURE_API ALboolean ALURE_APIENTRY alurePlaySourceStream( ALuint source, alureStream *stream, ALsizei numBufs, ALsizei loopcount, void(*eos_callback)(void *userdata, ALuint source), void*userdata ) // My D code, below compil

Re: Does this C callback call look correct?

2016-05-28 Thread WhatMeWorry via Digitalmars-d-learn
Never mind. D was fine. Needed an alureUpdate() to trigger the call back.

Quite sure a simple basic problem...

2016-06-01 Thread WhatMeWorry via Digitalmars-d-learn
I've got a fairly complex D project (25+ modules) that has grown haphazardly over time. So it is not well designed. But I want to get the thing fully ported before refining the code. (that's called refactoring, I believe?) Anyway, there is a new module called audio.d which which has all the s

Probably trivial Linux link problem that I've spent hours on.

2016-07-04 Thread WhatMeWorry via Digitalmars-d-learn
Just learning Linux. Got my first vibe/dub project which dies at: Compiling diet template 'index.dt'... Linking... /usr/bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit status I downloaded DUB's d2sqlite3 and built it fine. I've got sqlite3 on my system by default (came with Xu

Probably a real simple compile-time reflection question?

2016-07-09 Thread WhatMeWorry via Digitalmars-d-learn
class C { this(){ _i = 0; _j = 0; } void setVar(int i) { _i = i; } int getVar() { return _i; } int _i; int _j; } writeln("C"); foreach( i, str; myClassMembers) { writeln("member ", i, " = ", str); TypeInfo ti = typeid(str); writeln("type id is ", ti);

Re: sorting std.container

2016-07-11 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 11 July 2016 at 19:07:51 UTC, ketmar wrote: list slices are not random-access ranges, thus they can't be sorted in-place (this is what std.algorithm.sort does). so the only way is to convert list to array, sort it, and make a list from sorted array. probably not something you want. ;

Is there a way to "see" source code generated by templates after a compile?

2016-07-16 Thread WhatMeWorry via Digitalmars-d-learn
I don't suppose there's a way to "see" source code generated by templates after a compile but before execution? Or does the compiler generate it to a lower level on the fly; thus losing the source code? I'm assuming no because if there were a way, I'd of come across it by now :) Now th

Re: Is there a way to "see" source code generated by templates after a compile?

2016-07-17 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 17 July 2016 at 11:14:39 UTC, Stefan Koch wrote: On Sunday, 17 July 2016 at 05:57:52 UTC, WhatMeWorry wrote: I don't suppose there's a way to "see" source code generated by templates after a compile but before execution? Or does the compiler generate it to a lower level on the fl

Re: Is there a way to "see" source code generated by templates after a compile?

2016-07-18 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 18 July 2016 at 07:37:27 UTC, lobo wrote: On Sunday, 17 July 2016 at 05:57:52 UTC, WhatMeWorry wrote: [snip] Now that I think about, was there even a way to look at c/c++ code after the pre-processor step? Does this do what you want? cl.exe /E gcc -E clang -E clang-cl /E i

Re: Is there a way to "see" source code generated by templates after a compile?

2016-07-19 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 17 July 2016 at 05:57:52 UTC, WhatMeWorry wrote: I don't suppose there's a way to "see" source code generated by templates after a compile but before execution? Or does the compiler generate it to a lower level on the fly; thus losing the source code? I'm assuming no because if

How to pause terminal in D on Linux?

2016-07-23 Thread WhatMeWorry via Digitalmars-d-learn
What I thought would be trivial is becoming a nightmare. Can anybody set me straight. Thanks in advance. void writeAndPause(string s) { writeln(s); // writeln("Press any key to continue..."); // works fine on Windows // executeShell("pause");// works fine on W

Anybody use FreeImage on Linux with D?

2016-07-27 Thread WhatMeWorry via Digitalmars-d-learn
I've been stumped for several days trying to resolve this run time error. I'm pretty new with Linux. No problem on Windows. DerelictFI.load("/home/generic/MySharedLibraries/libfreeimage.so"); before DerelictFI.load derelict.util.exception.SymbolLoadException@../../../.dub/packages/derelict-

minor question of the difference between " and '

2016-08-10 Thread WhatMeWorry via Digitalmars-d-learn
string pwdxCommand = escapeShellCommand("pwdx", to!string(pid)); writeln("pwdxCommand = ", pwdxCommand); Output: Current process ID: 7962 pwdxCommand = 'pwdx' '7962' I'm confused as to why the writeln statement didn't output "pwdx 7962"? Afterall, isn't that the definition of a strin

DUB saying my Linux exe file is "not an executable file" even though DUB built it

2016-08-13 Thread WhatMeWorry via Digitalmars-d-learn
Not a lot to work with here. I'm a beginner Linux user. $ dub build --force Performing "debug" build using dmd for x86_64. derelict-util 2.0.6: building configuration "library"... derelict-gl3 1.0.18: building configuration "library"... derelict-glfw3 3.1.0: building configuration "derelict-glf

Re: DUB saying my Linux exe file is "not an executable file" even though DUB built it

2016-08-13 Thread WhatMeWorry via Digitalmars-d-learn
$ sudo chmod -v 777 * mode of 'HelloWindow' changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx) $ ls -al total 3016 drwxr-xr-x 2 generic generic4096 Aug 13 16:48 . drwxr-xr-x 7 generic generic4096 Aug 12 23:14 .. -rw-r--r-- 1 generic generic 3080080 Aug 13 16:48 HelloWindow Now I'm real

Re: DUB saying my Linux exe file is "not an executable file" even though DUB built it

2016-08-13 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 14 August 2016 at 01:05:33 UTC, Basile B. wrote: On Saturday, 13 August 2016 at 21:56:49 UTC, WhatMeWorry wrote: $ sudo chmod -v 777 * mode of 'HelloWindow' changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx) $ ls -al total 3016 drwxr-xr-x 2 generic generic4096 Aug 13 16:48 . drw

Re: DUB saying my Linux exe file is "not an executable file" even though DUB built it

2016-08-14 Thread WhatMeWorry via Digitalmars-d-learn
This is the actual problem that cause trouble. Your flash drive is probably Fat32 or NTFS formatted rather than ext4. Since those file systems do not support "executable attribute", Linux will silently fail to give files the attribute which results in these sort of surprises. You may wonder why

Converting a Visual Studio Solution with many Projects into DUB package?

2016-08-16 Thread WhatMeWorry via Digitalmars-d-learn
I've got a large Visual Studio Solution which contains lots of Projects. Each project is a standalone D/OpenGL tutorial. I want to make it OS and IDE agnostic so it can be easily played with on Windows, Linux, and Mac OS so I thought it best to make it a dub package. I've been reading the

DerelictGL3.reload with specified path question.

2016-08-17 Thread WhatMeWorry via Digitalmars-d-learn
I want to store all my shared/dynamic libraries within a special directory relative to where the application directory is. All of the derelictXX.loads(path) compiles except DerelictGL3.reload(lib); which doesn't seem to be implemented. All the reloads in github are either empty or use the ver

Re: DerelictGL3.reload with specified path question.

2016-08-17 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 17 August 2016 at 23:21:59 UTC, Rene Zwanenburg wrote: On Wednesday, 17 August 2016 at 22:59:31 UTC, WhatMeWorry wrote: I want to store all my shared/dynamic libraries within a special directory relative to where the application directory is. All of the derelictXX.loads(path) comp

Re: DerelictGL3.reload with specified path question.

2016-08-17 Thread WhatMeWorry via Digitalmars-d-learn
On Thursday, 18 August 2016 at 03:11:17 UTC, WhatMeWorry wrote: On Wednesday, 17 August 2016 at 23:21:59 UTC, Rene Zwanenburg wrote: On Wednesday, 17 August 2016 at 22:59:31 UTC, WhatMeWorry wrote: I want to store all my shared/dynamic libraries within a special directory relative to where the

is this a typographical bug?

2016-08-30 Thread WhatMeWorry via Digitalmars-d-learn
Error: module std.string import 'removeChars' not found, did you mean template 'removechars(S)(S s, in S pattern) if (isSomeString!S)'? Shouldn't it be removeChars? All the other library calls seem to be camelCased. Should i not bother to open a change request because this would cause too mu

May be a simple dub answer if my question even makes sense?

2016-09-23 Thread WhatMeWorry via Digitalmars-d-learn
I have D opengl/glfw3 program that I wrote which compiles and runs fine, but I always felt it was a bit of a Visual Studio hack. So I thought I'd start anew but this time use dub from the get go. So I did dub int...etc. And put my existing code into the app.d file. But when I try to buil

Re: May be a simple dub answer if my question even makes sense?

2016-09-24 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 24 September 2016 at 06:05:11 UTC, Mike Parker wrote: On Saturday, 24 September 2016 at 02:33:22 UTC, WhatMeWorry wrote: I see that dub has all the .d import files already placed in C:\Users\Me\AppData\Roaming\dub\packages\derelict-gl3-1.0.19\derelict-gl3\source\derelict\opengl3

Re: May be a simple dub answer if my question even makes sense?

2016-09-25 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 25 September 2016 at 00:52:26 UTC, Mike Parker wrote: On Saturday, 24 September 2016 at 16:51:47 UTC, WhatMeWorry wrote: [...] As long as they're public. Imports are private by default, meaning their symbols are only visible locally. Change it to: module derelict_libraries; pub

Stupid User error with DUB/Derelict runtime issue?

2016-10-05 Thread WhatMeWorry via Digitalmars-d-learn
Dub/Derelict is returning the following error at the D line: DerelictFT.load(); // Load the FreeType library derelict.util.exception.SharedLibLoadException@C:\Users\kheaser\AppData\Roaming\dub\packages\derelict-util-2.0.6\source\derelict\util\exception.d(35): Failed to load one or more

Beginner DUB user question...

2016-10-08 Thread WhatMeWorry via Digitalmars-d-learn
I've got a little hello_window DUB project which uses these dependencies: dependency "derelict-util" version="~>2.0.6" dependency "derelict-glfw3" version="~>3.1.0" dependency "derelict-gl3" version="~>1.0.19" dependency "derelict-fi"version="~>2.0.3" dependency "derelict-ft"

Re: dub command line in config?

2016-10-09 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 9 October 2016 at 19:11:52 UTC, Jinx wrote: On Sunday, 9 October 2016 at 08:52:55 UTC, rikki cattermole wrote: On 09/10/2016 9:17 PM, Jinx wrote: [...] That is enough. Mike Parker has presented a workaround that you can implement. He has also shown how you can contact those that ha

Real Simple Question?

2016-10-22 Thread WhatMeWorry via Digitalmars-d-learn
This is probably so simple that there's no example anywhere. Basically, I've got a huge array definition (see below) which I reuse over and over again in different projects. GLfloat[] vertices = [ // Positions // Texture Coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 0.5f, -0.5

Re: Real Simple Question?

2016-10-22 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 22 October 2016 at 20:51:14 UTC, Jonathan M Davis wrote: On Saturday, October 22, 2016 20:35:27 WhatMeWorry via Digitalmars-d-learn wrote: [...] Just put it in a separate module and then import it. e.g. file: mypackage/constants.d == module mypackage.constants

A question of function design?

2016-10-27 Thread WhatMeWorry via Digitalmars-d-learn
I'm using Derelict GLFW3 and I found the following GLFW3 code snippet in a demo. float distance = 3.0; extern(C) void key_callback(GLFWwindow* window, int key, int scancode, int action, int modifier) nothrow { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { glfwSetWin

Re: A question of function design?

2016-10-28 Thread WhatMeWorry via Digitalmars-d-learn
On Thursday, 27 October 2016 at 22:51:13 UTC, pineapple wrote: On Thursday, 27 October 2016 at 22:17:35 UTC, WhatMeWorry wrote: I'm using Derelict GLFW3 and I found the following GLFW3 code snippet in a demo. In a small demo, crap like this usually isn't a big deal. It's not common practice

Re: A question of function design?

2016-10-28 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 28 October 2016 at 14:12:53 UTC, Mike Parker wrote: On Friday, 28 October 2016 at 13:19:19 UTC, WhatMeWorry wrote: [...] I generally use GLFW event callbacks to populate an event queue with custom event types, then process the queue and handle events elsewhere. That way, the call

general questions about static this() at module level

2016-10-30 Thread WhatMeWorry via Digitalmars-d-learn
I am fascinated with D's module static this. I have shamelessly stolen Ali's code directly from his book. module cat; static this() { // ... the initial operations of the module ... } static ~this() { // ... the final operations of the module ... } First, are there any other languages that ha

Re: general questions about static this() at module level

2016-10-31 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 31 October 2016 at 05:42:16 UTC, sarn wrote: On Monday, 31 October 2016 at 04:35:35 UTC, WhatMeWorry wrote: [...] I've seen hacks to do the same thing in C++. They're not pretty, though. [...] Class/struct static constructors are good for initialising class/struct static dat

newbie problem with nothrow

2016-10-31 Thread WhatMeWorry via Digitalmars-d-learn
Is there a way to turn off nothrow or work around it? Because to me it looks like nothrow prevents me from doing anything useful. extern(C) void onKeyEvent(GLFWwindow* window, int key, int scancode, int action, int modifier) nothrow { if(queue.roomInQueue()) { auto event = ne

Re: general questions about static this() at module level

2016-10-31 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 31 October 2016 at 18:46:31 UTC, Jonathan M Davis wrote: though there's no reason to ever use a static constructor (shared or otherwise) when you can directly initialize the variable. It's really meant for more complicated initialization that can't be done directly. Also, I would p

an extremely naive question regarding synchronized...

2016-11-14 Thread WhatMeWorry via Digitalmars-d-learn
I was reading this fasciniating article: https://davesdprogramming.wordpress.com/2013/05/06/low-lock-singletons/ And to quote a section of it: - static MySingleton get() { synchronized { if (instance_ is null) { instance_ = n

Hopefully a simple question...

2017-01-13 Thread WhatMeWorry via Digitalmars-d-learn
I'm converting some C++ and glm code to D and gl3n. And I'm stumped at the following line. GLboolean CheckCollision(BallObject &one, GameObject &two) // AABB - Circle collision { // Get center point circle first glm::vec2 center(one.Position + one.Radius); . . . } one.Position i

A matter of propiety

2017-01-27 Thread WhatMeWorry via Digitalmars-d-learn
module_common import app; // Ugly? Bad? Better way? common_func() { static if (compileTimeFlag1) codeBlockA static if (compileTimeFlag2) codeBlockB static if (compileTimeFlag3) codeBlockC } I want to have many stan

Is there anything fundamentally wrong with this code?

2017-02-03 Thread WhatMeWorry via Digitalmars-d-learn
The code below compiles fine but I always get a run time abort with the error down below. Isn't the postProc at module scope so shouldn't the class instance always be around (ie not deallocated?) If it helps, this was translated from C++ code. Thanks. -file post_proces

Re: Is there anything fundamentally wrong with this code?

2017-02-03 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 3 February 2017 at 18:37:15 UTC, Johan Engelen wrote: On Friday, 3 February 2017 at 17:20:43 UTC, WhatMeWorry wrote: [...] The error is in this line. Instead of assigning to the `postProc` at module scope, you are defining a new local variable and assigning to it. [...]

DerelictFmodStudio not found...

2017-02-10 Thread WhatMeWorry via Digitalmars-d-learn
I followed the instructions for derelict.fmod. // Load the Fmod library. DerelictFmod.load(); // compiles fine. // Load the Fmod studio library. DerelictFmodStudio.load(); but the Studio load ..\common\derelict_libraries.d(122,5): Error: undefined identifier 'DerelictFmodStudio' In the

Re: DerelictFmodStudio not found...

2017-02-10 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 11 February 2017 at 03:10:35 UTC, WhatMeWorry wrote: I followed the instructions for derelict.fmod. // Load the Fmod library. DerelictFmod.load(); // compiles fine. // Load the Fmod studio library. DerelictFmodStudio.load(); but the Studio load ..\common\derelict_libraries.d

simple static if / traits question...

2017-02-22 Thread WhatMeWorry via Digitalmars-d-learn
I'm doing conditional compilation using static ifs like so: enum bool audio = true; // if audio flag is present and set to true, add to code build static if ( (__traits(compiles, audio)) && audio) playSound(soundSys, BLEEP ); This works, b

Cleaning up Dub/Dmd builds

2017-04-18 Thread WhatMeWorry via Digitalmars-d-learn
Just some basic questions regarding Dub projects with GitHub. I'm just getting my toes wet with GitHub so these might be pretty naive questions. I've got about 35 mini dub projects where each project holds an OpenGL tutorial. like so: 01_01_hello_window .dub build app

Re: Cleaning up Dub/Dmd builds

2017-04-18 Thread WhatMeWorry via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 15:15:47 UTC, Stanislav Blinov wrote: On Tuesday, 18 April 2017 at 15:07:27 UTC, WhatMeWorry wrote: When I try to upload these files to my new repo, GitHub (rightfully so) complains that I have too many files. Since I'm using sdl and not json, can I safely delete a

Re: Structure of platform specific vs non platform specific code

2017-05-09 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 8 May 2017 at 21:16:53 UTC, Igor wrote: Hi, I am following Casey Muratori's Handmade Hero and writing it in DLang. This sounds very interesting. Maybe make it a public github project?

Basic dynamic array question. Use of new versus no new.

2014-06-10 Thread WhatMeWorry via Digitalmars-d-learn
In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5; // now has 5 elements while in Mr. Alexandrescu's book, it says To create a dynamic array, use a new expression (§

std.algorithm.splitter on string inserts \\ for every occurrence of \

2014-06-19 Thread WhatMeWorry via Digitalmars-d-learn
string path = environment["PATH"]; // get the value of the env variable PATH. writeln("Path is ", path); writeln(); auto paths = std.algorithm.splitter(path, ";"); writeln("Paths are ", paths); Path is E:\dmd2\windows\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32... Paths are ["E

very short pipeShell program

2014-06-22 Thread WhatMeWorry via Digitalmars-d-learn
After hours of reading (obviously not comprehending) std.process and looking at code samples, I still can't even do something this simple. Open a Windows command line and run miscellaneous commands. Only the first command, dir" is shown in the final output. auto pipe = pipeShell("dir", Redi

Is their a way for a Child process to modify its Parent's environment?

2014-06-24 Thread WhatMeWorry via Digitalmars-d-learn
I open a command line window, and run the following 6 line program void main() { string envPath = environment["PATH"]; writeln("PATH is: ", envPath); envPath ~= r";F:\dmd2\windows\bin"; environment["PATH"] = envPath; envPath = environment["PATH"]; writeln("PATH is: ", envPa

is there a way to pause a program and resume with just a key press (or enter key)

2014-07-14 Thread WhatMeWorry via Digitalmars-d-learn
Sorry if this is an incredibly naive question. I prefer to pragmatically pause my programs periodically so that I can peruse output statements. Ideally, I'd like to continue by just hitting any old key. My feeble attempt below requires I enter at least one character and then the enter key. c

Should dmd have given me a warning at least?

2014-09-12 Thread WhatMeWorry via Digitalmars-d-learn
// the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string glShadingLangVer = to!string(glGetString(GL_SHADING_LANGUAGE_VERSION)); writeln("glShadingLangVer is ", glS

Re: Should dmd have given me a warning at least?

2014-09-12 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 12 September 2014 at 22:53:35 UTC, Ali Çehreli wrote: On 09/12/2014 03:44 PM, WhatMeWorry wrote: // the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string

Re: Should dmd have given me a warning at least?

2014-09-13 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 13 September 2014 at 08:09:15 UTC, Mike Parker wrote: On 9/13/2014 7:44 AM, WhatMeWorry wrote: // the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict>02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string

String Theory Questions

2014-09-13 Thread WhatMeWorry via Digitalmars-d-learn
The name string is aliased to immutable(char)[] Why was immutable chosen? Why not mutable. Or why not just make another alias called strung where it is aliased to mutable(char)[] Also, since strings are arrays and arrays are structs with a length and ptr field, I ran the following code for

Re: String Theory Questions

2014-09-13 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 13 September 2014 at 23:22:40 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 13 Sep 2014 22:41:38 + AsmMan via Digitalmars-d-learn wrote: D string are actullay C-strings? in no way. only string *LITERALS* are zero-terminated. Ok. So I wrote the following: char c = *(

Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-21 Thread WhatMeWorry via Digitalmars-d-learn
Anybody installed Visual D recently? As per the install instructions, I downloaded the Visual Studio isolated Shell 2013 and its integrated package. Everything went smoothly. I then downloaded Visual D and installed it with no problems. However, when I try to run the vdserver.exe applicatio

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-22 Thread WhatMeWorry via Digitalmars-d-learn
On Monday, 22 September 2014 at 03:30:22 UTC, Vladimir Panteleev wrote: On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the Visual Studio isolated Shell 2013 and its integrated package. Everyt

Simple import question

2014-10-09 Thread WhatMeWorry via Digitalmars-d-learn
Hope this question is not too simple minded but, In the TDPL it says: "To import one module from another, specify the name of the module in an import declaration. The name must include the relative path computed from the directory where compilation takes place" Ok, but how does one determ

Can someone explain how glfw3.dll gets created?

2014-10-13 Thread WhatMeWorry via Digitalmars-d-learn
I have a simple GLFW3 program running in Visual D integrated shell, that kept aborting at DerelictFLFW3.load() with a "failed to load the shared libraries: glfw3.dll.' So I found a glfw3.dll somewhere and moved it into the project folder (I know this is bad technique) and that fixed the proble

Basic DerelictOrg and Deimos question

2014-10-24 Thread WhatMeWorry via Digitalmars-d-learn
within DerelictOrg, I've used DerelictGL3 and DerelictGLFW3 packages successfully. But just today I stumbled across D-Programming-Deimos and noticed that it has a glfw and an OpenGL as well. I've read some of the descriptions and Derelict talks about "dynamic bindings" where Deimos mentions

Vibe.d compiler errors...

2014-10-24 Thread WhatMeWorry via Digitalmars-d-learn
I just started to dip my toes into vibe.d and I tried to stay on the beaten track. I downloaded vibe, and did the "First Steps" as recommended: $ cd /path/to/my/projects $ dub init vibe.d But when I try compiling the default code in app.d which is created after the "dub init" above, I get:

Re: Vibe.d compiler errors...

2014-10-24 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 24 October 2014 at 19:58:37 UTC, WhatMeWorry wrote: I just started to dip my toes into vibe.d and I tried to stay on the beaten track. I downloaded vibe, and did the "First Steps" as recommended: $ cd /path/to/my/projects $ dub init vibe.d But when I try compiling the default co

dub fetch target redirection...

2014-10-28 Thread WhatMeWorry via Digitalmars-d-learn
It looks like dub fetch... is putting all packages at %appdata% path on my windows machine. Is there a way to redirect packages to a user specified path?

Re: dub fetch target redirection...

2014-10-29 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 29 October 2014 at 12:47:48 UTC, Kagamin wrote: https://github.com/D-Programming-Language/dub/issues/229 Thanks. This s-ludwig guy is great.

Re: dub fetch target redirection...

2014-10-29 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 29 October 2014 at 11:35:17 UTC, Mike Parker wrote: On 10/29/2014 1:48 PM, WhatMeWorry wrote: It looks like dub fetch... is putting all packages at %appdata% path on my windows machine. Is there a way to redirect packages to a user specified path? You're not really supposed to

Simple code sample of Nesting Structures. I'm I doing something illegal here?

2014-11-22 Thread WhatMeWorry via Digitalmars-d-learn
// Two simple value type structures. one embedded in the other. I've stepped through the debugger and I see the embedded structure being set to 2, and dog. import std.stdio; struct NestedBottom { int i; char[3] fixedArray; // this(){} no-argument ctor can only be defined by th

Do functions and/or function pointers have scope (or lifetimes)

2014-11-29 Thread WhatMeWorry via Digitalmars-d-learn
I'm assuming the answer is yes. If so, that implies that I could execute a function pointer that doesn't point to anything meaningful. Conversely, functionality could exist that I can't get access to because my function pointer is unavailable? If these are dangers, is there a technique or m

general questions on reference types versus value types...

2014-11-30 Thread WhatMeWorry via Digitalmars-d-learn
Is it correct to say that D reference types (classes, dynamic arrays, etc.) are always allocated on the heap; whereas D value types (structs, static arrays, etc.) are always allocated on the stack? Or is this a gross oversimplification? Because can't structures contain classes and classes c

Re: general questions on reference types versus value types...

2014-12-01 Thread WhatMeWorry via Digitalmars-d-learn
Wow. This is great stuff! And diagrams are always appreciated. You should write a book. I'm off to play with emplace.

Need extern (C) interface even though using Derelict GLFW

2015-01-03 Thread WhatMeWorry via Digitalmars-d-learn
I've been translating C++, OpenGL, and GLUT code into D, Derelict OpenGL, and Derelict GLFW using: import derelict.opengl3.gl3; import derelict.glfw3.glfw3; auto window = glfwCreateWindow(800, 600, "Shaders", null, null); etc. Things have been going well. I then tried to implement window

Re: Need extern (C) interface even though using Derelict GLFW

2015-01-04 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 4 January 2015 at 09:02:48 UTC, Mike Parker wrote: On 1/4/2015 1:34 PM, WhatMeWorry wrote: Maybe GLFW callback functions can't handled through Derelict GLFW? And just to be clear, because the pointers to the callback functions are being passed to a C API, they *have* to be exter

simple assignment statement compiles but becomes a run time error

2015-01-18 Thread WhatMeWorry via Digitalmars-d-learn
I've got a OpenGL function returning a pointer // const GLubyte *version = glGetString(GL_VERSION); // C++ and openLG code // the following compiles with no errors or warnings char openglVersion[100] = fromStringz(glGetString(GL_VERSION)); // ABENDS HERE! // documentation from std.stri

Re: simple assignment statement compiles but becomes a run time error

2015-01-18 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 18 January 2015 at 19:42:33 UTC, WhatMeWorry wrote: I've got a OpenGL function returning a pointer // const GLubyte *version = glGetString(GL_VERSION); // C++ and openLG code // the following compiles with no errors or warnings char openglVersion[100] = fromStringz(glGetString(G

  1   2   3   >