Re: DerelictSDL2 crashes

2016-08-28 Thread unDEFER via Digitalmars-d
On Sunday, 28 August 2016 at 00:53:45 UTC, Mike Parker wrote: On Saturday, 27 August 2016 at 16:08:49 UTC, unDEFER wrote: dub --help Run "dub --help" to get help for a specific command. Thank you

Re: DerelictSDL2 crashes

2016-08-27 Thread Mike Parker via Digitalmars-d
On Saturday, 27 August 2016 at 16:08:49 UTC, unDEFER wrote: On Saturday, 27 August 2016 at 14:49:51 UTC, rikki cattermole wrote: $ dub build --help Yes, but how get knoledge from `dub --help` that `dub build --help` also available? dub --help Run "dub --help" to get help for a specific

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
On Saturday, 27 August 2016 at 14:49:51 UTC, rikki cattermole wrote: $ dub build --help Yes, but how get knoledge from `dub --help` that `dub build --help` also available?

Re: DerelictSDL2 crashes

2016-08-27 Thread rikki cattermole via Digitalmars-d
On 28/08/2016 2:41 AM, unDEFER wrote: On Saturday, 27 August 2016 at 14:23:13 UTC, unDEFER wrote: How to make dub working with gdc? Wow, it is so easy: $ dub --compiler=gdc But it is not documentated feature in --help.. So strange.. $ dub build --help --compiler=VALUE Specifies the

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
On Saturday, 27 August 2016 at 14:23:13 UTC, unDEFER wrote: How to make dub working with gdc? Wow, it is so easy: $ dub --compiler=gdc But it is not documentated feature in --help.. So strange..

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
I have tried to compile with gdc compiler: $ gdc -I /path/to/DerelictSDL2/source/ -I /path/to/derelict-util-2.0.6/source/ source/main.d /path/to/DerelictSDL2/source/derelict/sdl2/* /path/to/derelict-util-2.0.6/source/derelict/util/* /usr/lib/i386-linux-gnu/libdl.so And it is working fine.

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
So, what I think? Looks like I have corrupted stack, so any operation on the first word of the stack makes error. I have i386 architecture. Could this be a compiler bug?

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
I have fixed the error by replacing: Uint32 __attribute__((aligned(16))) [4]; with: Uint32 __attribute__((aligned(16))) ccc[5]; Uint32 * = ccc+1; After this it falls in other place: SDL_Rect real_srcrect = { 0, 0, 0, 0 }; The same code on C works fine. I really don't

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
Thank you for testing my code and for help with dub. I have rebuilt SDL2 from source. Unwrapped macroses and found that the error in the next code: __m128 c128; Uint32 __attribute__((aligned(16))) [4]; [0] = color; // THE ERROR IS HERE [1] = color; [2] =

Re: DerelictSDL2 crashes

2016-08-27 Thread Mike Parker via Digitalmars-d
On Saturday, 27 August 2016 at 03:49:46 UTC, lobo wrote: --- name "testsdl" targetType "executable" dependency "derelict-sdl2" version=">=2.0.0" dependency "derelict-util" version=">=2.0.6" dependency "derelict-gl3" version=">=1.0.18" --- FYI, you don't need to list derelict-util as a

Re: DerelictSDL2 crashes

2016-08-26 Thread lobo via Digitalmars-d
On Friday, 26 August 2016 at 21:26:13 UTC, unDEFER wrote: Hello! I'm trying compile SDL "Hello, World" --- import std.stdio; import derelict.sdl2.sdl; //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main() { DerelictSDL2.load();

Re: DerelictSDL2 crashes

2016-08-26 Thread Mike Parker via Digitalmars-d
On Friday, 26 August 2016 at 21:26:13 UTC, unDEFER wrote: BUT in gdb it runs successfully and I see red window. What I'm doing wrong? How gdb can make not working code working? I can tell you that your code compiles and runs fine for me on Windows using dub. It's also not so unusual for a

DerelictSDL2 crashes

2016-08-26 Thread unDEFER via Digitalmars-d
Hello! I'm trying compile SDL "Hello, World" --- import std.stdio; import derelict.sdl2.sdl; //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main() { DerelictSDL2.load(); //The window we'll be rendering to SDL_Window* window =