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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lmorsino

Pages: [1]
1
General / Re: Is there a way to force SFML to do exact selection?
« on: November 10, 2014, 09:52:02 pm »
Thanks for the suggestions. I found this solution that is quite simple:

http://stackoverflow.com/questions/11716268/point-in-polygon-algorithm

2
General / Is there a way to force SFML to do exact selection?
« on: November 10, 2014, 07:22:57 pm »
I want to be able to select a sf::Shape by clicking with the mouse. I realize I can call sf::Shape::getGlobalBounds to get the bounding rectangle and use sf::FloatRect::contains to test against a point. But what if I need to know if the user clicked on the Shape itself, not just inside its bounding rectangle? Is there a way to do this in SFML?

3
Window / Best way to draw at pixel position instead of world position?
« on: October 05, 2014, 10:38:29 am »
What is the best way to draw an object at a specific pixel location rather than world position? I want to draw a sf::Text in one corner regardless of zoom, rotation, translation of the main view or the size of the window. So far, I have done this:

sf::View savedView = window.getView();
sf::View tempView;
tempView.reset(sf::FloatRect(0, 0, window.getSize().x, window.getSize().y));
// ....
window.setView(tempView);
window.draw(text);
window.setView(savedView);
 

This works, but is it the recommended way? Is there a faster/better way?

Thanks,
lmorsino

4
Graphics / Re: SFML with vertex array objects
« on: June 02, 2014, 09:46:56 pm »
Well, when I try to use GLEW 1.10 for example, I get a warning message at compile time that says

"warning: libGLEW.so.1.5, needed by libsfml-graphics.so, not found"

So this is why I think it matters to SFML. Is it needed or is it not needed?

5
Graphics / SFML with vertex array objects
« on: June 02, 2014, 07:16:01 pm »
Trying to get VAOs working, not succeeding, and I'm wondering if it is because of GLEW.

Basically, I try to do this:

glGenVertexArrays(1, &g_vao);
glBindVertexArray(g_vao);

This doesn't compile. I looked into it further and it seems like GLEW 1.5.0 (is this version specifically required by SFML 2.1?) doesn't support vertex arrays. When I tried

if (glewIsSupported("GL_ARB_vertex_array_object"))

...this returns false. If I upgrade to the latest version of GLEW 1.10.0, it returns true but my app crashes during rendering (presumably because SFML doesn't support 1.10.0)

Later I found this page: http://glew.sourceforge.net/log.html
...which seems to indicate vertex arrays weren't added until GLEW 1.5.1

Am I understanding this correctly? Are we simply meant to not use VAOs in SFML?

If it matters, I am on Ubuntu 13.10-64 bit with C::B, and I am not using SFML for drawing - its pure OpenGL calls.
Thanks!

Pages: [1]