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

Pages: 1 ... 619 620 [621] 622 623 ... 720
9301
I verified that /MTd and /MDd are the problem. These are the steps I used:
  • Compile FreeType 2.4.10 from source with the /MT flag (use Debug Multithreaded configuration in their .sln)
  • Check out the latest SFML source from GitHub
  • Replace SFML/extlibs/libs-msvc/x86/freetype.lib with the /MT one
  • Compile SFML with CMake option SFML_USE_STATIC_STD_LIBS
  • Link SFML statically to my game (using SFML_STATIC)
Now my game compiles without errors. There are still warnings, but I think those are from libjpeg and libglew.
Well that doesn't confirm anything, it just shows that it works with /MT builds and your specific setup. ;D

As far as my testing goes (dumpbin /all LIBRARY | find /i "msvcr") I have only found a result on the libsndfile-1.dll but nothing in the static libraries, so...

9302
General / Re: Deciding which Container to use for a Manager Class.
« on: October 31, 2012, 03:11:15 am »
That's the reason I said "best" and not best. I understand that these things should be project specific, but I was asking for a general idea of STL container speeds. Most games aren't really going to have 100,000 textures, so I was looking for a container that may be "better" than a vector. By "better" I mean one that would balance adding and removing from a non-terminal point and being able to quickly find a value. Vectors are very fast at iterating from the start to end, but removing something in the middle can be heavy. Consider adding are removing instances nearly every step. (Obviously, there are very few times when this is even a good idea, but I know a vector is not the best container for this scenario.)
Okay this gives us a bit more to work with. :)
Unfortunately this list is missing C++11 containers.
If you want (amortized) constant (O(1)) look up, insertion and deletion then you might want to take a look at std::unordered_map, although it's not guaranteed by the standard (afaik) it will probably mostly get implemented as actual hash table.
std::map on the other hand is often implemented as red-black tree and thus is also quite fast but since things have to get sorted it's 'only' O(log n).
A std::list won't be such a good choice, since the look up, insertion and deletion are in O(n).

For the O-notation see here.
TL;DR: Smaller is better: O(1) < O(log n) < O(n)
And if you got too much time on your hand and are interested in data-structures you can take a look at this. :D

I'm writing the managers to implement the most balanced solution for any generic scenario.
And there I thought you've understood it. ::)
Stop writing stuff for 'any generic scenario' and start writing code that's needed by your game.
Writing a generic game engine isn't really something you should target and it's something that's very rare in the wild, e.g. first there was Quake then there was the quake engine or first there was Half Life and then there was the source engine, etc. ;)

I don't mind implementing auto pointers, it just doesn't seem necessary. What's wrong with:
Object* Instance = new (std::nothrow) Object;
if (Instance != nullptr) {/*do stuff*/}
else
{/*do error stuff*/}
 
Smart pointers not auto pointers (std::auto_ptr is depreciated). ;)
I'm sure it doesn't cover all the possible failures. Like I said read the linked post or at least take a look at this example.

9303
General / Re: Deciding which Container to use for a Manager Class.
« on: October 31, 2012, 02:06:48 am »
I'm looking for the "best" container that balances rapid lookup with quick deletion from a non-terminal end.
Asking for "the best" way is mostly always the wrong question. There simply is no "the best" way. Everything is relative and highly depended on what the code should do and for what it should be laid out. I mean there's a hugh difference between having to handle 100 textures or 100'000 textures, but not only the use case matters but also the integration and location within the project matters.
So to figure out what's "a very good" way of doing things "for your project", it'd probably best to read more on your own on the topic of different containers. ;)

The use of pointers is to avoid copying and such.
Well if you use pointers then the containers to not matter that much, because the containers will essentially just store the pointers and not the actual data. So look up and deletion will often be very similar.

The STL is built to guarantee high performance with the correct use of the containers, thus up to a certain point it doesn't matter that much which one gets used. Also i most cases you should choose the container by it's use case and not by it's 'performance' (otherwise you'd always have to choose a plain array/std::array). So if you want to use indices for your data, then go with a std::vector. If you want to have key->value matching and it should be ordered the go with std::map, if the order doesn't matter then go with std::unordered_map.  If you run into performance issues caused by your manager(s), then you could reconsider the choice.

I know that manual memory management is frowned upon with unique pointers, but it seems unnecessary when the manager deletes everything for you anyway (in its dtor).
I really advise you to reconsider that decision and read a bit more about the actual problem with manual memory management (e.g. read this thread fully).
Keep in mind though that shared_ptr might be more appropriate for 'manager' classes, since you most probably will share the resource rather than transfer the ownership (what unique_ptr does).

9304
General / Re: BASIC NEWB QUESTION about preprocessor
« on: October 31, 2012, 12:46:59 am »
Also, this is completely not how you should write code.
Yes! :-\
This is not really related to SFML itself but rather a question on the basics of C++ programming. We surely help out on problems with C++ when using SFML, but for basics we can't really answer every little detail with enough depth that users would understand. For that problem there exist hundreds of C++ programming books and thousands of tutorials, which can teach you way better how to use C++. ;)
So please consult a C++ book and look up the chapter on preprocessor and as a hint from me, take a very long and deep look at the class section. :)

9305
Thanks a lot exploiter. I have sent you the tutorial in pdf format. Thank you in advance for your effort to post it on Github and I hope many people will benefit from it.
So here you go with the wiki entry: Tutorial: Compile and Link SFML with Qt Creator

It's nearly untouched but probably could use some polishing, so feel free to do so. :D

