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 - billarhos

Pages: [1] 2
1
Quote
if (ImGui::Selectable(prefabName.c_str(), selectedPrefabName == prefabName)) {
                    selectedPrefabName = prefabName;
                    selected = true;
                    break;

                }

If u add a break, i think it make it a liitle faster

2
Hi,
i 've noticed that long time ago.
You can add some frames (dublicate the last) at the end of the video. I know this is not a solution.

However, i think it has to do with the "Synchronization Gap". If you change the function "getSynchronizationGap(sf::Time& gap)" to return always true you will see the last frame. I know also that this is also not a solution to the problem.
Maybe the creator can provide a valid fix for this.


in VideoStream.cpp

bool VideoStream::getSynchronizationGap(sf::Time& gap)
    {
        sf::Time position;
        if (computeEncodedPosition(position))
        {
            gap = (position - codecBufferingDelay()) - m_timer->getOffset();
            return true;
        }
        else
        {
            sfeLogDebug("failed computing synchronization gap for video stream, it may become out of sync");

            //return false; comment this
            return true; //add this one
        }
    }
 

3
General / Re: sfeMovie + SFML 2.5.1
« on: February 25, 2019, 08:07:26 pm »
False alarm. It is working!

4
General / sfeMovie + SFML 2.5.1
« on: February 25, 2019, 07:31:29 pm »
Hi, i 'm posting here because there is no more an active forum for sfemovie library.

Has anyone a working sfemovie lib with 2.5.1 version of SFML?

I built it from source but video (ogv) can not be played. Working just fine with 2.4.2 version of SFML.

thank you

5
SFML projects / Re: TGUI: GUI library for SFML
« on: February 15, 2019, 08:02:31 am »
Some photos displaying the usage of TGUI library


6
Network / Re: Web interface for C++ application
« on: November 08, 2018, 09:50:41 pm »
You can try chrome cef
https://en.wikipedia.org/wiki/Chromium_Embedded_Framework

you can register javascript functions and talk via your c++ code

do not forget to built cef without sandbox security

7
DotNet / Re: Input detect once
« on: October 05, 2018, 03:19:39 pm »
You can keep read repeatedly your key strokes and implement your "attack" with toggling a boolean  on key down and key up event.

8
General / Re: Visual Studio 2017 and SFML 2.5.0
« on: May 21, 2018, 10:04:49 am »
In windows system you can gather all sfml dlls (and not only), debug and release in one folder and add this path folder in "environment variables" into "system properties" in User "Path".

For instance "D:\ThirdParty\dlls"

Then visual studio automatically detects this path and no longer have to add those dlls in release or debug folder.

9
Graphics / Re: How to rotate a texture around the center of a rectangle
« on: January 03, 2018, 08:12:24 am »
Thanks a lot. I managed to solve it.

