SDL and OpenGL

Started by
10 comments, last by Icefox 18 years, 10 months ago
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.
Advertisement
nehe.gamedev.net.

If you have OpenGL's drawing capabilities, than why are you trying to use SDL's blitter?
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.
Also remember that unlike SDL, making bitmap fonts in openGL is platform dependent.
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.
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.
There's a library called glText written to do this.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
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.
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.
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.

This topic is closed to new replies.

Advertisement