9306
Graphics / Re: masskiller's OpenGL noob questions
« on: October 30, 2012, 10:31:47 pm »
I haven't read anything about the problem, but I just want to give you a hint:
Quote
    M.loadFromFile("Resources\\Images\\Menus and Others\\PNG\\Stage 1 Screen Cover (Temporary).png");
    Mask.loadFromFile("Resources\\Images\\Misc\\PNG\\Dione Background Pattern.png");
    Image.loadFromFile("Resources\\Images\\Misc\\PNG\\Flora Background Pattern.png");
To keep it more crossplatform and easier to write, just you forward slashes instead of double backslashes. ;)
    M.loadFromFile("Resources/Images/Menus and Others/PNG/Stage 1 Screen Cover (Temporary).png");
    Mask.loadFromFile("Resources/Images/Misc/PNG/Dione Background Pattern.png");
    Image.loadFromFile("Resources/Images/Misc/PNG/Flora Background Pattern.png");
Windows can handle this without any problems. ;)

9307
SFML projects / Re: Seiken Densetsu/Mana Fan Game [DEMO]
« on: October 30, 2012, 09:49:26 pm »
The game looks really nice, I'll hope you keep working on it.

Here a few things I want to point out:
  • DEMO often gets interpreted as a simplified version of a commercial final product, thus the title can be misleading. Maybe you could use [WIP] (Work in Process) and since it's nearly expected that a post in the project section has an executable you wouldn't need to imply that there's something to play around with, but only to state the it's not a finished product. Then again this is just a tiny detail (and maybe a intelligent marketing move). :P
  • As mentioned before by others a nice GUI would give the game a much better feel and you could 'integrate' the SETKEYS executable.
  • You should provide options or key combinations to automatically change the window size (double, tripple, or similar), rather than just pointing towards the maximize button.
  • Maybe you should provide a bit more information on the game mechanics (how does the menu 'work', i.e. selecting & using items) and maybe some background information (i.e. some sort of a 'story'). A nice way would be to integrate this into the game itself, but it would already be nice to see this in the first thread post.
  • The console outputs this up on start: Failed to open sound file "lib/audio/sounds/ripper.ogg" (System error : The system couldn't find the specified file.)

Might have to do with my GPU OpenGL version (?) since I have intel graphics.
Can you specify, what GPU do you have, note not all GPU support shaders (or all versions of shaders). ;)

Quote from: kaB00M
The file size is under 8.0 MB. Thanks to zlib! :-)
7zip/LZMA brings this easily down to nearly 7 MB. :P

9308
this seems quite complicated for me!
With what do you have problem with? I mean you only need to make a GitHub account and you're ready to enter it with many different formatting options. Sure it needs a bit more effort than just copy&pasting it to some text box, but com'on... ;)

What I could really easily do is, make a word/rtf document explaining the tutorial and share it with anyone willing to upload it on Github...
Sure I'll add it there. You can either post a link the file here or send it per email (eXpl0it3r@my-gate.net). ;)

9309
In the official wiki tutorial section on GitHub. ;)
Also take a look at the rules there.

9310
Graphics / Re: Is there a way to take a screenshot of the entire screen?
« on: October 30, 2012, 04:03:50 pm »
SFML can't do this directly...
You might want to take a look at QuickSnap or if you want to use Qt.
Otherwise Google is your friend... ;)

9311
General discussions / Re: SFML 2 Linker error VS2012
« on: October 30, 2012, 01:10:17 am »
I want to link libraries statically to my application.
You do that by unchecking BUILD_SHARED_LIBS, the USE_STATIC_STD_LIBS will also link the runtime library statically. The only problem at the moment is, that static runtime libraries will cause the linker errors and thus you can't use them at the moment. So to successfully link your application rebuild SFML without the USE_STATIC_STD_LIBS flag and everything will work.

If you really, really, really want to link the runtime library statically, you'll have to rebuild the external libraries.

9312
General discussions / Re: SFML 2 Linker error VS2012
« on: October 30, 2012, 12:38:44 am »
Actually I've already read those posts but doesn't get the solution. I'm started to thinking my english isn't enough for this :) I will read those again. Thanks.
If you have notice the connection, then why did you have to open up a new thread? ;)
You could've simply posted there and asked again how to 'resolve' this issue, which was already answered by Laurent:
Quote from: Laurent
In other words: disable the USE_STATIC_STD_LIBS option in CMake when you recompile SFML.

9313
General discussions / Re: SFML 2 Linker error VS2012
« on: October 30, 2012, 12:22:26 am »
I wonder if the day will ever come where everyone understands the concept of using a search function (or posting in the right forum)... ::)


9314
General / Re: Window application with no window?
« on: October 29, 2012, 10:17:50 pm »
Everything is possible with C++, but just not with SFML directly. ;)

You'd need to look into some OS specific coding I guess. Depending on what you want to achieve there might be tools that could simplify things dramatically. ;)

9315
General discussions / Re: Unofficial Nightly Builds
« on: October 29, 2012, 09:47:27 pm »
Who needs pre built libraries for Linux? That's often more a pain than helpful due to the depending libraries in different versions.
Yeah, as I said I'm not really sure if this is useful... People using Linux often know or are at least willing to learn how to build/do stuff on their own anyways.

But if you wish so I could help you. Either by giving you SSH access to a Mac, and you take care of everything, or you give me the build script and I send the resulting binaries to you or to a server.
Well I've never developed anything with a Mac so I'm very unsure how things work there. I've a build script now for Windows (.bat) and one for Linux (.sh), but I'm not sure to what extend it would work on a Mac, but it's actually very simple although probably not the most efficient.
It probably would be better if you built them...

Pages: 1 ... 619 620 [621] 622 623 ... 720