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

Pages: [1]
1
Feature requests / Re: Add Keyboard/Mouse connection detection
« on: January 23, 2017, 02:09:21 pm »
Effectively it looks like on Windows a touch move will generate a mouse move too, but you can distinguish this mouse move from others mouse move: see https://msdn.microsoft.com/en-us/library/dd693088(v=VS.85).aspx

I don't know if mario's pull request manage it, but since it's tagged for the next release, it certainly should be implemented.

2
Feature requests / Re: Add Keyboard/Mouse connection detection
« on: December 12, 2016, 01:48:33 pm »
For your first use case, I believe you should wait for sf::Event::TouchEvent to be implemented on PC. This way you could differentiate between a mousemove and a touchmove. If you can't wait, there is a pull request, you just need to apply it and build SFML yourself.

3
Feature requests / Re: File drop
« on: October 12, 2015, 05:05:54 pm »
I beg to differ !

- Has to be implemented
- Has to be maintained
True for any other feature

Quote
- Moves away from the library being about mostly about game development
While true for the library usage, the purpose is not limited to game development and I personally have three SFML projects unrelated to games.


Quote
- Introduces a feature that only works on certain platforms (doesn't work on mobile)
Not unheard of, since touch support is currently only available on mobile.

I would love to see drag and drop implemented because it is a common interaction in Windows, Linux and Mac, and certainly even more OS.
But I agree that it's a complex feature and few users will ever need it.

4
General / Re: SFML 2.3 and GTK
« on: June 10, 2015, 11:50:55 am »
A simple project using SFML 2.3 is working correctly.

Since I am mixing GTK and SFML to handle events with GTK, SFML events seems to not work anymore.
But other RenderWindow methods work fine: setting framerate limit, size and position.
Other SFML features (not window only) work fine too: time, mouse state...

The only big issue seems to be displaying the window content inside a gtk widget.

Also I've tried this code with SFML 2.2 and it works too, if it can help narrowing the problem.

5
General / SFML 2.3 and GTK
« on: June 09, 2015, 03:08:01 pm »
Hello,

I'm trying to upgrade from SFML 2.1 to SFML 2.3, and I encouter some problems doing so.

I'm mixing GTK and SFML because I want to get touch events from GTK, and SFML does not provide touches yet.

My code was working fine with my previous SFML version, but updating it to 2.3 made my window displaying only white on a computer (not even my window.clear color), or displaying the background at start time on another computer.

It could be related to :
       
renderWindow.create(GDK_WINDOW_XID(gtk_widget_get_window(area)));
since it is where SFML and gtk are linked. But I don't really know what could be the problem since it build correctly.

So I've made a little project using the less code possible to show the behavior:
#include <SFML/Graphics/RenderWindow.hpp>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>

gboolean onDraw(GtkWidget *widget, GdkEvent *event, gpointer user);

class LinuxWindow
{
public:
    void create( sf::Vector2f size )
    {
        // Create the main window with a drawing area
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        area = gtk_drawing_area_new();
        gtk_container_add(GTK_CONTAINER(window), area);

        // Enable events for the drawing area
        GdkEventMask mask;
        mask = GDK_ALL_EVENTS_MASK;
        gtk_widget_add_events(area,mask);

        //Request a starting size(Otherwise you have no size, ie 0)
        gtk_widget_set_size_request(area, size.x, size.y);

        //Make the window real(usually delayed to show_all, but we need it sooner)
        gtk_widget_realize(area);

        //It is double buffered in itself, does not need gtk's help
        gtk_widget_set_double_buffered(area, false);

        // Create the SFML RenderWindow, using the native window handler
        renderWindow.create(GDK_WINDOW_XID(gtk_widget_get_window(area)));
        renderWindow.setVerticalSyncEnabled(true);

        // Connect signal
        g_signal_connect(area, "draw", G_CALLBACK(onDraw), NULL);
        g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

        gtk_widget_show_all(window);
    }

    sf::RenderWindow renderWindow;

private:
    GtkWidget* window;
    GtkWidget *area;
};

LinuxWindow linuxWindow;

//Gtk Render callback method
 gboolean onDraw(GtkWidget *widget, GdkEvent *event, gpointer user)
{
    linuxWindow.renderWindow.clear( sf::Color(157,210,237,255) );
    linuxWindow.renderWindow.display();
    gtk_widget_queue_draw(widget);
    return true;
}

int main(int argc, char** argv)
{
    gtk_init(&argc, &argv);
    linuxWindow.create(sf::Vector2f(800, 600));
    gtk_main();

    return 0;
}

This code works fine with SFML 2.1 but not with SFML 2.3.

Has anybody any idea/suggestion ?

6
Graphics / Re: Issue using RenderTextures on full-screen window
« on: October 06, 2014, 05:35:04 pm »
It really looks like my behavior, but I've tried the code they posted and it does not flicker on my computer.

7
Graphics / Issue using RenderTextures on full-screen window
« on: October 06, 2014, 05:21:35 pm »
Hello,

I've currently a big and strange issue related to render textures and full-screen windows.

It's a really strange behavior : the render texture first "clear" or "draw" will cause the screen to blink for about 1s (the entire monitor, and even other monitors if using multiple monitors).
But only if the sfml window is full-screen and at topmost position.

Here is the minimal code where I was able to reproduce the problem:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window", sf::Style::Fullscreen);
        sf::RenderTexture text;
        text.create(100,100);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

                if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
                {
                        text.clear(); // First call will cause the screen to blink
                }

        window.clear(sf::Color::White);
                window.display();
    }

    return 0;
}

