Access violation with SDL_RenderText

mike vertex at gmx.at
Sat Oct 28 16:31:16 PDT 2006


Am 28.10.2006, 03:02 Uhr, schrieb clayasaurus <clayasaurus at gmail.com>:

>
> If you pass d char[] into SDL's char* functions, like...
>
> RenderText(char* text);
>
> char[] w;
> RenderText(w);
>
> It might work sometimes but it is prone to crashing. Always use the  
> std.toStringz() to turn D strings into C strings in this case.
>
> I do not know if this is a problem though, just a guess. SDL has been  
> stable otherwise.

I'm doing that already, and - oddly enough - this seems to be the problem.

' SDL_RenderText("text");

works.

' SDL_RenderText(toStringz("text"));

crashes after about two minutes, when I'm rendering text every frame. Also  
without toStringz I have no increase in memory usage, while with toStringz  
I have. Anyway, I'll post a solution once I find it.

-Mike


-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the Digitalmars-d-learn mailing list