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

Recent Posts

Pages: [1] 2 3 ... 10
1
Graphics / Re: How to correctly draw a triangle fan?
« Last post by Hapax on Today at 10:46:51 pm »
It seems that there is an issue when those triangles are thin - possibly infinitely thin or even inverted due to rounding errors.
Triangle fans are not supposed to have overlapping triangles so it could have an issue with this when those triangles are 'thin'.

You could try replacing it with a triangle strip; this should be able to do similar but would require specifying the centre point multiple times. Plus, the strip might also suffer from the same issues, depending on Open GL feels about that.

The safest bet, I would say, is to use separate triangles. The formation of the triangles does not matter so if they overlap or 'go backwards', it's fine since each triangle doesn't affect any other triangle.

Of course, you would need almost 3 times as many vertices (it would be 3 times the vertices you have now minus 2) since you would just simply specify each triangle's vertices separately, repeating quite a few.
2
In addition - and something I was going to mention in my previous post but forgot - you should consider DPI awareness.

This can throw all sorts of things out if one version is DPI aware (even if automatic) and the other is not.

It's a very complicated issue, by the way, but I think Mac and Windows treat it differently by default. Possibly the way SFML treats it is different in those operating systems too but I'm not sure.
3
Graphics / How to correctly draw a triangle fan?
« Last post by Nortski on Today at 07:49:40 pm »
So so close to getting my visibility polygon working. I'm using an SFML triangle fan with all the vertex points sorted by angle size with position 0 set to the mouse coords and the last element set to element 2, I needed to do this to fill in the gap for the last triangle.
However; a triangle appears to be missing at certain locations, see video.
I suspect that I'm having an out by one issue with my loop. I've tried rearranging a few numbers but this is the closest I can get.
https://streamable.com/d46yih

sf::VertexArray visibilityPolygon(sf::TriangleFan, vectorAngleContainer.size() + 1);
visibilityPolygon[0] = ray[0].position;

for (int i = 1; i <= vectorAngleContainer.size(); i++)
{
    visibilityPolygon[i] = sf::Vertex(sf::Vector2f(vectorAngleContainer[i-1].position.x, vectorAngleContainer[i-1].position.y), sf::Color::Red);
}
visibilityPolygon[vectorAngleContainer.size()] = visibilityPolygon[1].position;

vectorAngleContainer() is a vector of structs that holds a point and and angle.
4
General / Re: Can you integrate allegro into an sfml window?
« Last post by Me-Myself-And-I on Today at 03:23:41 pm »
Quote
What sort of video do you need to support? If it's just for some intro videos/cutscenes pl_mpeg is pretty easy to integrate with a RenderTexture/AudioStream
This sounds like what I need. Could you please show me an example script of the video player being used for sfml?
5
Graphics / Re: Cannot find smfl-graphics-2.dll
« Last post by kingwolf112 on Today at 11:22:21 am »
The solution is to also compile the SFML dependancies using the
 https://github.com/eXpl0it3r/SFML-dependencies/wiki

The dependancies come pre compiled , hence no support for UCRT.
6
Graphics / Re: Align the text perfectly centered inside any shape
« Last post by nktsrbrkv on May 15, 2024, 07:14:24 pm »
Many thanks for all of your replies!
7
General / Re: Can you integrate allegro into an sfml window?
« Last post by kojack on May 15, 2024, 11:32:16 am »
If you don't need audio, OpenCV is very easy to get working in SFML (1 line of code to load a video, about 5 lines to read a frame into a texture, do that with a timer). I haven't done much with it, I was just testing security camera footage analysis and playback, so the video was already low framerate.
8
General / Re: Can you integrate allegro into an sfml window?
« Last post by fallahn on May 15, 2024, 10:46:39 am »
What sort of video do you need to support? If it's just for some intro videos/cutscenes pl_mpeg is pretty easy to integrate with a RenderTexture/AudioStream
https://github.com/phoboslab/pl_mpeg

or there's more comprehensive support with libvlc:
https://github.com/kjetand/vlc4sfml
9
General / Re: Can you integrate allegro into an sfml window?
« Last post by Me-Myself-And-I on May 15, 2024, 01:18:35 am »
I see... I thought perhaps allegro would be reasonably easy to put into an sfml window. Looks like that brings me back to sfemovie, which is something I have so far unsuccessfully setup.  ::)  Thanks anyways. :)
10
General discussions / Re: Music does not rewind.
« Last post by kimci86 on May 14, 2024, 07:01:51 pm »
This is a known bug which was fixed in SFML 2.6
https://github.com/SFML/SFML/pull/2175
Pages: [1] 2 3 ... 10
anything