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

Pages: [1] 2 3
1
Feature requests / FindSFML.cmake use HINTS instead of/additional to PATHS
« on: November 22, 2015, 11:21:58 pm »
The current implementation of FindSFML.cmake is using the cmake command find_path together with the PATHS argument.
My Request is to use HITNS additional to PATHS

Story:
I am using sfml for two projects. one is using sfml version 2.1 from the ubuntu packages. I want to keep working with this version (in order not to force the whole team to install sfml manually)
For another project I started using sfgui, which has sfml 2.3 as prerequirement.

So I downloaded the compiled version of SFML. (I am using the precompiled version, as I am planning to also work on a computer on my university, where I don't have root privileges, so I don't want to need to install the dev versions of all dependencies)

Problem:
The current FindSFML.cmake script finds always the sfml version installed with the ubuntu packages, although I am using SFML_ROOT to override the path.

The Problem is, that the PATHS attribute will cause cmake to look first at the default locations (I think it is CMAKE_MODULE_PATH, but I am not 100% sure), bevore checking the paths of the PATHS attribute. I've modified the FindSFML.cmake script to use HINTS, they are checked before the CMAKE_MODULE PATH. SO instead of

# define the list of search paths for headers and libraries
set(FIND_SFML_PATHS
    ${SFML_ROOT}
    $ENV{SFML_ROOT}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt)

# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
          PATH_SUFFIXES include
          PATHS ${FIND_SFML_PATHS})

I have now

# define the list of search paths for headers and libraries
set(FIND_SFML_PATHS
    ${SFML_ROOT}
    $ENV{SFML_ROOT}
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt)

 #################### ADDED
set(FIND_SFML_HINTS
    ${SFML_ROOT}
    $ENV{SFML_ROOT}
  )

# find the SFML include directory
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
          PATH_SUFFIXES include
          HINTS ${FIND_SFML_HINTS} ################### ADDED
          PATHS ${FIND_SFML_PATHS})

What now?
This fix is working perfectly for me, so I wanted to share it with you :)
I you thik that's usefull, use it as you whish

2
Feature requests / Re: Mouse capture/grab
« on: June 04, 2013, 06:51:25 pm »
A small update:

MarioLiebisch has created a pull request and has implemented the cursor capturing for Windwos and X11.

However, Mac Support still has to be implemented.

3
General discussions / Re: Clean C++ Design
« on: May 23, 2013, 10:22:20 pm »
Nice! Thank You!! :)

4
General discussions / Clean C++ Design
« on: May 23, 2013, 09:54:41 pm »
Hey!

I am overwhelmed by the design of SFML. I like how intuitive it is to use. I wish which there were more Libraries with such a clean design.

I am programming C++ since about 10 Years. Most of the time I was hacking, until I got my hands on the book Clean Code by Robert C. Martin. Since then I am trying to improve the quality of my own code.

The Next book I am planning to read is the book "Modern C++ Design" written by Andrei Alexandrescu.

@Laurent & other Clean Coder: Do you know further Resources (books, websites) which might be useful to improve ones C++ Software Design

5
Feature requests / Re: Mouse capture/grab
« on: May 21, 2013, 09:14:48 pm »
If it's in the task tracker, then don't worry it will be implemented one day. If it's not, then feel free to add a task containing all the important points that were discussed here.

I couldn't find a ticket for mouse capturing/grabbing, so I created one: https://github.com/SFML/SFML/issues/394

Edit: I also created a second ticket for the raw mouse movement: https://github.com/SFML/SFML/issues/395

Edit 2: Closed issue #395 because it was a duplicate to https://github.com/SFML/SFML/issues/304

6
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: November 04, 2012, 12:07:59 pm »
We could create a fork, implement it by ourselves (1 persen per system) and create a pull request

7
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 14, 2012, 08:58:24 pm »
can sf::sleep be used in multiple threads?

8
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 14, 2012, 06:09:47 pm »
Relative mouse positions are already possible with SFML... (sf::Mouse)
I have only browsed over this thread very fast. I think you've written that low fps (that's why I said slow machines) and window mode can cause the window to loose focus.

Correct me if I am wrong, but I also think to have read, that you've written that a solution for this would be using a seperate thread to get the mouse delta using sf::Mouse

So yes it is possible to implement relative mouse movement using sfml only. But it seems to require some extra amount of work (most implementation would make some mistake when using multiple threads) implemented multiple times for different projects.
So writing library or writing a tutorial could be useful.

