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 - Midleiro F

Pages: [1]
1
General / Re: Unable to compile SFML 2.1 on Linux
« on: September 15, 2013, 09:32:36 pm »
Have you tried to compile SFML even though you haven't installed the library explicitly?
I had some issues in the past as well, when trying to install xrandr, but often it worked anyways since xrandr shipped with some utility package.

Yes, I have. Unfortunately CMake outputs the following error message:

Quote
CMake Error at src/SFML/Window/CMakeLists.txt:113 (message):
  Xrandr library not found


-- Configuring incomplete, errors occurred!

If it's of any help, my current distribution is Linux Mint 15 Olivia.

2
General / Re: Unable to compile SFML 2.1 on Linux
« on: September 15, 2013, 02:18:31 pm »
Thanks for the response!

I followed the exact same tutorial the first time around, and was able to install most of the packages you quoted. However, my problem with the xrandr library remains, as stated in the original post. Trying to install them via Package Manager also yielded no results, as it says the package is broken.

I have also tried
Quote
sudo apt-get install -f
and
Quote
sudo dpkg --configure -a
without results.

3
General / Unable to compile SFML 2.1 on Linux
« on: September 14, 2013, 05:02:46 pm »
Hi!

At first I tried, unsuccessfully, to use the prebuilt binary packages -- when trying to build a simple program, the compiler said I didn't have libglew1.5. I couldn't install it either, since apt-get says the package libglew1.5 doesn't exist, so I decided to build SFML anew with my own version of libglew.

Now I'm trying to build it from source; however, I'm having trouble meeting some dependencies, namely, libxrandr.

When I try
Quote
sudo apt-get install libxrandr2
, it says I already have it.

When I try
Quote
sudo apt-get install libxrandr-dev
, it says
Quote
The following packages have unmet dependencies:
 libxrandr-dev : Depends: x11proto-randr-dev (>= 1.4) but it is not installable
                 Depends: libxrender-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I was also unable to install x11proto-randr-dev and libxrender-dev.

Any suggestions?
Thanks!

4
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: December 23, 2012, 03:43:16 pm »
I really like the new callback system, I think you're in the right track, good luck!

5
General / Re: Easy way to create game levels?
« on: November 20, 2012, 09:18:18 pm »
I have been using Tiled (http://www.mapeditor.org/) for creating game levels. You load tilesets into the program and it associates each tile with the index that is the position of the tile sprite on the tileset. It's quite easy to create and to define custom properties for each tile. It outputs all the map properties to a xml file, which you can then read from your program.

6
General / Rendering large number of sprites with similar characteristics
« on: November 20, 2012, 01:18:13 am »
Say I have a very large number of game elements that share the same sprite properties (size, textureRect, linear transforms, etc), except that they differ only in texture in position.

I want to render all of them. So say I have a vector where all of them are stored, like
std::vector<sf::Sprite>;
. So I would just iterate throw this vector and call draw on all of them, like this.
for (int i = 0; i < sprites.size(); ++i)
        window.draw(sprites[i]);

Now, I've been thinking, what if I created only one static sprite instance, and stored only the position and the texture for each given game element? So, maybe I would have something like
std::vector<std::pair<sf::Vector2f, sf::Texture>> spriteInfos;
static sf::Sprite staticSprite;
. Then it would go like this:
for (int i = 0; i < spriteInfos.size(); ++i)
{
        staticSprite.setPosition(spriteInfos[i].first);
        staticSprite.setTexture(spriteInfos[i].second);
        window.draw(staticSprite);
}

It seems to me that the above method saves up a lot of memory from underlying properties inside each sprite that would have been duplicated on the first method, especially if I have a very large number of sprites active at the same time.


My question is, what do you make of this approach? Is it worth it, and if not, why, and do you think it may affect my performance?

Thanks!!

7
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: November 16, 2012, 10:51:32 am »
Nice! I believe this kind implementation would allow binding of lambdas as well.

8
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: October 27, 2012, 01:35:21 pm »
Well, say I have a function that I would like to be called every time a button is clicked. A function like
void MyCallbackFunc()
{  
    cout << "The button was clicked!";
}
, or any other appropriate reaction to the button click.

So I would call
button->addCallback(MyCallbackFunc, tgui::Button::Clicked)
, or something like that. I think that would make things very easy.

9
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: October 27, 2012, 12:29:27 pm »
Hello Texus,

I want to congratulate and also thank you for making this great GUI. I find it very simple and intuitive to use, just like SFML, which is just perfect. I'm looking forward to be using it in a game I'm making for a college project.

This is maybe an old topic, but I have a suggestion on the new callback system. It would be interesting to be able to connect a function to a certain event that is triggered on the widget. For instance:

editBox->addCallback( [&]() { cout << editBox->getText() }, tgui::EditBox::Focus | tgui::EditBox::Unfocus );


Keep up the good work!

10
General / Re: Beginner mistakes, help me please.
« on: July 08, 2012, 07:16:50 pm »
In sfml 2.0 the function names start with a lower case character. So it should be setOrigin(), loadFromFile(), etc...

11
Feature requests / Re: Few suggestions
« on: July 04, 2012, 07:29:05 am »
It would be nice to have implicit conversions from Vector2f to Vector2i and vice-versa too

12
Problem was solved.

The problem really was with gcc 4.7. I uninstalled it and installed 4.61 and everything worked like a charm!

Thank you so much!

13
Okay, yeah, I meant to write that I was linking dinamically, sorry.

I tried linking with the precompiled 2.0 version, both SJLJ and DW2(just in case) and neither worked, the problem was the same.

Could help me out? I'm trying to build it now with CMake, but it says I'm missling libgmp-10.dll. I already put my MinGW/bin directory in the path, and that dll IS in the .bin folder.
I'm getting the following errors:
Quote
CMake Error at cmake/Config.cmake:62 (message):
  Unsupported compiler
Call Stack (most recent call first):
  CMakeLists.txt:20 (include)

Also it shows something called CMAKE_CODEBLOCKS_EXECUTABLE with value CMAKE_CODEBLOCKS_EXECUTABLE-NOTFOUND.

Any thoughts?
Thanks!

14
I'm using the static version, I put
-lsfml-graphics
-lsfml-window
-lsfml-system
under linker options, defined SFML_DYNAMIC, placed the dll's in the exe folder and everything.

My mingw version is 4.70.

I tried to run the following program :
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}

It compiles fine. But when I try to run, I get a segmentation fault upon the declaration(calling of the constructor, actually) of  sf::Clock Clock.

Am I missing something?
Thanks!

Pages: [1]
anything