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

Pages: 1 [2] 3 4 5
16
General / Visual Studio 2010 Express Problems [SOLVED]
« on: July 01, 2011, 01:59:13 pm »
I'm not sure about compiler time, but that is probably the case.

The size issue is a good point in certain circumstances. If you have one SFML program on your computer then it doesn't make much difference whether the SFML code is in a shared file or inside your program, but suppose you have five SFML programs. It's obviously better for them all to share the same SFML code than for each to keep its own identical copy.

One particularly good example of this is the C runtime. Imagine if every program you made in Visual Studio had the Visual C++ runtime code in it. It would be crazy ^^

Also, some licenses (e.g. LGPL) only allow you to link dynamically.

17
General / Visual Studio 2010 Express Problems [SOLVED]
« on: July 01, 2011, 09:20:07 am »
Well because static libraries have all the implementation inside them. Then the C++ linker links them to your project at link time, that is it merges the executable code from your own translation units (compiled source files) with the executable code from the static libraries. You program then contains all the SFML binary code so why should it need DLLs? ;)

18
General / Visual Studio 2010 Express Problems [SOLVED]
« on: June 30, 2011, 06:39:24 pm »
That would be nice. At a simple level I don't think it's too bad, though. When your developing, use debug configuration because it has debugging information in it (e.g. I think there are different C runtimes for debug and release) and use release to distribute because it's compiler optimised and smaller.

The details of how DLLs are implemented are extremely complex. Personally, I use the DLL libraries where possible, but the sf::Text/sf::Font error has sometimes driven me to use the static libraries.

19
General / Visual Studio 2010 Express Problems [SOLVED]
« on: June 30, 2011, 05:13:32 pm »
Just to clarify, I wouldn't watch the first project video tutorial as it has a few mistakes (I'm meaning to re-upload it, but I'm hampered by slow internet). However, the textual version is up to date.

EDIT: If you have any questions about it, post there or here, PM me or email me or whatever. I welcome all input on my tutorials :)

20
General / Visual Studio 2010 Express Problems [SOLVED]
« on: June 30, 2011, 01:09:29 pm »
If you error was exactly this:
Quote
"CMake error: Could not create named generator Nmake Makefiles"

then make sure you've got your capitalisation correct: "NMake Namefiles"

21
General / Visual Studio 2010 Express Problems [SOLVED]
« on: June 30, 2011, 12:46:13 pm »
Yep. :) Not to be confused with xander333 or xander337 ;)

22
General / SFML2, cmake and Windows 64 bits
« on: June 30, 2011, 11:34:53 am »
Oh, I see. I'm not sure, but at a guess, it's because when your application is running, you can still get crashes inside the SFML binaries as well as in your own code.

23
General / Visual Studio 2010 Express Problems [SOLVED]
« on: June 30, 2011, 10:55:29 am »
Quote
I thought I only needed to link graphics since that's the only one i'm using in ze code, am I wrong?

You only need to link what you're using. However, graphics functionality relies on window and system functionality (the <sfml/graphics.hpp> header includes <sfml/window.hpp> and <sfml/system.hpp> implicitly).

As for your crash, did you build the binaries yourself? (I'm guessing not, as you're using SFML 1.6). I suggest getting SFML 2.0 and building the binaries yourself. That will avoid any inconsistencies due to mismatched compiler versions. Building the binaries may seem daunting if you've not done that kind of thing before, but for me it solved a lot of other problems.

Laurent's Tutorial
If you want a complete step by step list of instructions, you could also try my tutorial.

24
Graphics / Changing window size
« on: June 30, 2011, 10:53:04 am »
I think you must do this:
Code: [Select]

sf::View View(sf::FloatRect(X_pos, Y_pos, Event.Size.Width, Event.Size.Height));
Window.SetView(View);

(where X_pos and Y_pos represent the desired coordinates of the top left corner of the view (can probably set to 0.0f, 0.0f if you're unsure).

Read more here:
Tutorial
Documentation

25
General / SFML2, cmake and Windows 64 bits
« on: June 30, 2011, 10:49:10 am »
I'm not quite sure what you're asking, but:

1) You can change project settings independently for debug and release.
2) You can build both sets of binaries: debug and release
Therefore,
3) You can link to the debug binaries in debug configuration and the release binaries in release configuration (and swapping between them is as simple as using the dropdown box)

EDIT: Did you build debug and release binaries? You need to run CMake once for each one, changing the value of CMAKE_BUILD_TYPE (first time it is "Release" and then "Debug" - without the quotes).

26
Window / Event sample rate
« on: June 29, 2011, 08:29:05 pm »
I know - I just couldn't help but say something about your generalisation ;) I guess I should have refrained from pushing the thread off topic though  :oops:

27
Window / Event sample rate
« on: June 29, 2011, 08:43:07 am »
Quote from: "OniLink10"
use of new ... there are instances where it must be used, but those have to do with inheritance

You were probably just trying to simplify things, but I feel I must point out that I have also had to use dynamic allocation when creating a vector of noncopiable types. And there are probably a load of other valid uses too, such as saving stack space. ;)

28
Graphics / How do I display a variable?
« on: June 28, 2011, 09:36:01 pm »
But you have used str():
Code: [Select]
return mStream.str();

This is what we were talking about. The point were you have used 'string' below, it is std::string, as it should be, because you are telling the compiler to construct an std::string from a 'MakeString', which it can do by virtue of this function:
Code: [Select]

      operator std::string() const
      {
         return mStream.str();
      }

29
Graphics / How do I display a variable?
« on: June 28, 2011, 09:26:30 pm »
So it works there? Then you must have changed something in your actual code. Compare the two and see what you can find.

30
Graphics / How do I display a variable?
« on: June 28, 2011, 09:21:32 pm »
You should only have to include <sstream>.

If you are writing oss.string(), then you can't possibly be using std::string.
(Where oss is your std::ostringstream).

But it is definitely str(), anyway.

On the subject of
Code: [Select]
using namespace, IMO it's best to put it in limited scope, for example inside your main function (yes, you can do that ;) ). Then it will only bring stuff in std into scope within main. Of course, sometimes it's easier to put it globally, but that is risky.

@Nexus Beat me to it ^^

Pages: 1 [2] 3 4 5