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

Pages: [1] 2 3
1
General discussions / Re: Anyone targeting 32-bit platforms?
« on: December 24, 2021, 03:36:57 pm »
My case is not statistically significant at all, but still I'm using SFML with TGUI for my own applications and sometimes on freelance. And after the third complaint that application doesn't work my default choice is Win32 for all applications. To be clear - those complaints weren't SFML-related. 
But I'm not active user of SFML and can live even without x32 out-of-the-box support.

To be honest I not understand how architecture could be related to C++ standard? Architecture about users and standard is about developers.

2
General / Re: Reason: Unable to open file
« on: July 04, 2021, 08:46:38 am »
Can you check does example shader work for you?

3
System / Re: sf::Thread error
« on: May 24, 2021, 11:08:36 pm »
Just read the documentation - Threads
In your case:
sf::Thread t(std::bind(&foo, "str", "lol"));

4
Network / Re: My Issue with TcpListener listen() method
« on: March 27, 2021, 09:23:18 am »
I think the reason in Zero initialization. Here is blog post with more human explanation - Initialization in C++ is bonkers.

5
General / Re: Loading texture into class
« on: March 09, 2021, 08:59:08 pm »
I think that's exactly the problem. Your project file contains this:

    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>C:\SFML-2.5.1\include</AdditionalIncludeDirectories>
      <LanguageStandard>stdcpp17</LanguageStandard>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <AdditionalLibraryDirectories>C:\SFML-2.5.1\lib</AdditionalLibraryDirectories>
      <AdditionalDependencies>opengl32.lib;sfml-system.lib;sfml-window.lib;sfml-graphics.lib;sfml-main.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
 

For DEBUG it should have -d in the end (from the documentation):

Quote
Here are the dependencies of each module, append the -d as described above if you want to link the SFML debug libraries:
...
 link your project to the sfml-main module ("sfml-main-d.lib" in Debug, "sfml-main.lib" in Release),

6
General / Re: Loading texture into class
« on: March 08, 2021, 10:27:14 pm »
Could you provide single-file example to reproduce the behaviour or attach your project file?

7
Graphics / Re: draw text on click
« on: March 04, 2021, 03:09:31 pm »
Your mistake is incorrect usage of pointers, I fixed it and provide code. Also you can load font only once and reuse it whenever you want.

8
Graphics / Re: draw text on click
« on: March 03, 2021, 11:01:52 pm »
Why use pointers at all?

#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
int main()
{
    // create the window
    sf::RenderWindow window(sf::VideoMode(720, 720), "My window", sf::Style::Titlebar | sf::Style::Close);
    window.setFramerateLimit(50);
    sf::Font font;
    font.loadFromFile("font/arial.ttf");
    std::vector<sf::Text> shapes;
    // run the program as long as the window is open
    while (window.isOpen()) {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event)) {

            if (event.type == sf::Event::MouseButtonReleased &&
                event.mouseButton.button == sf::Mouse::Left) {

                sf::Text shape("X", font);
                shape.setString("X");
                shape.setCharacterSize(30);
                shape.setPosition(event.mouseButton.x, event.mouseButton.y);
                shape.setColor(sf::Color::Green);
                shapes.push_back(shape);
            }

            // Clear screen
            window.clear();
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }
        // clear the window with black color
        window.clear(sf::Color::Black);

        // draw everything here...
        // window.draw(...);
        for (auto it = shapes.begin(); it != shapes.end(); it++)
        {
            window.draw(*it);
        }
        // end the current frame
        window.display();
    }
}

9
General / Re: Access violation error? (sfml-window-d-2.dll)
« on: February 17, 2021, 11:34:59 am »
Hello == is comparison not assign. Change
this->window == new sf::RenderWindow(this->videoMode, "Game 1", sf::Style::Titlebar | sf::Style::Close);
to
this->window = new sf::RenderWindow(this->videoMode, "Game 1", sf::Style::Titlebar | sf::Style::Close);

10
Window / Re: mouse position relative to window
« on: February 13, 2021, 03:15:53 pm »
Code works for me(Windows), I think it's bug so should be reported - https://github.com/SFML/SFML/issues

11
Window / Re: mouse position relative to window
« on: February 07, 2021, 06:16:54 pm »
Could you provide minimal but full code for reproducing the behaviour?

12
I believe that the reason that each event has only it's own parameters and don't store any other information. So instead checking value of the event, check state that stored in your map(if there isn't any - add it).

13
General / Re: Visual Studio 2019 16.8.3
« on: January 06, 2021, 12:12:04 am »
Why you even need this file? What instruction do you followed? This one - https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php or other?

14
Network / Re: TCP Socket won't block. Am I missing something
« on: January 04, 2021, 11:09:24 pm »
All sockets are blocking by default...can you provide minimal example for reproducing the behaviour?

15
General / Re: Visual Studio 2019 16.8.3
« on: January 04, 2021, 11:01:10 pm »
Build SFML from source is really easy so do it without doubt. If you will have any question about that - just ask.

Pages: [1] 2 3