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

Recent Posts

Pages: [1] 2 3 ... 10
1
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.
2
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.
3
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?
4
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.
5
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!
6
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.
7
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
8
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. :)
9
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
10
General discussions / Music does not rewind.
« Last post by mejak on May 14, 2024, 06:57:23 pm »
I'm using 2.5.1, and I noticed that when music streamed from a .flac file stops from playing to the end, it doesn't rewind, so the next time you play it, it immediately stops. I fixed it by calling stop() right before play().
If it's a known bug, or if it was fixed, or if I'm missing something, you can delete the thread, since I'm ok with my hacky fix, just thought you'd know.
Pages: [1] 2 3 ... 10