Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.0  (Read 103422 times)

0 Members and 1 Guest are viewing this topic.

eleinvisible

  • Newbie
  • *
  • Posts: 47
    • View Profile
SFML 2.0
« Reply #90 on: June 11, 2009, 04:53:02 am »
Quote from: "heishe"
multiple cameras looking at different places in the world at the same time visible on the screen (think of the commandos games)
I think render to texture would be able to handle that (a texture for each view-port).. that is if I understood correctly.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #91 on: June 11, 2009, 09:44:08 am »
Quote
I think render to texture would be able to handle that (a texture for each view-port).. that is if I understood correctly.

Correct.
However there may be a simpler/more efficient way of doing it, using OpenGL viewports.

I'll add a new task in the tracker for SFML 2.0 :)
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #92 on: June 14, 2009, 07:57:47 am »
This is not really in the scope of SFML.
Laurent Gomila - SFML developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SFML 2.0
« Reply #93 on: June 22, 2009, 08:48:52 pm »
i haven't tried it yet, but does sfml or windows in general support playing with 2 gamepads of the same type at the same type?

for example: can i plug in 2 playstation 3 controllers and get different input from each controller?

edit: does sfml support gamepads in general?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2.0
« Reply #94 on: June 22, 2009, 09:04:18 pm »
Windows can. And I think SFML can also ( JoyButtonPressed, JoyButtonReleased, JoyMoved ) . But maybe I'm wrong and two different physical button are linked to the same event. I mean one on each gamepad.
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #95 on: June 22, 2009, 09:28:45 pm »
SFML supports up to two joysticks at the same time.
Laurent Gomila - SFML developer

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
SFML 2.0
« Reply #96 on: June 23, 2009, 11:33:39 pm »
Quote from: "Wavesonics"
Long time ago, a software renderer as a fallback was talked about, any plans for this in the future still?


This would make my day. Some systems just don't agree with OpenGL.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #97 on: June 24, 2009, 07:55:45 am »
It's still planned, but with a very low priority. I'll probably think about it again after SFML 2.0 is stable enough.
Laurent Gomila - SFML developer

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
SFML 2.0
« Reply #98 on: June 25, 2009, 03:13:14 pm »
I don't know if this has been asked, but a String that renders to a texture on SetText, instead of having a character set.

This is EXTREMELY necessary for multilingual writing or languajes with a really big charset (like Mandarin).
If I would like chatting on a game to be completily internationalized (any language character displayed) I can't use the current String implementation.

It's very limited.

Word wrap/clipping rect would also be really good (for simple GUI rendering).

Also I recommend again an option to disable font antialiasing (In FreeType), for pixel-based games. It would be like what "SetSmooth" is to Image, but with the need of re-rendering the charset.


Regards
-Martín

ptrxyz

  • Newbie
  • *
  • Posts: 32
    • View Profile
SFML 2.0
« Reply #99 on: June 25, 2009, 03:17:06 pm »
Just a little remark cause I just found that:

The whole SFML2.0 graphics namespace seems to be fully compatible to SFML1.5 except that Sprite.Center is missing. I know SFML2.0 isn't released yet, so I bet it would have been implemented until then, but hust wanted to mention it anyways, so it wont be forgotten.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2.0
« Reply #100 on: June 25, 2009, 03:17:30 pm »
I don't realise the need about render to texture for strings, but I totally agree with an option to disable text antialiasing. Word wrap/clipping would also be fine but looks more important to me.
Want to play movies in your SFML application? Check out sfeMovie!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #101 on: June 25, 2009, 03:32:35 pm »
Quote
I don't know if this has been asked, but a String that renders to a texture on SetText, instead of having a character set.

And then what? Reload the font file entirely / render glyphs to bitmap / copy pixels to the texture every time SetText is called? :shock:
But I agree, I'll try to remove the charset limitation in SFML 2.0 and make something more dynamic.

Quote
Word wrap/clipping rect would also be really good (for simple GUI rendering).

It's in the roadmap ("clipping masks" or something).