//------------------------------------------------------------------------------
void cSprite::render(sf::FloatRect _dstRect, float _angle, sf::Color color)
{
        if (visible)
        {
                float angle = _angle / 180.f * (float)M_PI;
                float cos = cosf(angle);
                float sin = sinf(angle);

                m_renderStates.texture = texture;
                m_renderStates.blendMode = sf::BlendAlpha;

                sf::Vector2f dest[4];

                float x0 = - size.x / 2;
                float y0 = - size.y / 2;
               
                float x1 = size.x / 2;
                float y1 = y0;
               
                float x2 = size.x / 2;
                float y2 = size.y / 2;
               
                float x3 = x0;
                float y3 = y2;

                float fX = _dstRect.width / size.x;
                float fY = _dstRect.height / size.y;

                float tX = _dstRect.left + _dstRect.width / 2;
                float tY = _dstRect.top + _dstRect.height / 2;

                dest[0].x = (x0 * cos - y0 * sin) * fX + tX;
                dest[0].y = (x0 * sin + y0 * cos) * fY + tY;
                                                                                                 
                dest[1].x = (x1 * cos - y1 * sin) * fX + tX;
                dest[1].y = (x1 * sin + y1 * cos) * fY + tY;
                                                                                                 
                dest[2].x = (x2 * cos - y2 * sin) * fX + tX;
                dest[2].y = (x2 * sin + y2 * cos) * fY + tY;
                                                                                                 
                dest[3].x = (x3 * cos - y3 * sin) * fX + tX;
                dest[3].y = (x3 * sin + y3 * cos) * fY + tY;

                m_vertices[0] = sf::Vertex(
                        dest[0], color,
                        sf::Vector2f(0, 0)
                );

                m_vertices[1] = sf::Vertex(
                        dest[1], color,
                        sf::Vector2f(size.x, 0)
                );

                m_vertices[2] = sf::Vertex(
                        dest[2], color,
                        sf::Vector2f(size.x, size.y)
                );

                m_vertices[3] = sf::Vertex(
                        dest[3], color,
                        sf::Vector2f(0, size.y)
                );

                GAME_MANAGER->getWindow()->draw(m_vertices, 4, sf::PrimitiveType::Quads, m_renderStates);
        }
}

10
Hi

i try to figure out how to rotate a square texture (512x512) around a center of a given rectangle (not square).
here is a my code.

void cSprite::render(sf::FloatRect _dstRect, float _angle, sf::Color color)
{
        if (visible)
        {
                float angle =  _angle / 180.f * (float)M_PI;
                float cos = cosf(angle);
                float sin = sinf(angle);
               
                sf::Sprite              sprite;
                sprite.setTexture(*texture);

                float x = _dstRect.width / size.x;
                float y = _dstRect.height / size.y;
               
                sf::FloatRect rect = sprite.getGlobalBounds();
               
                sprite.setPosition(sf::Vector2f(_dstRect.left + _dstRect.width / 2, _dstRect.top + _dstRect.height / 2));
                sprite.setOrigin(sf::Vector2f(rect.width / 2, rect.height / 2));
                sprite.setRotation(_angle);

                sprite.setScale(sf::Vector2f(x, y));

                GAME_MANAGER->getWindow()->draw(sprite);
        }
}
 

i am trying to make a roulette.
the problem is shown in the attached image
thank you for any suggestions

http://www.mediafire.com/file/bg66i027erqv1na/test%282%29.jpg

11
Graphics / Re: Load from file leads to buffer-overflow
« on: October 14, 2017, 04:00:36 pm »
Hi, have you the correct path for the texture? Also ".jpeg" may be is ".jpg"

12
Window / Re: Borderless Windowed Fullscreen
« on: October 12, 2017, 09:14:15 pm »
Well ok i understand. But maybe this code will help to make a fullscreen borderless window without turning to exclusive fullscreen without reason.

Cheers

13
Window / Re: Borderless Windowed Fullscreen
« on: October 12, 2017, 07:45:20 pm »

14
Window / Re: Borderless Windowed Fullscreen
« on: October 12, 2017, 01:35:59 pm »
Well my modification did not solve any problem, my modification is an addtion to sfml features.

enum
    {
        None       = 0,      ///< No border / title bar (this flag and all others are mutually exclusive)
        Titlebar   = 1 << 0, ///< Title bar + fixed border
        Resize     = 1 << 1, ///< Title bar + resizable border + maximize button
        Close      = 1 << 2, ///< Title bar + close button
        Fullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive)
        FullscreenBorderLess = 1 << 4, ///< Fullscreen mode borderless
        Default = Titlebar | Resize | Close ///< Default window style
    };
 

as soon as i find little time i create a branch. maybe in this afternoon

15
Window / Re: Borderless Windowed Fullscreen
« on: October 12, 2017, 01:11:58 pm »
Is it better for you, if i create a git hub branch  or to write down the changes i made?
I am using this code for more than year without a problem.

Pages: [1] 2