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

Pages: [1]
2
Graphics / Re: [HOW] How Do You Play Videos in SFML? : SFML
« on: March 23, 2021, 09:04:37 am »
FFmpeg is indeed a powerful video encoder/decoder tool¹. It operates in the command line, as opposed to using a GUI. Command line is that black window you find by clicking [windows+r] and typing cmd then hitting enter. This is also called "command prompt". Once setup you enter ffmpeg commands in one of these windows to use it.

Here are the basic steps to "install" and use it:

Installation
Go to the ffmpeg download site and download the zip file that best fits your computer's specs. Choose the "static" linking and the "nightly git" version for the most current usability.
Create a folder on your computer to unpack the zip file. This folder will be your "installation" folder. I chose C:\Program Files\ffmpeg\. This is a good idea because you will treat this like a regular program. Unpack the zip file into this folder.
The folder should now contain a number of other folders, including one titled bin where ffmpeg.exe is saved. We're not done yet. Double clicking that file does nothing. Remember, this is a command line program. It runs in cmd.
Before you can use ffmpeg.exe in cmd you have to tell your computer where it can find it. You need to add a new system path. First, right click This PC (Windows 10) or Computer (Windows 7) then click Properties > Advanced System Settings > Advanced tab > Environment Variables.
In the Environment Variables window, click the "Path" row under the "Variable" column, then click Edit Steps to add a System path to Windows
The "Edit environment variable" window looks different for Windows 10 and 7. In Windows 10 click New then paste the path to the folder that you created earlier where ffmpeg.exe is saved. For this example, that is C:\Program Files\ffmpeg\bin\ Add new system path Windows 10] In Windows 7 all the variables are listed in a single string, separated by a semicolon. Simply go the the end of the string, type a semicolon (;), then paste in the path. Add new system path Windows 7
Click Ok on all the windows we just opened up.
ffmpeg is now "installed". The Command Prompt will now recognize ffmpeg commands and will attempt to run them.

Updating ffmpeg
To update ffmpeg, just revisit the download page in step 1 above and download the zip file. Unpack the files and copy them over the old files in the folder you created in step 2.

Using ffmpeg
Using ffmpeg requires that you open a command prompt window, then type ffmpeg specific commands. Here is a typical ffmpeg command:

 ffmpeg -i video.mp4 -vn -ar 44100 -ac 1 -b:a 32k -f mp3 audio.mp3
This command has four parts:

ffmpeg - This command tells cmd that we want to run ffmpeg commands. cmd will first look for ffmpeg.exe in one of the folders from step 6 in the Installation section. If it is found, it will attempt to run the command.
-i video.mp4 - This is an input file. We are going to be doing work on this file.
-vn -ar 44100 -ac 1 -b:a 32k -f mp3 - These are the "arguments". These characters are like mini commands that specify exactly what we want to do. In this case, it is saying create an mp3 file from the input source.
-vn - Leave out the video stream
-ar 44100 - Specifies audio resolution in hertz.
-ac 1 - Audio channels, only 1. This is effectively "make mono".
-b:a 32k - Audio bitrate, set to 32 kbps.
-f mp3 - Force to MP3 conversion. Without this command, ffmpeg attempts to interpret what you want based on the extension you use in the output file name.
audio.mp3- This is the output file.
As you can probably guess, this short command makes an MP3 audio file from an MP4 file.

To run this command, assuming you have an MP4 file to try this on, follow these steps:

Hit the Windows key + r.
Type cmd then enter.
Change the path to where the file is that you want to work on. Type cd [path]. It should look something like cd C:\Users\name\Desktop\.
Now type the ffmpeg command with the name of your input file. The command will run with some feedback. When it's done, cmd will be available for more commands.
This is the basic way to use ffmpeg. The commands can get far more complicated, but that's only because the program has so much power. Using the ffmpeg documentation, you can learn all the commands and create some very powerful scripts. After that, you can save these scripts into a .bat file so that you just have to double click a file instead of type out the whole command each time. For example, this answer contains a script that will create MP3's from all the MP4's in a folder. Then we would be combining the power of ffmpeg with the power of cmd, and that's a nice place to be when you have to do professional quality video/audio encoding on mountains of files.

