[DerelictSDL] SDL_RenderCopy does not accept optional arguements when written in a file aside from main
Lucien via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Dec 24 04:42:11 PST 2015
On Thursday, 24 December 2015 at 11:32:24 UTC, Jack wrote:
> 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.
I can't help you without your original code.
More information about the Digitalmars-d-learn
mailing list