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

Author Topic: Way to draw using normalized coordinates via sf::RenderTarget  (Read 13985 times)

0 Members and 1 Guest are viewing this topic.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Way to draw using normalized coordinates via sf::RenderTarget
« Reply #15 on: December 27, 2014, 01:30:25 am »
Ditto was replacement for writing again "Way to draw..." and so on, repeating the title.
Implementation is usually (sadly) secondary issue here, and primary issue is 'out of scope', 'not useful enough', 'what for' and so on...
I assumed people know what Normalized is... at least relevant to acceptance of this feature people know (hello Laurent).

Quote
last I checked SFML doesn't provide the actual OpenGL IDs, which exactly the reason why the bind functions were introduced.
http://en.sfml-dev.org/forums/index.php?topic=11303.msg79962#msg79962
Using this, we only ever need sf::Texture::bind(sf::Texture*); with Pixels being implicit to do anything ever with the texture via GL, including getting its' ID and then rebinding with another coords translation matrix (or just getting it and setting it, without rebinding).

This 'method' is approved by Laurent few posts later as he fiercely defends from adding this accessor. ;) I know he really isn't against it but it's still funny...
Although in the end he did say:
Quote
It will be added as soon as possible (not in SFML 2.1 which is a bug-fix release).
we still don't have it...
Also, bind is a bit of an 'internal' call too, that does a tiny bit extra work, because it goes back to GL_MODELVIEW and says in comment that sf::RenderTarget expects that of it.


Gratuitous Laurent/SFML bashing aside, implementation of THIS feature would consist of few things:
1. Add enum field to sf::RenderStates (plus possibly adding relevant constructors, but that is another can of worms, I'm talking about minimal support here).
2. Add enum field to render cache (two draws with same texture but different coords mode require a rebind, or a reset of matrix, but that'd be more messy).
3. Instead of just checking texture id (SFML 64 bit id, not GL id) before rebinding, check the last coords mode too.
« Last Edit: December 27, 2014, 01:42:17 am by FRex »
Back to C++ gamedev with SFML in May 2023

Lee R

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: Way to draw using normalized coordinates via sf::RenderTarget
« Reply #16 on: January 05, 2015, 05:28:15 am »
I also requested this feature some time ago. It was deemed 'too specific' at that time.

http://en.sfml-dev.org/forums/index.php?topic=7243

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Way to draw using normalized coordinates via sf::RenderTarget
« Reply #17 on: January 05, 2015, 08:14:59 am »
That bodes well...
Back to C++ gamedev with SFML in May 2023

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Way to draw using normalized coordinates via sf::RenderTarget
« Reply #18 on: January 05, 2015, 11:02:22 am »
I also requested this feature some time ago. It was deemed 'too specific' at that time.

http://en.sfml-dev.org/forums/index.php?topic=7243

I'm guessing  that by "Too specific", it meant that the usage is limited to few cases making its implementation not worth it. Personally I havent needed support for normalized co-ordinates and because of that I'm indifferent of its implementation but in the end, it cant hurt right?