From
https://video.stackexchange.com/questions/20495/how-do-i-set-up-and-use-ffmpeg-in-windows

3
then put the resources in the same folder as the .exe
or specify the full path, like " c:/user/Desktop/myAppResources/images/tiles.png "

if you really want to embed resources in your executable, you need to convert them to C header, create an array in your code with the binary values, and then use the loadFromMemory option. here's a topic explaining that. in Linux there is a simple program that does the 'conversion' from the file, called xxd.

Hi Stauricus,

Thanks for the help.

Actually, all I needed was WinRar and to follow the steps in the video.

1. Add the relevant files and .exe to Winrar.
2. Change the archive name extension to .exe
3. Check the "Create SFX archive"
4. Go to Advanced tab -> SFX Options -> General
5. Type in the path to extract to E.g. C:\Program Files (x86)
6. Go to Advanced tab -> SFX Options -> Text and Icon
7. Add relavant images and instructions
8. Press OK, OK.

You will then have an .exe file that you can hand around to your friends and family.

References

4
General / Re: [HELP] Racing Tutorial Churns out Gibberish : SFML
« on: March 10, 2021, 05:17:31 am »
You're probably mixing debug and release mode

Haizz... I'm so silly...

Thank you so much...

You were correct...

I forgot the -d, I thought it worked since the window poped up.

Thanks eXpl0it3r

5
Kvaz1r, hopefully, this will help you with your setup as well?

Hey, my setup is ok, topic started is other user ;)

I solved the problem using Youtube.

Thank you.

How do I mark this post as solved?

6
Graphics / [HOW] How Do You Play Videos in SFML? : SFML
« on: March 09, 2021, 07:21:50 am »
How do you code SFML in C++ to become a media player for playing videos?

To play .mpeg, .avi, .mp3, .mp4 etc within SFML.

E.g. You win a stage, then a cut-scene video will play, and then back to the game.

7
its not a good idea to pack any resources in the .exe file. one reason is that your final file will be too big. another is that you'll have all resources loaded 100% of the time, even if you are not using them. and there are some other good reasons too.

but in your case, your application is not finding the images. are these files in the same folder as the project?

No, I moved the .exe to the Desktop to play with.

I would like to pack the resources with the .exe file.

How do I pack them as 1 file?

I would also like to share them with others.

8
General / [HELP] Racing Tutorial Churns out Gibberish : SFML
« on: March 09, 2021, 12:08:45 am »
Hi,
Could someone help me with this issue with the tutorial?

The Debug Mode x86 releases this peculiar image (attached image).

It involves memcpy.asm and currently assembly is too low-level for me to understand.

#include <SFML/Graphics.hpp>
using namespace sf;

const int num = 8; //checkpoints
int points[num][2] = { 300, 610,
                      1270,430,
                      1380,2380,
                      1900,2460,
                      1970,1700,
                      2550,1680,
                      2560,3150,
                      500, 3300 };

struct Car
{
    float x, y, speed, angle; int n;

    Car() { speed = 2; angle = 0; n = 0; }

    void move()
    {
        x += sin(angle) * speed;
        y -= cos(angle) * speed;
    }

    void findTarget()
    {
        float tx = points[n][0];
        float ty = points[n][1];
        float beta = angle - atan2(tx - x, -ty + y);
        if (sin(beta) < 0) angle += 0.005 * speed; else angle -= 0.005 * speed;
        if ((x - tx) * (x - tx) + (y - ty) * (y - ty) < 25 * 25) n = (n + 1) % num;
    }
};


