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

Pages: 1 ... 32 33 [34]
496
General discussions / Re: How much memory take a simple sfml app
« on: February 01, 2014, 02:39:36 am »
Yeah, especially with the average computer having 4GB of RAM nowadays, 25 MB is fine.
25 / (4 * 1024) = ~0.6% of total RAM. :P

497
Graphics / Re: Built a button, have a question
« on: January 31, 2014, 05:47:26 am »
Short answer: yes!

Long answer: If you inherit from sf::Drawable, you are able to implement:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const

Which would then let you do:
someSFMLWindow.draw(GButtonObject);
 

For an example, here is my code for a button:
class Button : public Widget
{
    // stuff
    private:
        sf::Text text;
        sf::Sprite sprite;
        virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
        {
                    target.draw(sprite, states);
                    target.draw(text, states);
            }
}
 
(my Widget class inherits from sf::Drawable)

Just realized, as you already inherit from sf::RectangleShape, you may not have to explicitly inherit from sf::Drawable yourself.

Read more here.

498
SFML projects / Re: Thor 2.0
« on: January 31, 2014, 05:40:43 am »
I'm not sure what exactly Nexus is referring to concerning prefixes, but, my guess would be that you should look into using namespaces rather than using a prefix, which, is what they're meant to be used for after all.  ;)

For example:
std::bind(&shk::E::InputManager::onTextEntered, this, _1)

That's why SFML uses the 'sf' namespace, to separate framework code from user code (and potentially other engine code), which is what you want to accomplish.

What if someone else made a library for something and prefixed all of their functions with an 'S' as well? You'd have a clash, which never turns out good for the compiler. As namespaces have longer names, the chances of clashing turns out much less.

499
Feature requests / Re: sfml for ps4
« on: January 24, 2014, 08:04:09 pm »
Yep, reading below the "Get Started" button gives you this link "For companies located outside of the Americas".

500
General discussions / Re: Does Code::Blocks have support for C++11?
« on: January 22, 2014, 12:53:27 pm »
In my opinion, if you're using a compiler that is meant to be general use, and it is not standards compliant, you shouldn't be using it. Compiler's that are meant for something quite specific are the exception.

And, as nice as it'd be if gnu tools were everywhere, they aren't. :P

501
General discussions / Re: Does Code::Blocks have support for C++11?
« on: January 22, 2014, 09:58:58 am »
If you're going to be using gnu tools (MinGW, or on linux), then you want to use -std=gnu++11 instead.
-std=c++11 is intermittent at best, and -std=c++0x is technically deprecated.
Some (but not all) of the gnu extensions are not standards compliant, and therefore not as portable, so keep that in mind of whether you want to use that flag or not.
Also, the gnu extensions that do not violate the standard are available with -std=c++11.

What do you mean by "-std=c++11 is intermittent at best"? I have not heard that before.
GCC has support for all but Minimal garbage collection support.

502
General / Re: 'x' does not have a class type
« on: January 18, 2014, 04:01:56 am »
Ah, thanks.  I should have caught that.

I wish GCC's error message where a bit more readable.  I shouldn't have to learn another, non-programming language just to understand GCC's messages.
You could try using clang. It is known to have much more informative errors than MSVC/GCC. Though it doesn't optimize as well (at least older versions used to, it may have changed). I've known several people to use clang when developing, and then switching to gcc when wanting to release.

503
General / Re: Good SFML Tutorial?
« on: January 17, 2014, 01:32:04 am »
http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition.aspx

This one isn't bad at all. It does use 1.6 though, so you'll have to modify its code yourself for use with 2.1, which is a good thing, it'll force you to get to know 2.x better. It also goes through building as Release and distributing.

504
Graphics / Re: Error load Image
« on: January 15, 2014, 06:48:27 am »
Given this line:
assert(m == false);
Your program will fail at runtime if the texture was loaded correctly (That's what you're telling the program to do with the above line).

Also, "#include <assert.h>"is the C way. For C++, you would do: "#include <cassert>".

That is, if you want to do it in C++.  :)

505
General / Re: Segmentation Fault - SFML2
« on: January 15, 2014, 01:00:34 am »
After doing some more digging around, it turns out it is a Kernel/X issue.

So far seems to be fixed after having upgraded to Kernel 3.12.7 and X.org 1.15.0.

506
General / Re: Segmentation Fault - SFML2
« on: January 13, 2014, 12:22:39 pm »
I hate to necro this thread again, but I'm running into the same error (without a segfault).

Checking my /var/log/Xorg.0.log file, this shows up every crash, and is right after X start up stuff, and before X closes (because of the crash):
"WaitForSomething(): select: Invalid argument"

Googling "WaitForSomething()" comes up with people reporting the same error, for different reasons though. Though I did learn that it's a function used in X.

I've gotten the same error multiple times, though the application usually runs for a variable amount of time before X crashes.

Got the same crash when running this: http://www.ludumdare.com/compo/ludum-dare-28/?action=preview&uid=24781

SFML version: 2.1.0.4a300547f3-1 (appears to be the latest github commit)

System:
Arch Linux
Kernel: 3.12.6-1-ck x86_64
Window Manager: Openbox
X.org X Server: 1.14.5
Mesa Drivers: 10.0.2-1

Pages: 1 ... 32 33 [34]
anything