Sign in to follow this  
TWizard

SDL and OpenGL

Recommended Posts

TWizard    122
Hi, I have set up SDL and OpenGL and have gotten it to draw a few squares on the screen with OpenGL as a test. Now, what I want to do is I want to make it able to write on the screen. To do that, I downloaded an SDL font library (BFont), but my program seems to have trouble blitting the text surface to the screen's surface. I did not find any information relevant to the problem. Does anybody know what I could do to make it work? Thanks.

Share this post


Link to post
Share on other sites
TWizard    122
Quote:
Original post by clayasaurus
nehe.gamedev.net.

If you have OpenGL's drawing capabilities, than why are you trying to use SDL's blitter?


Because I have a good, pre-made library that handles the loading itself, but anyways, I'll look into an OpenGL version. Probably the one on the nehe website.

Share this post


Link to post
Share on other sites
clayasaurus    139
Quote:
Original post by subflood
Also remember that unlike SDL, making bitmap fonts in openGL is platform dependent.


Why would they be platform dependent? Mine arn't.

Share this post


Link to post
Share on other sites
TWizard    122
Quote:
Original post by clayasaurus
Quote:
Original post by subflood
Also remember that unlike SDL, making bitmap fonts in openGL is platform dependent.


Why would they be platform dependent? Mine arn't.


He is refering to bitmap fonts, which are in a special format (i.e.: Times New Roman).
To load these, you would use agl, wgl or glx, depending on your platform. I do not know of any system-independent parsers.

And as a follow-up to my post:
Do you know any good libraries for OpenGL with Macintosh support that could implement text boxes and fonts?
A tutorial to implement these things would be good.
I have found a code sample from Nehe's website for using AGL to use fonts. I have not made it function yet and Apple's site says that it's deprecated.
I don't really want to use Cocoa or Carbon to do this unless I really have to because it involves making my program enter a whole new API and field of programming.
But for now, all I want is a very efficient way to draw text to an OpenGL surface, whether it's a bitmap font or not.

Share this post


Link to post
Share on other sites
TWizard    122
Quote:
Original post by Magmai Kai Holmlor
There's a library called glText written to do this.


Okay, thanks.
Anyways, I just noticed that the subject of this thread was now the same as another thread, so I will be abandoning this thread.

Share this post


Link to post
Share on other sites
clayasaurus    139
Oh ok, I was confusing bitmap font with texture font I guess. I didn't know there was really a difference, since when I think bitmap, I think of a large bitmap with different font chars on it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Quote:
He is refering to bitmap fonts, which are in a special format (i.e.: Times New Roman).


i think you're confusing bitmap fonts with true type fonts, times new roman f.ex. is a true type font.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
since when did SDL+OpenGL became an alternative library???

Share this post


Link to post
Share on other sites
Icefox    238
For fonts in SDL, you might want to look into the SDL_ttf library... it renders Truetype fonts onto normal SDL surfaces. I don't know how it integrates into OpenGL, but I doubt it's too difficult to turn an SDL surface into an OpenGL bitmap. Of course, whether that's the best thing to do or not, I don't know...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this