int main()
{
    RenderWindow app(VideoMode(640, 480), "Car Racing Game!");
    app.setFramerateLimit(60);

    Texture t1, t2, t3;
    t1.loadFromFile("images/background.png");
    t2.loadFromFile("images/car.png");
    t1.setSmooth(true);
    t2.setSmooth(true);

    Sprite sBackground(t1), sCar(t2);
    sBackground.scale(2, 2);

    sCar.setOrigin(22, 22);
    float R = 22;

    const int N = 5;
    Car car[N];
    for (int i = 0; i < N; i++)
    {
        car[i].x = 300 + i * 50;
        car[i].y = 1700 + i * 80;
        car[i].speed = 7 + i;
    }

    float speed = 0, angle = 0;
    float maxSpeed = 12.0;
    float acc = 0.2, dec = 0.3;
    float turnSpeed = 0.08;

    int offsetX = 0, offsetY = 0;

    while (app.isOpen())
    {
        Event e;
        while (app.pollEvent(e))
        {
            if (e.type == Event::Closed)
                app.close();
        }

        bool Up = 0, Right = 0, Down = 0, Left = 0;
        if (Keyboard::isKeyPressed(Keyboard::Up)) Up = 1;
        if (Keyboard::isKeyPressed(Keyboard::Right)) Right = 1;
        if (Keyboard::isKeyPressed(Keyboard::Down)) Down = 1;
        if (Keyboard::isKeyPressed(Keyboard::Left)) Left = 1;

        //car movement
        if (Up && speed < maxSpeed)
            if (speed < 0)  speed += dec;
            else  speed += acc;

        if (Down && speed > -maxSpeed)
            if (speed > 0) speed -= dec;
            else  speed -= acc;

        if (!Up && !Down)
            if (speed - dec > 0) speed -= dec;
            else if (speed + dec < 0) speed += dec;
            else speed = 0;

        if (Right && speed != 0)  angle += turnSpeed * speed / maxSpeed;
        if (Left && speed != 0)   angle -= turnSpeed * speed / maxSpeed;

        car[0].speed = speed;
        car[0].angle = angle;

        for (int i = 0; i < N; i++) car[i].move();
        for (int i = 1; i < N; i++) car[i].findTarget();

        //collision
        for (int i = 0; i < N; i++)
            for (int j = 0; j < N; j++)
            {
                int dx = 0, dy = 0;
                while (dx * dx + dy * dy < 4 * R * R)
                {
                    car[i].x += dx / 10.0;
                    car[i].x += dy / 10.0;
                    car[j].x -= dx / 10.0;
                    car[j].y -= dy / 10.0;
                    dx = car[i].x - car[j].x;
                    dy = car[i].y - car[j].y;
                    if (!dx && !dy) break;
                }
            }


        app.clear(Color::White);

        if (car[0].x > 320) offsetX = car[0].x - 320;
        if (car[0].y > 240) offsetY = car[0].y - 240;

        sBackground.setPosition(-offsetX, -offsetY);
        app.draw(sBackground);

        Color colors[10] = { Color::Red, Color::Green, Color::Magenta, Color::Blue, Color::White };

        for (int i = 0; i < N; i++)
        {
            sCar.setPosition(car[i].x - offsetX, car[i].y - offsetY);
            sCar.setRotation(car[i].angle * 180 / 3.141593);
            sCar.setColor(colors[i]);
            app.draw(sCar);
        }

        app.display();
    }

    return 0;
}


Exception thrown at 0x6E1C3670 (vcruntime140.dll) in sfmlRacing.exe: 0xC0000005: Access violation reading location 0x033FF000.

align 16
XmmCopySmallLoop:
        movdqu      xmm0, xmmword ptr [esi] <<<<--------HERE
        movdqu      xmm1, xmmword ptr [esi + 10h]
        movdqu      xmmword ptr [edi], xmm0
        movdqu      xmmword ptr [edi + 10h], xmm1
        lea         esi, [esi + 20h]
        lea         edi, [edi + 20h]
        dec         edx
        jne         XmmCopySmallLoop

References


'sfmlRacing.exe' (Win32): Loaded 'C:\Users\user\source\repos\sfmlRacing\Debug\sfmlRacing.exe'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Users\user\source\repos\sfmlRacing\sfmlRacing\sfml-system-2.dll'. Module was built without symbols.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Users\user\source\repos\sfmlRacing\sfmlRacing\sfml-window-2.dll'. Module was built without symbols.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Users\user\source\repos\sfmlRacing\sfmlRacing\sfml-graphics-2.dll'. Module was built without symbols.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
The thread 0x3434 has exited with code 0 (0x0).
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\AppXDeploymentClient.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\AppXDeploymentClient.dll'
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_774120bbcad3ef2b\nvoglv32.dll'.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Symbols loaded.
The thread 0x2278 has exited with code 0 (0x0).
The thread 0x256c has exited with code 0 (0x0).
The thread 0x109c has exited with code 0 (0x0).
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DXCore.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wldp.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvspcap.dll'.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\umpdc.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winsta.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dinput8.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\InputHost.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\propsys.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\hid.dll'. Symbols loaded.
'sfmlRacing.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'. Symbols loaded.
Exception thrown at 0x6E1C3670 (vcruntime140.dll) in sfmlRacing.exe: 0xC0000005: Access violation reading location 0x033FF000.

