Re: directx bindings problem

2013-10-05 Thread evilrat
oh, on the second thought after some tests, i encountered major ABI(or should i say MS 'optimization'?) mismatch which requires almost any function to be wrapped within C++ code to work, i doubt it would ever costs such efforts for me. so i'm tired off both C++ and D. and programming in genera

Re: Conflict between std.file write() and std.stdio write()

2013-10-05 Thread Craig Dillabaugh
On Saturday, 5 October 2013 at 02:42:54 UTC, Jonathan M Davis wrote: On Friday, October 04, 2013 16:12:14 Craig Dillabaugh wrote: I guess the more fundamental question is, what is the purpose of the documentation? Is it a quick reference for D users, or is it a resource for people trying to le

Re: directx bindings problem

2013-10-05 Thread evilrat
On Thursday, 3 October 2013 at 06:19:27 UTC, evilrat wrote: i'm trying directx bindings from dsource (http://dsource.org/projects/bindings/wiki/DirectX) and encountered problem, when calling swap chain getbuffer it suddenly crashes. does anyone using it? any help please :( // Create a render t

Re: My design need friends

2013-10-05 Thread Andrej Mitrovic
On 10/6/13, Namespace wrote: > Any further suggestions or improvements? That's nice. You could also hack away with templates, extracting the full module path (e.g. foo.bar) of the calling module and comparing this with the module a symbol is in, and then do this sort of thing: In a module like

Re: My design need friends

2013-10-05 Thread Namespace
Even better as mixin template: Accessor: module Core.Accessor; import std.stdio; import std.string : format; import Core.Friend; mixin template Accessor(T) { public: void friendCall(string method, Request, Args...)(ref const Request caller, Args args) { auto friends = _

Re: My design need friends

2013-10-05 Thread Namespace
I have now a solution. A bit dirty but it's the D magic I expected. New file: module Core.Friend; struct Friend { public: immutable string friend; } Drawable looks now like this: module Bar.Drawable; import Core.Friend; @Friend("Window") interface Drawable { protected:

Re: My design need friends

2013-10-05 Thread Andrej Mitrovic
On 10/5/13, Adam D. Ruppe wrote: > It isn't really a fix, but in these situations what I've been > doing in my code is just writing: > > // don't use this > /* private */ final public void foo() {} Me too, as have other library writers (like DFL).

Re: My design need friends

2013-10-05 Thread Namespace
On Saturday, 5 October 2013 at 21:57:58 UTC, Namespace wrote: On Saturday, 5 October 2013 at 21:46:19 UTC, Adam D. Ruppe wrote: It isn't really a fix, but in these situations what I've been doing in my code is just writing: // don't use this /* private */ final public void foo() {} final make

Re: My design need friends

2013-10-05 Thread Namespace
On Saturday, 5 October 2013 at 21:46:19 UTC, Adam D. Ruppe wrote: It isn't really a fix, but in these situations what I've been doing in my code is just writing: // don't use this /* private */ final public void foo() {} final makes sure it doesn't get overridden wrongly, and then the comment

Re: My design need friends

2013-10-05 Thread Adam D. Ruppe
It isn't really a fix, but in these situations what I've been doing in my code is just writing: // don't use this /* private */ final public void foo() {} final makes sure it doesn't get overridden wrongly, and then the comments make my intention a little more clear.

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread Andrej Mitrovic
On 10/5/13, webwraith wrote: > I don't know about you, but it's beginning to look to me like > SetConsoleScreenBufferSize() takes pixels as its unit of > measurement, and not columns and rows, as is stated in its > documentation. I don't suppose you could confirm this? I don't know, but maybe the

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread webwraith
I don't know about you, but it's beginning to look to me like SetConsoleScreenBufferSize() takes pixels as its unit of measurement, and not columns and rows, as is stated in its documentation. I don't suppose you could confirm this?

My design need friends

2013-10-05 Thread Namespace
Hello. I hope one of you has a good idea to solve my design problem. I have 3 files in two different sub packages. Package Bar has the interface Drawable: module Bar.Drawable; interface Drawable { protected: void _render(); package: final void render() { th

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread Andrej Mitrovic
On 10/5/13, webwraith wrote: > ...And that will teach me to look further. SM_CXMIN and SM_CYMIN > are measured in pixels. I'll need to find out how big my font is, > as well, but I'm pretty sure that 60x30 at the default system > font should be bigger. Ah right you are. For that I think you can u

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread webwraith
...And that will teach me to look further. SM_CXMIN and SM_CYMIN are measured in pixels. I'll need to find out how big my font is, as well, but I'm pretty sure that 60x30 at the default system font should be bigger.

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread webwraith
On Saturday, 5 October 2013 at 11:24:49 UTC, Andrej Mitrovic wrote: On 10/5/13, webwraith wrote: Could someone give this code the quick once over and tell me where I'm going wrong, or simply how to get this to work? In the docs: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686044

Re: Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread Andrej Mitrovic
On 10/5/13, webwraith wrote: > Could someone give this code the quick once over and tell me > where I'm going wrong, or simply how to get this to work? In the docs: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686044%28v=vs.85%29.aspx It says: dwSize [in] A COORD structure tha

Windows SetConsoleScreenBufferSize() returning an odd error code

2013-10-05 Thread webwraith
I'm not sure if it's my code, although I feel fairly confident it isn't, but SetConsoleScreenBufferSize() is failing with error 87, which a quick browse of MSDN tells me is ERROR_INVALID_PARAMETER. Could someone give this code the quick once over and tell me where I'm going wrong, or simply how