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

Pages: 1 ... 5 6 [7] 8 9
91
General discussions / Re: SFML 2.2 tagged in repository
« on: December 11, 2014, 11:51:25 am »
Great News! Looking forward to use it.
Keep up the works guys!

92
General / Re: Problems to use the lib with QtCreator on Ubuntu
« on: November 20, 2014, 10:03:26 am »
Ok, if you install SFML via apt it gets installed to /usr/lib /usr/bin /usr/include etc.
From your project file I can see you add some path from your home-directory to the additional include paths.
Are the *.so files from SFML located there?

Otherwise search for the lib files, they are called lib-sfml-system-d.so and so on.
When you found this path add it to your project settings.
Do not forget to also add the include files from SMFL to your project settings.

In Code::Blocks everything works out of the box when installing SFML via apt or building it manually.
Maybe consult help in the QtCreator forum for specific help on how to add libs to project settings.

93
General / Re: Problems to use the lib with QtCreator on Ubuntu
« on: November 18, 2014, 03:23:20 pm »
Which version of Ubuntu do you use? Hopefully 14.04, as older versions had only SFML 1.6 in the official repos, since 14.04 Update 1, SFML 2.1 is in the repos.

When installing SFML via apt-get, it gets installed to /usr/, so normally you do not need to specify an additional include path for compiler and linker, as the gcc toolchain automatically searches in /usr/

What do you mean by installing it "manually"?
The normal manual installation method of SFML is by cloning from GitHub, and then building it yourself. This way it gets installed to /usr/local/, where the gcc toolchain also searches per default on Ubuntu 14.04.

I recommend you build it yourself from GitHub, cause the 2.1 version contains some linux specific bugs, which are ironed out in the git commits.

You can find a guide to this here

94
General discussions / Re: Debian/Ubuntu packages for SFML
« on: November 17, 2014, 09:01:34 pm »
I posted an update to my previous article about setting up SFML on Ubuntu in my blog. I used the latest build from GitHub to also test for the release of 2.2. Check it out, every suggestion is welcome.

95
General discussions / Re: We're close!
« on: November 15, 2014, 11:44:05 pm »
I just compiled and installed all four configurations (Debug+Shared, Release+Shared, Debug+Static, Release+Static) on a fresh Ubuntu 14.04 without any issues. Three of my projects build and run fine, no errors so far.

Good work, and thanks in advance for the VS2013 binaries  ;)

96
General discussions / Re: We're close!
« on: November 14, 2014, 03:27:35 pm »
I just re-installed my Linux dev machine yesterday evening, and wanted to continue setting it up over the weekend and update my Linux SFML Tutorial. I will incorporate the new version from Github into the whole process and let you know if anything goes wrong.

Is it also possible that you make pre-build packages for Visual Studio 2013 this time? ;)

97
SFML wiki / Re: Settings parser
« on: November 14, 2014, 11:31:51 am »
Because one would need less code to actually parse the line and store the key/value-pairs, like Nexus posted. But this comes with the limitation that you can actually not do any error or syntax checking in the text file, that's the reason why I use std::getline() and then a parse-function with 40 LOCs:

(click to show/hide)

This way it is still a simple parse-function (which could be expanded upon) but with a robust use.

@Foaly: You could make your code more readable and less typing-error prone if you would use auto, e.g.
auto it = m_data.find(key);
instead of
std::map<std::string, std::string>::const_iterator it = m_data.find(key);

These dumb iterator-types are actually one of the best reasons why auto even exists. ;)

98
SFML wiki / Re: Building SFML from source on Ubuntu 14.x
« on: November 13, 2014, 04:47:33 pm »
I did the same thing half a year ago, but with the 2.1 Release, not the master from GitHub. I think my tutorial could be updated to use git for master builds too ;)

99
General discussions / Re: CLion - A new IDE from JetBrains
« on: September 10, 2014, 10:31:19 am »
The fact alone that it's based on Java drops my interest significantly.

