Access violation with SDL_RenderText

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

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

> 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");


' 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.


Erstellt mit Operas revolutionärem E-Mail-Modul:

More information about the Digitalmars-d-learn mailing list