Quote
Also I recommend again an option to disable font antialiasing (In FreeType), for pixel-based games. It would be like what "SetSmooth" is to Image, but with the need of re-rendering the charset.

I think that pixel-based games will use pixellated fonts. They render very well in SFML.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #102 on: June 25, 2009, 03:34:25 pm »
Quote
The whole SFML2.0 graphics namespace seems to be fully compatible to SFML1.5 except that Sprite.Center is missing

It's now called Origin ;)
Laurent Gomila - SFML developer

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
SFML 2.0
« Reply #103 on: June 25, 2009, 10:21:26 pm »
Quote from: "Ceylo"
I don't realise the need about render to texture for strings, but I totally agree with an option to disable text antialiasing. Word wrap/clipping would also be fine but looks more important to me.

The current implementation precaches a limited charset (Latin-1 I think), and optionally you can set your own.
What this does is render all the character glyphs to a texture and afterwards, when rendering, each sf::String character is a quad (opengl jargon) mapped to a portion of that texture.
If I wanted to enable the writing of several languages glyphs (like mandarin chinese, greek, cyrillic, ...):
1. It will use a lot of space saving pre-rendered glyphs
2. They probably wouldn't fit in a hardware supported texture size.

Quote from: "Laurent"
Quote
I don't know if this has been asked, but a String that renders to a texture on SetText, instead of having a character set.

And then what? Reload the font file entirely / render glyphs to bitmap / copy pixels to the texture every time SetText is called? :shock:
But I agree, I'll try to remove the charset limitation in SFML 2.0 and make something more dynamic.

The font kept on memory (inside a sf::Font).

Approach 1:
Render to bitmap using FreeType and recreate a texture each time the text changes.

Approach 2:
Clipping would be mandatory to prepare a texture of good proportions.
Render glyphs to bitmap.
Load the pixels with glTexSubImage2D on the texture you already have (as it's faster than glTexImage2D).
This could implement clipping/word-wrapping or even right-to-left rendering (if needed) directly from FreeType.

Previous to rendering, the new string and a cached one should be tested for equality to avoid a costly operation.

Of course this is intended not as a replacement for sf::String, but for a totally different functionality.
This wouldn't be intended for dynamic text but for static not-changing-much text.
For example, in an in-game chat you could have a queue with a number of sf::NoCharsetString that have messages from other players, keeping them across each frame, and drawing them (without rendering the font)/freeing after use. The position could be changed without problems.

Also, when using for example 2500 character, you would reduce the triangle use (rendering) from 5000 to 2 (with the texture memory cost)

So, with the speed fact properly documented, it would be a nice adition to the SFML arsenal.

On a sidenote: this could enable all sprite utilities on it, like flipping.

Quote

Quote
Word wrap/clipping rect would also be really good (for simple GUI rendering).

It's in the roadmap ("clipping masks" or something).

Yes, but I believe it should be together with word wrapping, clipping mostly in a vertical direction, and "newlining" wrapping per words or, if they're too long, per character.
This isn't internationalization friendly (as there are a LOT of rules for word wrapping on other languages) but for half the world that uses a latin alphabet it would be sufficient.

Quote

Quote
Also I recommend again an option to disable font antialiasing (In FreeType), for pixel-based games. It would be like what "SetSmooth" is to Image, but with the need of re-rendering the charset.

I think that pixel-based games will use pixellated fonts. They render very well in SFML.

Even when using a pixelated font (Like ProFont) FreeType antialiases the borders.
I've already posted a topic on this.
If you don't want FreeType to do this, when rendering to an image you should pass that you want "monochrome" rendering.


Regards
-Martín

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #104 on: June 25, 2009, 10:42:05 pm »
Quote
Even when using a pixelated font (Like ProFont) FreeType antialiases the borders

I tried, and pixel-based fonts render perfectly, there's no visible antialiased edge. Which is normal because a pixellated font will only have hard edges, no antialiasing is needed.
Laurent Gomila - SFML developer

 

anything