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

Author Topic: Change wnd title/ Non-closed polygons /ConvertCoords in View  (Read 19055 times)

0 Members and 1 Guest are viewing this topic.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Change wnd title/ Non-closed polygons /ConvertCoords in View
« on: November 21, 2008, 11:56:41 pm »
Change window title: I find useful in some cases to change the title dynamically at runtime. I think this should be trivial to implement without breaking any notation.

----

If I need to draw a non closed polygon, I can't do it using the Shape class, so I have to implement it by hand using OpenGL; which is not a tough task but it would be good to have some sort easy line-drawing and point-drawing utility function without the need to use a class that stores all configuration which is freed soon afterwards.

I would be able to have a list<Vector2f> and draw the open-poly myself, instead of saving lots of Shapes returned from Shape::Line.

----

It would be very useful to have a ConvertCoords function inside the View class.
If I maintain two views (e.g. HUD & Game) and want to be able to get those coordinates during the input processing phase of the frame (in contrast with the drawing one).
I don't understand the need to assign it first to the RenderWindow to use it.

----

Also, I came to notice that polygons are not drawn using GL_LINES
Why is that?

----

I don't mean to sound pesky, these are just ideas that ran thru my mind while using this Great (with capital G) library.

Keep it up! Thanks!
-Martín

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Change wnd title/ Non-closed polygons /ConvertCoords in View
« Reply #1 on: November 22, 2008, 10:12:08 am »
Quote
Change window title: I find useful in some cases to change the title dynamically at runtime. I think this should be trivial to implement without breaking any notation.

Yep, it's already planned.

Quote
If I need to draw a non closed polygon, I can't do it using the Shape class

Shape can only draw convex polygons, which non-closed polygons are not.

Quote
It would be very useful to have a ConvertCoords function inside the View class.
I don't understand the need to assign it first to the RenderWindow to use it.

The input of such function is coordinates relative to a specific window. The result depends on the size of this window, it won't be the same on two different windows.

Quote
Also, I came to notice that polygons are not drawn using GL_LINES
Why is that?

Because GL_LINES draw lines, not polygons.

Quote
I don't mean to sound pesky, these are just ideas that ran thru my mind while using this Great (with capital G) library.

Yeah, I always appreciate such feedbacks, don't hesitate to post more suggestions :)

Thank you very much.
Laurent Gomila - SFML developer

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Change wnd title/ Non-closed polygons /ConvertCoords in View
« Reply #2 on: November 23, 2008, 02:56:52 pm »
Thanks for the answers!

I know "Shape" can draw only convex polyedra, as it does a triangle fan with a point at the center (which would glitch with some concave polygons)
Sorry about the GL_LINES thingy, I meant why not use GL_POLYGON, as I think it can color-fill concave shapes.

Maybe in a fuuuuuuuuuuuture version, polygons could have Delaunai triangulation (for texturized convex/concave polyedra) :D


Quote
The input of such function is coordinates relative to a specific window. The result depends on the size of this window, it won't be the same on two different windows.

You're right, I haven't thought about that  :oops:


Well, good luck and keep it up!
-Martín

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Change wnd title/ Non-closed polygons /ConvertCoords in View
« Reply #3 on: November 23, 2008, 07:14:30 pm »
GL_POLYGON can do nothing more than what SFML does. Using triangles directly (which is what the drivers does anyway with GL_POLYGON) is more flexible and allows me to add features / optimizations in the future.
Laurent Gomila - SFML developer