That was my first thought too. But some of the features on the list got my attention. They want to create a cross platform IDE with two of the best tools behind the scenes (gcc and cmake) with a very promising text editor capability.
The only reason I stick to VS2013 is it's very good source code editor, although lacking refactoring tools.
If CLion can beat the source code editor of VS2013 (which I think they will) I am more than willing to change my standard working IDE.

100
SFML wiki / Re: Settings parser
« on: August 28, 2014, 09:45:39 am »
Yeah, I know libconfig, already worked with it, it is indeed very good and just does the job.
I wrote my own 'very simple' parser just for the sake of simplicity, and for use it in my future projects because only thing I need is a simple key=value parser. If one day I need something elaborate like the compound config settings libconfig is able handling of, I will choose libconfig for sure ;)

Just wanted to share with the SFML-Comm because it shared so much with me.  ;)

101
SFML wiki / Re: Settings parser
« on: August 27, 2014, 08:13:12 pm »
I took the liberty of coding something myself with your code as a starting point, and worked in my thoughts.
Here is my version of a very simple config file parser https://github.com/SeriousITGuy/ConfigParser


102
General discussions / Re: Randomizer.hpp
« on: August 26, 2014, 09:07:26 am »
Taken from stack overflow
--
#include <random>
#include <chrono>

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 rng(seed);
std::uniform_int_distribution<int> gen(min, max); // uniform, unbiased

int r = gen(rng);
I use this algorithm to generate random numbers, works like it should.
Made a few tests how good the distribution really is with 100 million numbers between 1 and 100. Good enough to (nearly) appear truly random.

Thanks Jesper for the additional links, some important and interesting info in there.  ;)

103
Thanks for the quick answer  :D.

I was thinking about passing the World through Context to my stacked up NewPlaneState... but it smells a little bit of sulphur...

You're about right, this screams "sulphur" :D. This would couple the World class with all other States, not a wise thing to do in the presented architecture. World is only used inside the GameState and it should stay only there.

If you just want to "animate in" a new plane after the first is crashed, why not make use of the powerful command system to do so? The tools are all there, I leave the rest to yourself ;)

104
SFML wiki / Re: Settings parser
« on: August 04, 2014, 10:48:06 am »
This, of course, does not apply to const-references

Haha, that's it, was working with references and did not notice its pointed towards copy-values. Thanks again ;)

105
SFML wiki / Re: Settings parser
« on: August 04, 2014, 09:53:25 am »
Just stumbled across the settings parser on the wiki, and I have a question regarding the data structure you save the data in. Why do you use a std:vector<std::pair<std::string, std::string>>  ?
With a vector of pairs you can enter duplicate settings, and your code then will always only select the value with the lower index-key in your vector. The second value with the same key (but higher index in your vector) will never get selected (and shouldn't be there in the first place in my opinion).

That's a little design problem and I think this should be addressed. If a std::map<std::string, std::string> is used instead of a vector, only one instance of a key can live inside the map, which gets overwritten if the same key is present in the text file (which could also be eliminated easily using a map).

Also maybe some checking if the given text file yields a valid format maybe benefical, if the user manually edits the text-file (which developers often do for unit testing). Some points from the top of my head:
- Left- and right-trimming the lines for whitespace before parsing them
- converting the key to be always lower (or upper) case, so that it's really unique (so case-variants of identical keys can also be detected)

Throwing an exception instead of returning false if the text file cannot be read may also be better, a bool-return can be ignored, a thrown exception not ;)

Just some improvement thoughts to make the already good implementation more robust.
Cheers!


OT-Question:
I agree that it's useless as part of the interface, but it can sometimes be useful to do it in the implementation.
Like so:
void someFunc(int i);

void someFunc(const int i)
{
... do stuff involving 'i' ...
}


How do you do this? If I declare a function like you without the 'const' and then define it with 'const', I get a C2511: Overloaded member function not found in '...'
I see the benefit of it, but can't implement it. Confused here  :o

Pages: 1 ... 5 6 [7] 8 9