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

Just beginning - Getting some text onto the screen

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



Joined: 24 May 2011
Posts: 11

PostPosted: Mon Jun 06, 2011 4:13 pm    Post subject: Just beginning - Getting some text onto the screen Reply with quote

I'm just starting out programming with Derelict2 (and D in general), and I've used the sample code above along with the one I found here...

http://blog.fedora-fr.org/bioinfornatics/post/D-Programming-with-SDL-and-openGL

...to get a nice triangle on my screen! This is a very pleasing first step Very Happy

I'm wondering if you have any sample code that gets some text onto the screen as well? It would help me get started if I just had some sample code. I wonder, with the current Derelict, which libraries do I use? GL seems so nice, I'd like to stick with that if possible instead of SDLttf ( reason: SDLimage seemed to crash on my mac when I tried to load something, plus warnings about not using deprecated software - I wonder if it's not better to just stick with GL?).

I found a great GL font library - FTGL - which is actively maintained. Once I get the hang of programming in D, I would be glad to help move that library to Derelict if you agree that it's a good idea.

But first it would be great just to be able to put "Hello Derelict!" over top of that big triangle from the demo code above. I thank you in advance for any suggestions and advice you offer!

Cheers,

Zach
Back to top
View user's profile Send private message
aldacron



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

PostPosted: Tue Jun 07, 2011 6:27 am    Post subject: Re: Just beginning - Getting some text onto the screen Reply with quote

salamander wrote:
I'm just starting out programming with Derelict2 (and D in general), and I've used the sample code above along with the one I found here...

http://blog.fedora-fr.org/bioinfornatics/post/D-Programming-with-SDL-and-openGL

...to get a nice triangle on my screen! This is a very pleasing first step Very Happy


Welcome! I hope Derelict makes your D programming easier. But really, there's no such thing as "programming with Derelict2." You're programming with OpenGL, or SDL, or whatever it binds to.

Quote:

I'm wondering if you have any sample code that gets some text onto the screen as well? It would help me get started if I just had some sample code. I wonder, with the current Derelict, which libraries do I use? GL seems so nice, I'd like to stick with that if possible instead of SDLttf ( reason: SDLimage seemed to crash on my mac when I tried to load something, plus warnings about not using deprecated software - I wonder if it's not better to just stick with GL?).


I suggest you search for OpenGL text rendering tutorials. There are several out there, and several ways of going about it. DerelictGL is just a direct binding, so any of the multiple techniques you find will work.

Quote:

I found a great GL font library - FTGL - which is actively maintained. Once I get the hang of programming in D, I would be glad to help move that library to Derelict if you agree that it's a good idea.


It's a C++ library, so not going to happen unless it has a C interface. D has limited ability to interface with C++. SFML, for example, is a C++ project with a C interface, so it's easy to make a Derelict binding for it.

Quote:

But first it would be great just to be able to put "Hello Derelict!" over top of that big triangle from the demo code above. I thank you in advance for any suggestions and advice you offer!


Personally, I think the easiest way to get started is using fonts created with the AngelCode Bitmap Font Generator. There are tutorials linked from that page on rendering them, and several open source libraries have implemented OpenGL renderers (like the Java library Slick2D), if you need further references.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Fri Jun 17, 2011 6:12 am    Post subject: Reply with quote

For rendering text there is FreeType (http://www.freetype.org/), that would be DerelictFT in derelict.
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