[DerelictSDL] SDL_RenderCopy does not accept optional arguements when written in a file aside from main

Jack via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 24 03:32:24 PST 2015


On Thursday, 24 December 2015 at 10:42:57 UTC, Lucien wrote:
> On Thursday, 24 December 2015 at 09:41:39 UTC, Jack wrote:
>> [...]
>
> You need a pointer to renderTarget.
>
>
> #other_file.d
>
> ---------------------
> module my.sdl.project;
>
> import derelict.sdl2.sdl;
> import derelict.sdl2.image;
>
>
> void renderSprite(SDL_Renderer* _renderTarget)
> {
>     SDL_Texture* texture = 
> SDL_CreateTextureFromSurface(_renderTarget, 
> IMG_Load("image.png"));
>     SDL_RenderCopy(_renderTarget,texture, null,null);
> }
> ---------------
>
> #main.d
> -----------
>
> import my.sdl.project;
> //...
> -----------

I actually have a pointer in the original project but I seem to 
forgot it when I'm typing this example. Sorry bout the 
misunderstanding, but yeah problem still stands.


More information about the Digitalmars-d-learn mailing list