The program '[9568] sfmlRacing.exe' has exited with code 0 (0x0).


9
Hi,
How does one pack and add images to the Release .exe file?

If you do it normally, you will have an error message (attached image).

10
In the project's properties, add:
- The path to the SFML libraries (<sfml-install-path>/lib) to Linker » General » Additional Library Directories
Most likely you didn't follow this step for your release settings.

All hail G and his/her debugging powers.

You were right, I had forgotten to set the same configuration for Debug and Release.

Thank you so much.

Hail G! Hail G!

11
#include <SFML/Graphics.hpp>
#include <time.h>
using namespace sf;

const int M = 20;
const int N = 10;

int field[M][N] = { 0 };

struct Point
{
    int x, y;
} a[4], b[4];

int figures[7][4] =
{
    1,3,5,7, // I
    2,4,5,7, // Z
    3,5,4,6, // S
    3,5,4,7, // T
    2,3,5,7, // L
    3,5,7,6, // J
    2,3,4,5, // O
};

bool check()
{
    for (int i = 0; i < 4; i++)
        if (a[i].x < 0 || a[i].x >= N || a[i].y >= M) return 0;
        else if (field[a[i].y][a[i].x]) return 0;

    return 1;
};


int main()
{
    srand(time(0));

    RenderWindow window(VideoMode(320, 480), "The Game!");

    Texture t1, t2, t3;
    t1.loadFromFile("images/tiles.png");
    t2.loadFromFile("images/background.png");
    t3.loadFromFile("images/frame.png");

    Sprite s(t1), background(t2), frame(t3);

    int dx = 0; bool rotate = 0; int colorNum = 1;
    float timer = 0, delay = 0.3;

    Clock clock;

    while (window.isOpen())
    {
        float time = clock.getElapsedTime().asSeconds();
        clock.restart();
        timer += time;

        Event e;
        while (window.pollEvent(e))
        {
            if (e.type == Event::Closed)
                window.close();

            if (e.type == Event::KeyPressed)
                if (e.key.code == Keyboard::Up) rotate = true;
                else if (e.key.code == Keyboard::Left) dx = -1;
                else if (e.key.code == Keyboard::Right) dx = 1;
        }

        if (Keyboard::isKeyPressed(Keyboard::Down)) delay = 0.05;

        //// <- Move -> ///
        for (int i = 0; i < 4; i++) { b[i] = a[i]; a[i].x += dx; }
        if (!check()) for (int i = 0; i < 4; i++) a[i] = b[i];

        //////Rotate//////
        if (rotate)
        {
            Point p = a[1]; //center of rotation
            for (int i = 0; i < 4; i++)
            {
                int x = a[i].y - p.y;
                int y = a[i].x - p.x;
                a[i].x = p.x - x;
                a[i].y = p.y + y;
            }
            if (!check()) for (int i = 0; i < 4; i++) a[i] = b[i];
        }

        ///////Tick//////
        if (timer > delay)
        {
            for (int i = 0; i < 4; i++) { b[i] = a[i]; a[i].y += 1; }

            if (!check())
            {
                for (int i = 0; i < 4; i++) field[b[i].y][b[i].x] = colorNum;

                colorNum = 1 + rand() % 7;
                int n = rand() % 7;
                for (int i = 0; i < 4; i++)
                {
                    a[i].x = figures[n][i] % 2;
                    a[i].y = figures[n][i] / 2;
                }
            }

            timer = 0;
        }

        ///////check lines//////////
        int k = M - 1;
        for (int i = M - 1; i > 0; i--)
        {
            int count = 0;
            for (int j = 0; j < N; j++)
            {
                if (field[i][j]) count++;
                field[k][j] = field[i][j];
            }
            if (count < N) k--;
        }

        dx = 0; rotate = 0; delay = 0.3;

        /////////draw//////////
        window.clear(Color::White);
        window.draw(background);

        for (int i = 0; i < M; i++)
            for (int j = 0; j < N; j++)
            {
                if (field[i][j] == 0) continue;
                s.setTextureRect(IntRect(field[i][j] * 18, 0, 18, 18));
                s.setPosition(j * 18, i * 18);
                s.move(28, 31); //offset
                window.draw(s);
            }

        for (int i = 0; i < 4; i++)
        {
            s.setTextureRect(IntRect(colorNum * 18, 0, 18, 18));
            s.setPosition(a[i].x * 18, a[i].y * 18);
            s.move(28, 31); //offset
            window.draw(s);
        }

        window.draw(frame);
        window.display();
    }

    return 0;
}