This thread is a feature request about doing exactly this in sfml. As a feature itself it would be clearly useful. So it's imho a design question whether to add this to sfml.

9
Feature requests / Re: Relative Mouse Movement (Mouse Capture)
« on: October 14, 2012, 03:59:33 pm »
I think it's also important to discuss, whether this feature fits to SFML's design.

If not, I would suggest to create a wiki-page-tutorial howto implement relative mouse movement working on slow machines.

10
Graphics / Re: Crash when using RenderTexture
« on: September 18, 2012, 08:25:00 pm »
Actually I've searched.
But not good enough (note by Captain Obvious  ;) )

Thx for posting the links.

11
Graphics / Crash when using RenderTexture
« on: September 18, 2012, 07:48:10 pm »
I could only reproduce it on my Linux Mint 13 64bit Laptop with onboard Intel graphic (Mobile Intel GM45 Express Chipset).

It's working without problems on my PC with NVidia Graphic-Card (also Linux Mint 13 64bit)

Here's the minimal Code to reproduce:

#include <SFML/Graphics.hpp>
 #include <SFML/OpenGL.hpp>
 
 int main()
 {
     // Create the main window
     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
     sf::RenderWindow* RENDER_WINDOW = &window;
 
 
     // Start the game loop
     while (window.isOpen())
     {
         // Process events
         sf::Event event;
         while (window.pollEvent(event))
         {
             // Close window : exit
             if (event.type == sf::Event::Closed)
                 window.close();
                 
             if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Space)
             {            
              sf::RenderTexture render_texture;

              render_texture.create(800, 600);
              render_texture.setActive(true);

              render_texture.pushGLStates();
              render_texture.resetGLStates();
              glClearColor(0.f, 0.f, 0.f, 0.f);
              glClearDepth(1.f);

              glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

              render_texture.popGLStates();

              RENDER_WINDOW->setActive(true);
             }
         }
 
         // Clear screen
         window.clear();
 
         // Update the window
         window.display();
     }
 
     return EXIT_SUCCESS;
 }

Edit: it crashes when executing the  RENDER_WINDOW->setActive(true); line.

13
Window / Re: Bug: no way to poll Alt+F4 event using sf::Style::None
« on: August 21, 2012, 03:43:45 pm »
Wow Xlib is uglier and it's documentation harder to find than I expected. (Actually I couldn't find any X11 Documentation regarding MOTIF_WM_HINTS)

The only working thing I could figure out is to get Alt+F4 beeing triggered a Close event. I couldn't find a way to get an Alt+F4 keyevent triggered in window mode.

My workaround was to use
            if (style & Style::Close)
            {
                hints.Decorations |= 0;
                hints.Functions   |= MWM_FUNC_CLOSE;
            }
            if (style==0)
            {
                hints.Decorations |= 0;
                hints.Functions   |= MWM_FUNC_CLOSE;
            }
 
instead of
            if (style & Style::Close)
            {
                hints.Decorations |= 0;
                hints.Functions   |= MWM_FUNC_CLOSE;
            }
 
Which is far to hacky for a pull request.

Sorry that I couldn't contribute more  :(
greetings, Robert

14
Window / Bug: no way to poll Alt+F4 event using sf::Style::None
« on: August 20, 2012, 11:18:55 pm »
Hi,

Alt+F4 behaves different, depending on the window-style:
  • sf::Style::Default You get a Close Event. fine.
  • sf::Style::Fullscreen You get a KeyPressed event. fine.
  • sf::Style::None You get neither a Close, nor a KeyPressed Event.

Tested using SFML 2.0 fetched and built today.

If you agree that's a bug, I can create a pull-request if you want

greetings, Robert

Edit: I am using LinuxMint 13 x64

15
SFML wiki / Re: Gtkmm-Widget
« on: August 08, 2012, 07:21:56 pm »
Ok, I just added the Wiki Page:
https://github.com/SFML/SFML/wiki/Sourcegtksfmlwidget

I am a little confused, it shows "Sourcegtksfmlwidget" as Title although I have used "# SFMLWidget" as first line.

It's the first time for me that I "created" a public Wiki-Page. As my english isn't the best, I would feel more comfortable if some of you guys could take a look at this page.

Also I tested the code only on Linux.

Ah yes, and I should check whether this code is also working with gtkmm 3.0 -- I'll be back^^

Pages: [1] 2 3
anything