FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SDL_ttf

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
mutable



Joined: 22 Jun 2010
Posts: 87

PostPosted: Sun Dec 25, 2011 8:55 am    Post subject: SDL_ttf Reply with quote

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
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sun Dec 25, 2011 9:45 pm    Post subject: Re: SDL_ttf Reply with quote

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:

Code:

if(!TTF_WasInit())


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
View user's profile Send private message Send e-mail
mutable



Joined: 22 Jun 2010
Posts: 87

PostPosted: Mon Dec 26, 2011 9:12 am    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group