Hi,
I'm having some issues with the SFML Tetris tutorial with the Release version.

I tried using Debug mode and it works (see image 1).

However, the Release -s version is most confusing. (see image 2)

These are the Additional Dependencies for the Linker.
freetype.lib;gdi32.lib;opengl32.lib;winmm.lib;sfml-system-s.lib;sfml-window-s.lib;sfml-graphics-s.lib;sfml-network-s.lib;sfml-audio-s.lib;%(AdditionalDependencies)

Does the order of .lib entry have a major impact? ie the errror message seem to be dependent on the order I set the .lib files

What am I missing?

References
https://www.sfml-dev.org/tutorials/2.5/start-vc.php

Build started...
1>------ Build started: Project: smflTetris, Configuration: Release Win32 ------
1>LINK : fatal error LNK1181: cannot open input file 'sfml-system-s.lib'
1>Done building project "smflTetris.vcxproj" -- FAILED.
1>
1>Project Performance Summary:
1>      154 ms  C:\Users\user\source\repos\smflTetris\smflTetris\smflTetris.vcxproj   1 calls
1>
1>Target Performance Summary:
1>        0 ms  _CheckForInvalidConfigurationAndPlatform   1 calls
1>        0 ms  _ResourceCompile                           1 calls
1>        0 ms  AfterResourceCompile                       1 calls
1>        0 ms  MakeDirsForResourceCompile                 1 calls
1>        0 ms  BeforeResourceCompile                      1 calls
1>        0 ms  _ClCompile                                 1 calls
1>        0 ms  AfterClCompile                             1 calls
1>        0 ms  SelectClCompile                            1 calls
1>        0 ms  MakeDirsForCl                              1 calls
1>        0 ms  FixupCLCompileOptions                      1 calls
1>        0 ms  WarnCompileDuplicatedFilename              1 calls
1>        0 ms  ComputeReferenceCLInput                    1 calls
1>        0 ms  GetReferencedVCProjectsInfo                1 calls
1>        0 ms  FindReferenceAssembliesForReferences       1 calls
1>        0 ms  ComputeCLInputPDBName                      1 calls
1>        0 ms  BeforeClCompile                            1 calls
1>        0 ms  AfterBuildCompileEvent                     1 calls
1>        0 ms  _BuildCompileAction                        1 calls
1>        0 ms  BuildCompile                               1 calls
1>        0 ms  BuildLinkTraverse                          1 calls
1>        0 ms  PreLinkEvent                               1 calls
1>        0 ms  DoLinkOutputFilesMatch                     1 calls
1>        0 ms  MakeDirsForLink                            1 calls
1>        0 ms  PrepareResourceNames                       1 calls
1>        0 ms  CreateCustomManifestResourceNames          1 calls
1>        0 ms  SplitResourcesByCulture                    1 calls
1>        0 ms  AssignTargetPaths                          1 calls
1>        0 ms  BuildCompileTraverse                       1 calls
1>        0 ms  ComputeManifestInputsTargets               1 calls
1>        0 ms  ComputeCLGeneratedLinkInputs               1 calls
1>        0 ms  ComputeCLOutputs                           1 calls
1>        0 ms  ComputeManifestGeneratedLinkerInputs       1 calls
1>        0 ms  ComputeRCGeneratedLinkInputs               1 calls
1>        0 ms  ComputeRCOutputs                           1 calls
1>        0 ms  BeforeLink                                 1 calls
1>        0 ms  ComputeLegacyManifestEmbedding             1 calls
1>        0 ms  ComputeLinkInputsFromProject               1 calls
1>        0 ms  ComputeLinkSwitches                        1 calls
1>        0 ms  BuildGenerateSources                       1 calls
1>        0 ms  AfterBuildGenerateSourcesEvent             1 calls
1>        0 ms  PrepareForBuild                            1 calls
1>        0 ms  SetCABuildNativeEnvironmentVariables       1 calls
1>        0 ms  _CheckWindowsSDKInstalled                  1 calls
1>        0 ms  GetResolvedWinMD                           1 calls
1>        0 ms  SetBuildDefaultEnvironmentVariables        1 calls
1>        0 ms  GetReferenceAssemblyPaths                  1 calls
1>        0 ms  GetFrameworkPaths                          1 calls
1>        0 ms  ResolveSDKReferences                       1 calls
1>        0 ms  ResolveProjectReferences                   1 calls
1>        0 ms  _GetProjectReferenceTargetFrameworkProperties   1 calls
1>        0 ms  _SplitProjectReferencesByFileExistence     1 calls
1>        0 ms  AssignProjectConfiguration                 1 calls
1>        0 ms  BeforeResolveReferences                    1 calls
1>        0 ms  _PrepareForReferenceResolution             1 calls
1>        0 ms  _PrepareForBuild                           1 calls
1>        0 ms  SetTelemetryEnvironmentVariables           1 calls
1>        0 ms  PrepareProjectReferences                   1 calls
1>        0 ms  ExpandSDKReferences                        1 calls
1>        0 ms  ResolveAssemblyReferences                  1 calls
1>        0 ms  AfterResolveReferences                     1 calls
1>        0 ms  AfterMidl                                  1 calls
1>        0 ms  ComputeMIDLGeneratedCompileInputs          1 calls
1>        0 ms  MakeDirsForMidl                            1 calls
1>        0 ms  _Xsd                                       1 calls
1>        0 ms  CopyFileToFolders                          1 calls
1>        0 ms  CustomBuild                                1 calls
1>        0 ms  _BuildGenerateSourcesAction                1 calls
1>        0 ms  SelectCustomBuild                          1 calls
1>        0 ms  _SelectedFiles                             1 calls
1>        0 ms  PreBuildEvent                              1 calls
1>        0 ms  BeforeBuildGenerateSources                 1 calls
1>        0 ms  BuildGenerateSourcesTraverse               1 calls
1>        0 ms  InitializeBuildStatus                      1 calls
1>        0 ms  ResolveReferences                          1 calls
1>        0 ms  _Midl                                      1 calls
1>        0 ms  AfterBuildGenerateSources                  1 calls
1>        7 ms  ClCompile                                  1 calls
1>       16 ms  ComputeCustomBuildOutput                   1 calls
1>      132 ms  Link                                       1 calls
1>
1>Task Performance Summary:
1>        0 ms  Message                                    2 calls
1>        0 ms  SetEnv                                     8 calls
1>        0 ms  AssignProjectConfiguration                 1 calls
1>        0 ms  MSBuild                                    1 calls
1>        0 ms  MakeDir                                    7 calls
1>        0 ms  CheckVCToolsetVersion                      1 calls
1>        0 ms  ReadLinesFromFile                          1 calls
1>        0 ms  WriteLinesToFile                           1 calls
1>        0 ms  Touch                                      1 calls
1>        0 ms  GetOutOfDateItems                          3 calls
1>        0 ms  AssignTargetPath                           4 calls
1>        0 ms  AssignCulture                              1 calls
1>        7 ms  CL                                         1 calls
1>      132 ms  Link                                       1 calls
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

12
Hi,
I can't seem to open SFML/Graphics.HPP

I've followed the instructions on the tutorial link below but I keep getting the error.

Under C/C++->General->Additional Include Directories
C:\Users\user\Documents\Visual Studio 2019\SFML-2.5.1\include\SFML
This is where the Graphics.hpp file is.

Under C/C++->Preprocessor->Preprocessor Definitions
SFML_STATIC;

Under Linkers->Input
opengl32.lib;winmm.lib;gdi32.lib;sfml-graphics.lib;sfml-window.lib;sfml-system.lib;sfml-network.lib;sfml-audio.lib;

Could someone help me?

Thank you.

References
https://www.sfml-dev.org/tutorials/2.5/start-vc.php

Pages: [1]
anything