SFML community forums

Bindings - other languages => DotNet => Topic started by: sofakng on January 14, 2009, 09:30:54 pm

Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: sofakng on January 14, 2009, 09:30:54 pm
I'm reading over the documentation for SFML and it mentions the Font class having methods such as GetImage (and other methods for Glyphs).

How come these don't exist in the .NET port?

I was hoping to render a character (or string) to an image/sprite and it looks like I need these functions...
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: Laurent on January 14, 2009, 11:11:54 pm
Well, those methods are not really needed. They were added mainly for a cleaner integration of the Font class within SFML.

You'll be able to render text to an image with the render-to-image feature that's going to be added soon.
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: sofakng on January 14, 2009, 11:41:00 pm
Sounds good.  I look forward to the updates!

By the way, will this render-to-image allow games like Worms or Scorched earth?  They usually require modifying a bitmap/image every frame to simulate terrain destruction, etc.

However, I'm not sure how fast this will be since modifying textures in video memory is supposedly a very expensive operation.
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: Laurent on January 15, 2009, 08:08:43 am
Quote
By the way, will this render-to-image allow games like Worms or Scorched earth? They usually require modifying a bitmap/image every frame to simulate terrain destruction, etc.

I don't think so, those effects usually require manual modification of the pixels. Render-to-image will be nothing more than normal drawing, but to an image rather than to a window.

Quote
However, I'm not sure how fast this will be since modifying textures in video memory is supposedly a very expensive operation.

It will highly depend on the GPU, and of the usage of this neaw feature. I'm sure people will do crazy things involving multiple transfers between system and video memory, and then wonder why it's so slow ;)
But if you use it wisely, it will be very fast.
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: dabo on January 15, 2009, 01:30:42 pm
Quote from: "Laurent"
Render-to-image will be nothing more than normal drawing, but to an image rather than to a window.


This is exactly what I need to be able to continue, any idea when it will be ready? I have a lot of graphics to draw for my game so I guess I can do that while waiting so no hurry.
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: Laurent on January 15, 2009, 09:41:00 pm
I've worked hard on this feature for the last two days, and it's almost complete now. It should be ready very soon.

I'm just curious, what do you need it for? :)
Title: Font.GetImage doesn't exist? Problem with .NET port?
Post by: dabo on January 15, 2009, 10:11:14 pm
Quote from: "Laurent"
I've worked hard on this feature for the last two days, and it's almost complete now. It should be ready very soon.

I'm just curious, what do you need it for? :)


Render a sf::String to an image.