When using render texture profusely it's a really big issue.

Somehow, I cant reproduce this behavior on every computers. In our offices, 3 out of 5 Windows computers are affected, but none with linux. It looks like a driver issue but I use the last AMD driver. I would love to know if it's a known issue and if there is a fix.

I tried some things and it appears that when the window is no longer foreground (if another window is above it), the monitor is no longer blinking.

Thanks !

8
Feature requests / Re: Overload of * operator for Vector2<T>
« on: September 01, 2014, 06:25:30 pm »
Ok, generally speaking I thought dot and cross product were used with functions, not operator overloads for this exact reason.

This has been discussed many times, by the way; please use the search function.

The only discussion I found about it was your own post about overloading "<" operator. Which was indeed not meaningful enough, and I thought otherwise for the * operator. Sorry if I did not found other topics about it and thanks for your answer.

edit: misspelling

9
Feature requests / Overload of * operator for Vector2<T>
« on: September 01, 2014, 06:01:39 pm »
It's a really little feature but it could be nice to have a new multiply overload for Vector2 class.
Currently you can multiply a Vector2<T> only with a T, but not with another Vector2<T>.
Thus creating relatively verbose code like this:

sf::View view;
view.setSize(scale.x * size.x, scale.y * size.y);

when this could be enough, without losing any readability:
view.setSize(scale*size);

I don't see why it has not be done since it already exists for + and - operators.

10
SFML projects / Re: d3d (Deferred 3D) - A 3D Engine Using SFML
« on: July 25, 2014, 02:57:47 pm »
That looks gorgeous. I would love to try it for a little project, but your wiki seems to be empty and I don't see examples, and I'm afraid to know too little about OpenGL to try it alone.
Maybe could you add examples from your screenshots ? They looks really nice and I would definitely love to alter them. Adding documentation in your wiki should help too.

11
Feature requests / Re: Touch Events Interface Request
« on: May 14, 2014, 02:26:14 pm »
It may be out of scope for SFML but what about TUIO support (an open framework for multitouch applications)?

I know it's not OS based and requires a thread  to manage touches (client/server based framework), but it is used by many multitouch screens/hardware and it may be cool to abstract each well-known touches system into a single interface.

Pages: [1]
anything