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

Pages: 1 [2] 3 4 ... 83
16
SFML projects / Re: SFBL (SFML Box2D Light)
« on: January 23, 2015, 11:21:13 pm »
The zlib/png license that SFML uses (full text here: https://github.com/SFML/SFML/blob/master/license.txt) is my personal favorite. It's super-short, non-lawyers can read it, and it basically just says "don't lie about who wrote this software", which should not be a problem for anybody.

Though I've always been tempted to try the WTFPL...

17
Graphics / Re: tile glich.
« on: January 22, 2015, 08:22:15 am »
I'm pretty sure there are containers out there that aren't limited to one chunk though, I haven't personally tried one however.

If it helps, I'm pretty sure std::deque is normally implemented "with multiple chunks".

18
General / Re: Question about event
« on: January 22, 2015, 12:19:29 am »
The answer depends on the timing properties of the physical input devices and the operating system that's generate events, but Jesper's basically right.

I'm fairly sure it's at least theoretically possible to type or click faster than your mouse or keyboard will notice, even if no normal person would ever do that by accident.  You can certainly do it faster than your operating system can respond if your computer is running particularly slowly, but then you've got other problems.

I did find this chart of mouse response times which should give you an idea how quick you'd have to be to actually cause "missed" click events:


tl;dr if Superman can click multiple times within ~50 milliseconds, and not destroy his mouse in the process, yes a click event might get missed.

19
Network / Re: sf::Packet Data Extraction
« on: January 20, 2015, 02:15:06 am »
You should post a minimal and complete code example so we can pin down exactly what the problem is.

Solely based on what you posted, my blind guess would be that you're sending your map data without any size parameter, and trying to compensate for this on the receiver with a heuristic (aka, a hack) that isn't accurate enough.  If so, the solution is to send a size parameter.

20
Network / Re: sf::Packet Data Extraction
« on: January 20, 2015, 01:57:51 am »
It should "just work" either way.  These are standard C++ operators implemented in the standard way, so they behave the same as iostreams.

Is there some specific reason you're asking this question instead of simply writing that code?

21
General / Re: Compilation failures on Linux.
« on: January 19, 2015, 12:45:52 am »
The only other solution I know of is strategically #undef'ing all the macros that X11 is using to break SFML.

22
General / Re: The Beginning of an MMO
« on: January 18, 2015, 11:26:32 am »
That's the sort of problem where we'll have to see a complete and minimal code example in order to figure out what's wrong.

23
General / Re: The Beginning of an MMO
« on: January 18, 2015, 02:33:19 am »
The general problem you're referring to is called "serialization".  It's not specific to SFML, and in most cases there's no right or wrong answer and you can simply do whatever you want provided you understand what types of data can and cannot be serialized directly.  I would simply google that term for a while and read what comes up until you're comfortable with the idea.

sf::Packet doesn't impose any particular restrictions, however it doesn't directly support any containers or variable-sized types, so if you have any of those you'll have to choose a serialization format for them.  For example, you can insert the size of the container and then the elements.

24
General / Re: unique_ptr help
« on: January 18, 2015, 02:28:19 am »
SFML, that book, and pretty much every other C++ library assumes that you are proficient in the C++ language already.  It sounds like you're having trouble simply because you aren't proficient yet.

I would read a book about C++ itself first before diving into a library written in that language.

Also, if you had simply googled the error message, you would get many helpful answers like this one: https://stackoverflow.com/questions/18078153/error-unique-ptr-is-not-a-member-of-std

25
You could have very easily googled that error message.  Here's one good answer: https://stackoverflow.com/questions/5844584/error-function-is-inaccessible

tl;dr you forgot to write "public" when specifying the base class.


In all seriousness, if you're still getting stuck then you need to go read a C++ book or tutorial about how class inheritance and polymorphism works.  Everything in this thread so far is need-to-know material for working with C++.

26
DotNet / Re: Dispose() and memory management
« on: January 17, 2015, 07:53:40 pm »
This question is not SFML-specific, so it's probably better asked elsewhere.

For example, this SO Q&A appears to answer your question: https://stackoverflow.com/questions/4267729/what-happens-if-i-dont-call-dispose-on-the-pen-object

27
The concrete, derived types do have to implement draw().  The abstract base class does not.  See http://ideone.com/ewU9qP for an example.

An abstract base class inheriting from other abstract base classes won't change this in any way.

28
It's hard to tell exactly which questions are or aren't being asked at this point, but whatever's left seems to be about basic C++ polymorphism works.

Quote
The question I have now is what does the class MyDrawableTransformable need to look like?

As with any other container of polymorphic objects, the container should be of base class pointers, and the base class should (in most cases) be an abstract class containing only pure virtual methods that define the interface you need when dealing with unknown derived types.  Presumably, the interface you want for MyDrawableTransformable is a combination of the sf::Drawable and sf::Transformable interfaces, so MyDrawableTransformable could simply be a class that inherits from those two and has nothing in it.

29
General / Re: The Beginning of an MMO
« on: January 17, 2015, 11:10:06 am »
The standard packet tutorial should be more than enough: http://www.sfml-dev.org/tutorials/2.2/network-packet.php

30
System / Re: Time and clock
« on: January 16, 2015, 11:08:42 pm »
The error tells you exactly what's wrong: You used the -> operator on "shot", which is not a pointer.  Also, in that code "clock" is a pointer so you should be using -> on that, but you aren't.

This is considered very basic C++, and is not unique to SFML in any way, so you may want to spend more time learning the C++ language before trying to use a library written in that language.  I'd suggest reading a good C++ book.

Pages: 1 [2] 3 4 ... 83