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

Pages: [1]
1
General / Re: unique_ptr help
« on: January 18, 2015, 02:43:55 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 think "that book" fails big-time by not mentioning that you need to #include <memory>


Along with many many other similar issues in Chapter One which I managed to overcome myself. Still a great book Im enjoying it. Sorry to not know everything like you guys and maybe I should of googled instead of asking human beings, but I guess Im just old fashioned. I spose it does add to the amount of answers on this very site and has increased traffic at very least by 1 person so it cant be all bad :D Peace!!

2
General / Re: unique_ptr help
« on: January 18, 2015, 02:37:49 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


AND THANK YOU FOR THE LINK HERE AS I SIMPLY NEEDED TO INCLUDE <memory>

.... ahhh bliss..... until 5secs later when next problem arises :)

3
General / Re: unique_ptr help
« on: January 18, 2015, 02:34:43 am »
thanks for the replies guys and I fully get what you are saying. However I have spent several hours( like, hundreds of hours over several years) reading cplusplus and many other references on C++ but as they do not show direct examples of how each feature is applied to creating a program it seems difficult to learn and I thought maybe learning by finding out what causes the errors may help (which did work for me on XNA which I even struggled with at first).

For example cplusplus does a create job of explaining exactly what a pointer is, but I still don't see why you need them, that bit wasnt explained. I realise you have to allocate memory for any asset etc but it just isnt explained as to how,why and when, on any of the sites you mention (or that I have read myself after extensive google and book-reading).

I guess I will go back to square one and read all those references again but still seem to have no 'real-world applications' for the factual knowledge learned from said references.

4
General / unique_ptr help
« on: January 18, 2015, 02:14:45 am »
Ive been trying to teach myself programming in C++. I have some experience of making a few full games in XNA but as you probably know, XNA makes everything fairly simple where you can just start adding objects immediately.

Anyway, I am following the tutorial book: SFML Game Development SFML 2.0 (However I am using SFML2.2 and VS2013 - hope this will be ok!)

I am stuck on the 2nd Chapter (I must admit I'm finding this book the most helpful Ive seen but much of it is left to me knowing where to put things like variables etc. and they don't really explain properly about adding classes to the project - together with headers etc - so I have been fairly confused the whole time and currently have the whole 'game' running from 'main.cpp' without any other classes or files.

The start of the 2nd chapter describes how I must use std::unique_ptr to create a class designed to handle loading of textures. (I realise the std library is not part of SFML, but Im hoping someone here can/will help me). When I try to implement this I get error: "std has no member 'unique_ptr' "

There is "unique_copy" but this looks like its something completely different.

I'm gutted as I was just feeling like I was starting to build a good understanding of how the game fitted together within c++ and was very much enjoying working through that book :/

Is the code in the book correct for my IDE and version of SFML? Is it just me being an idiot? I'm lost now :(

Pages: [1]