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

Author Topic: Add CoordinateType member to RenderStates class  (Read 3173 times)

0 Members and 1 Guest are viewing this topic.

Lee R

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Add CoordinateType member to RenderStates class
« on: March 08, 2012, 11:56:08 pm »
Hi,

sf::RenderStates should have a 'CoordinateType' data member (of type sf::Texture::CoordinateType) to enable the use of normalized texture coordinates in vertex arrays rendered by sf::RenderTarget::Draw.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Add CoordinateType member to RenderStates class
« Reply #1 on: March 09, 2012, 12:14:36 am »
SFML is made to work with pixel texture coordinates. Normalized coordinates mode is only meant for interaction with OpenGL code.

Can you explain why you need to use normalized coordinates within the graphics module of SFML?
Laurent Gomila - SFML developer

Lee R

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Add CoordinateType member to RenderStates class
« Reply #2 on: March 09, 2012, 01:05:39 am »
I don't "need" to work with normalized coordinates any more than SFML needs to work with pixel coordinates ;)

It came to mind while implementing Gwen GUI's renderer class. In Gwen, texture coords are normalized, so having to access the texture's width and height members, then scaling the coords before handing them off to SFML seemed somewhat pointless and wasteful, given the existence of sf::Texture::CoordinateType.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Add CoordinateType member to RenderStates class
« Reply #3 on: March 09, 2012, 02:54:22 am »
I understand.

But I won't implement this feature, sorry. It's too specific.

By the way, how did the renderer work before the new graphics API (and its vertex arrays)?
Laurent Gomila - SFML developer

Lee R

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Add CoordinateType member to RenderStates class
« Reply #4 on: March 09, 2012, 03:33:19 am »
Alrighty.

Quote from: "Laurent"
By the way, how did the renderer work before the new graphics API (and its vertex arrays)?

Raw OpenGL calls.

It still doesn't use vertex arrays directly, yet (it creates a RectangleShape and gives it a texture), but I'm working on a patch for that.

EDIT: I'm not the author of the original Gwen SFML renderer, btw.