View previous topic :: View next topic |
Author |
Message |
mutable
Joined: 22 Jun 2010 Posts: 87
|
Posted: Sun Dec 25, 2011 8:55 am Post subject: SDL_ttf |
|
|
I get this error Quote: | Library not initialized | until i load the new version of derelict without typedefs.
My code is this:
http://www.rswhite.de/code/index.php?q=12ef6046f64fdbecf9e275157c9f15ec
The exception occured by the second if, where i checked if font is null.
Have i forgotten something or has the new derelict version a bug?[/code]
P.S:
If i try to set the code between the code tags i got an error. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sun Dec 25, 2011 9:45 pm Post subject: Re: SDL_ttf |
|
|
mutable wrote: | I get this error Quote: | Library not initialized |
|
Well, this is an SDL_ttf error, not a Derelict error. The error means that TTF_Init is not being called for some reason. And looking at your code, I can see that the problem is this:
Code: |
if (TTF_WasInit() < 0) {
if (TTF_Init() < 0) {
throw new Exception("TTF konnte nicht gestartet werden.");
}
}
|
TTF_WasInit returns 1 if the library is initialized, and 0 if not. It never, ever returns a value less than zero. See the SDL_ttf documentation. You need to change the test to this:
Quote: |
until i load the new version of derelict without typedefs.
|
What does this mean? Do you mean you get the error with Derelict 1 (the trunk) but not with the Derelict 2 branch? This code, as written, should never work. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
mutable
Joined: 22 Jun 2010 Posts: 87
|
Posted: Mon Dec 26, 2011 9:12 am Post subject: |
|
|
You're right, i made a mistake when i copy the code and adapt him for my new Dgame Version.
Sorry, that was my fault.
P.S: You make great work with Derelict. Hope you export SDL 1.3 as soon as possible. |
|
Back to top |
|
|
|