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

Pages: [1]
1
General / Re : SFML doesn't work with my Qt Creator
« on: March 19, 2016, 09:47:38 pm »
So, what should I to do?
I am a newbie.

2
General / Re : SFML doesn't work with my Qt Creator
« on: March 19, 2016, 09:09:22 pm »
SpeCter you're right, but this hasn't resolve my problem yet.
I don't have any errors. If I run project I have only cmd window without any presenece SFML.

3
General / Re : SFML doesn't work with my Qt Creator
« on: March 19, 2016, 07:36:39 pm »
Still the same.
For sure I have good code in file .pro?

4
General / Re : SFML doesn't work with my Qt Creator
« on: March 19, 2016, 06:05:45 pm »
Yes, I checked few times if it is in correct place.
I don't have errors, but few warnings.

5
General / SFML doesn't work with my Qt Creator
« on: March 19, 2016, 05:52:31 pm »
Hi,

I have Qt with mingw492 compiler. I downloaded GCC 4.9.2 MinGW (DW2) - 32-bit SFML.

This is my *.pro file

TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt

LIBS += -LD:\Programmin\DTW\SFML2\lib

CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-main -lsfml-network -clsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-main-d -lsfml-network-d -lsfml-window-d -lsfml-system-d

INCLUDEPATH += D:\Programmin\DTW\SFML2\include
DEPENDPATH += D:\Programmin\DTW\SFML2\include


SOURCES += main.cpp
 

and this is my c++ code
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

using namespace std;

int main(int argc, char *argv[])
{
    sf::RenderWindow Window(sf::VideoMode(640, 480, 32), "Recording Sounds");

    if(!sf::SoundBufferRecorder::isAvailable()){
        cout << "something went wrong" << endl;
    }

    sf::SoundBufferRecorder recorder;
    sf::SoundBuffer buffer;
    sf::Sound sound;

    while(Window.isOpen()){
        sf::Event Event;
        while(Window.pollEvent(Event)){
            switch(Event.type){

            case sf::Event::Closed:
                Window.close();
                break;
            case sf::Event::KeyPressed:
                if(Event.key.code == sf::Keyboard::R){
                    recorder.start();
                }
                else if(Event.key.code == sf::Keyboard::S){
                    recorder.stop();
                    buffer = recorder.getBuffer();
                    sound.setBuffer(buffer);
                    sound.play();
                }
            }
        }
        Window.clear(sf::Color(0, 240, 255));
        Window.display();
    }
    getchar();
    return 0;
}
 

If I run my project I have only cmd window. My qt doesn't appear SFML window and I don't know what I should to do.  I work on Windows 10.

Anybody can help me what I did wrong?
I will appreciate your help.

Pages: [1]