Derelict / SDL error

Paul via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 8 05:37:20 PST 2014


On Monday, 8 December 2014 at 13:23:12 UTC, ketmar via 
Digitalmars-d-learn wrote:
> On Mon, 08 Dec 2014 13:16:37 +0000
> Paul via Digitalmars-d-learn 
> <digitalmars-d-learn at puremagic.com> wrote:
>
>> On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via 
>> Digitalmars-d-learn wrote:
>> > On Mon, 08 Dec 2014 12:53:10 +0000
>> > Paul via Digitalmars-d-learn 
>> > <digitalmars-d-learn at puremagic.com> wrote:
>> >
>> >> Sorry this is a bit off topic but as there doesn't seem to 
>> >> be an active forum for Derelict atm....
>> >> 
>> >> This simple test code is giving me an error 'Error 
>> >> executing command run: Program exited with code -11' (or a 
>> >> seg fault if executed from a terminal). The problem line is:
>> >> 
>> >> SDL_RenderCopy(renderer, texture, &sourceRect, &destRect);
>> >> 
>> >> I've tried this call with the 'null' options as well as 
>> >> passing the address of the rects but neither works (I've 
>> >> also tried manually assigning the various struct components 
>> >> rather than using the c style initialisation in case that 
>> >> was the problem).
>> >> 
>> >> Any ideas please?
>> 
>> > this exact code is working for me. i just copypasted it and 
>> > gave it
>> > test.bmp to work with.
>> 
>> Thanks for testing, must be something on my system then... 
>> I've no idea where to start looking for the problem though :(
> i must admit that i'm on 32-bit GNU/Linux, so i can't say 
> anything
> about 64-bit and/or non-GNU/Linux OSes.

I added this around the problem line to catch the problem:

     try{
		SDL_RenderCopy(renderer, texture, &sourceRect, &destRect);	
	} catch{}
	finally {
		writeln( "Error: " , SDL_GetError() );
	}

The program now works from a terminal as expected (!) BUT when 
SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or 
just some address/value as it is different each time).







More information about the Digitalmars-d-learn mailing list