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

Pages: [1]
1
General / Re: opening an SFML and a QT window in the same time
« on: April 03, 2014, 03:35:44 pm »
up ! really need help here :(

2
General / opening an SFML and a QT window in the same time
« on: April 01, 2014, 06:09:01 pm »
Hi everybody

I 'm pretty new in coding C++ and i use QT creator , i created a QT window with a button. when it is clicked on it is supposed to open an SFML window. 

no mistakes in compilation , however when the sfml window pop up, the application slow down drastically, also when i click on anything it instantly crash.

so i guess adding an sfml window with a QT window is not that easy, is it even possible ?

here is the code just in case the mistake is from me :
bool MainWindow::InkJetFlush()
{
    int IntCountDown(10);
    string TxtCountDown("10");
    Clock ClTimer;
    Time TimeClock;
    int32 TimeInt;
    float AngleRotation;
    Color BackGroudColor = Color::White;


     RenderWindow WindFlushTimer(VideoMode(300, 300), "Flush");
     Texture TxtNeedle;
     Texture TxtClock;

     if (!TxtNeedle.loadFromFile("ClockNeedle.png"))
     {
             return false;
     }
     Sprite SpNeedle(TxtNeedle);
     SpNeedle.setOrigin(56, 9);
     SpNeedle.rotate(270);
     SpNeedle.setPosition(150, 150);

     if (!TxtClock.loadFromFile("C:/Aprojects/InkJetProject/Clock_cadran.png"))
     {
             return false;
     }
     Sprite SpClock(TxtClock);
     SpClock.setPosition(50, 50);

     Font FoCountDown;
     if (!FoCountDown.loadFromFile("C:/Aprojects/InkJetProject/arial.ttf"))
            return false;

        Text TextCountDown(TxtCountDown, FoCountDown, 90);



    while (WindFlushTimer.isOpen())
    {
        Event TimerEv;

        WindFlushTimer.clear(BackGroudColor);

        WindFlushTimer.draw(SpNeedle);
        WindFlushTimer.draw(SpClock);
        WindFlushTimer.draw(TextCountDown);

        WindFlushTimer.display();
        TimeClock = ClTimer.getElapsedTime();

            if (TimeClock.asSeconds() == 1)
            {
                TextCountDown.setString("9");
                SpNeedle.rotate(AngleRotation);

                if (TimeClock.asSeconds() == 10)
                {
                    WindFlushTimer.close();
                }

            }






    }

    return true;

}

 

PS : as i said i'm new in c++ so i'm sure you will find a lot of thing i did the wrong way, sorry about that, also my english is far from perfect.

Pages: [1]