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.


Topics - roccio

Pages: [1]
1
General / Sfml on dynamic dll
« on: April 02, 2021, 08:21:44 am »
Hello, I have an sfml exe that should dynamically (using loadlibrary) load a dll that uses sfml too. In the dll there is a base class and are exposed two function to create and destroy an instance of that class. All works, but when I try to do something sfml related like loading textures, I get opengl context errors and nothing works. I linked both (exe and dll) with sfml in a static way.

Any help to get it working?

2
General / Multiple windows
« on: November 28, 2018, 09:17:24 am »
Hello,
I have a question regarding the correct way of using mnultiple windows with SFML (2.5.1).

Here is the general info:

- one window is the main program interface
- from this interface you can launch a thread that will open many other windows (al opened and managed in this new thread)

so the question are:

1) do I need to call setActive(true) for every window?
2) what happens if I set the vertical retrace to true? Every window will stop the code waiting the retrace?

thanks

3
Network / UDP multiple ports
« on: August 21, 2018, 10:58:20 am »
Hello, I would like to know if it is possible to have two udp sockets receiving on two different port at the same ipaddress.

Thanks

4
General / Possible memory leak
« on: October 12, 2017, 04:06:22 pm »
Hello, I was trying to play with many windows for my application, and I noticed one strange thing (I see it using default window manager).

When I create a new window the memory goes up.
When I delete the window the memory goes down, but just a little, so that if I continue to create windows the memory used will grow.
I noticed that this only happes if I use antialias in context settings, so maybe it's a driver issue.

Here is a little code to reproduce.

Code: [Select]
#include <SFML/Graphics.hpp>
#include <vector>

int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);

std::vector<sf::RenderWindow*> windows;

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::A)
{
sf::ContextSettings settings;
settings.antialiasingLevel = 8;

sf::RenderWindow* wnd = new sf::RenderWindow();
wnd->create({ 800, 800 }, "2", sf::Style::Default, settings);
windows.push_back(wnd);
}
if (event.key.code == sf::Keyboard::D)
{
for (auto wnd : windows)
wnd->close();
// delete wnd;

windows.clear();
}
}
}

window.clear();
window.draw(shape);
window.display();

for (auto wnd : windows)
{
wnd->clear();
wnd->display();
}
}

return 0;
}

5
Graphics / Triangle texture mapping
« on: January 05, 2017, 01:37:25 pm »
Hello, I need to map a triangle in a way that the texture "follow" the lines of the triangle.
Now if I use sfml mapping I get the first image (assuming the texture is made of vertical red lines); I would like to get something like the second.

Any advice?


6
Graphics / Dashed lines
« on: October 07, 2016, 03:14:10 pm »
Hello, I need to draw some dashed lines, what do you think is the best way?

7
General / need to load DDS image
« on: August 16, 2016, 02:57:29 pm »
Hello, I read that sfml does not support DDS texture loading, and that make sense to me, but I need to load a DXT1 compressed texture. Does anyone know how can I decompress the image and set the pixels for a sf::Texture?

8
Graphics / Question for best performance
« on: December 14, 2015, 09:33:45 am »
Hello, I have a big texture (up tp 4096 or 8192) that is the background of my game. I would like to know what is better to render, one big rect with the same size of the texture, or a rect large as the game window and scrolling the textureRect, or split it in several tiles everyone mapped with the corrects coordinates inside the big texture.

Thank you for your advise!

9
Feature requests / Multi monitor
« on: November 04, 2015, 02:17:50 pm »
Is the multi monitor support a feature planned for the next version?

10
Graphics / RGB texture
« on: November 04, 2015, 09:01:58 am »
Hello, I need to create (and update) a RGB texture, without alpha channel.
How can I do this?

Thank you

11
Graphics / Conversion from BGRA to RGBA
« on: November 03, 2015, 09:16:37 am »
Hello,
I have a byte array in BGRA format and I use it to update a sf::Texture. The problem is that sf::Texture only supports RGBA forrmat. Is there a fast solution for this conversion? Or (like I do now) I have to swap the bytes manually?

Thank you

12
Network / TCP send big buffer
« on: August 19, 2014, 03:58:11 pm »
Hello,
I have a server that must send an image (stored in memory as a unsigned char* ) to a client.
What is the best option?

Thanks

13
Window / Map View Zoom
« on: May 29, 2014, 05:09:37 pm »
Hello,
I would like to implement a zoom function like the one found in google maps (so that I zoom keeping the point where the mouse is as a "zoom focus") using a single big image as background and the as::view class.

Any help on how to implement such a feature?

thank you

14
Graphics / strange freeze
« on: March 05, 2014, 02:58:29 pm »
Hello, I have a strange problem with a simple test program. I try to display a number of rectangles, but I noticed that a number less than 279 works well, 279 or more freeze.

#include <SFML/Graphics.hpp>

void drawrect(int x, int y, int size, sf::RenderTarget& target)
{
    sf::RectangleShape rectangle;
    rectangle.setSize(sf::Vector2f(size, size));
    rectangle.setOutlineColor(sf::Color::White);
    rectangle.setOutlineThickness(1);
    rectangle.setFillColor(sf::Color(0,0,0,0));
    rectangle.setPosition(x, y);
    target.draw(rectangle);
}
int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "TEST");
    window.setMouseCursorVisible(true);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // draw
        window.clear();

        for (int i=0;i<279;i++)
            drawrect(i, i, 1, window);

        window.display();
    }

    return 0;
}

 

What's the problem here?

Thanks

Pages: [1]