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 ... 608 609 [610] 611 612 ... 720
9136
SFML projects / Re: My new Project
« on: November 27, 2012, 10:56:19 pm »
:o So many things, omg.
is it still acceptable? Or did i waste my time?
Well many things are just minor corrections, like spelling and naming conventions, so don't get scared from a list. Also nothing is really mandatory on there, but they'll improve your code quite a bit and as I said, when you're done 'refactoring' you'll feel way more comfortable working with your code.

Nothing is wasted, because with every step you've learned something new. ;)
Keep in mind not that many get as far as you already have.
As gyscos already said, everyone needs some iteration until he gets a final product - nobody is born as a programmer. :D

i really like the idea with the RunGame Class, it should have been clear to me.
Above all I need no more global variable. And the entire management is simplified.
Yes!
I usually go with an Application class and a StateManager with different states (menu state, play state, credit state, etc). Maybe it's another thing you could look into, as an example my SmallGameEngine.

Note for vs 2010 users: this seems to be totally supported by microsoft but, in their infinite wisdom, they've hidden the option under 'Tools->Options->Text Editor->C/C++->Advanced->IntelliSense->Use Forward Slash in #include Auto Complete' which is set to false by default.
Cool didn't know that. :)

9137
Graphics / Re: GetPosition for shapes and sprites
« on: November 27, 2012, 10:43:39 pm »
Stupid of me. I thought first args of constructor are pos.
Well RTFM! it's so nice and easy understandable. ;)

Also I advise you to use SFML 2, because SFML 1.6 hasn't been touched over 2 years, has many bugs and lacks a lot of new and shiny features. :)

9138
Graphics / Re: Image and OpenGL does not work
« on: November 27, 2012, 10:39:30 pm »
It seems to me like clipping/lighting is set in a way that it turns black at a certain distance, but I've no idea how OpenGL works... ;D

Ehrm don't you want to use a real texture: sf::Texture?
There's a difference between sf::Image and sf::Texture; of course if you really want to use the pixel array you need to use a sf::Image, but sf::Texture has a bind() function, so you can easily use it with your OpenGL code. ;)

9139
SFML projects / Re: My new Project
« on: November 27, 2012, 06:26:39 pm »
Ok, its not the graphic.
It still can be, since ATi != ATI. I'm stuck with an older ATI-HP driver (can't update unless HP provides a new driver package :-\).

So bad? Is my RunGame the worst or is there something worse?
Well it's the only one not using a class, so yeah that's quite bad.

Here a few things you could change:
  • Don't use global variables and don't even think about using global instances! (E.g. no global sf::RenderWindow, no global sf::Clock...).
    If you 'need' global objects then your design is most probably flawed.
  • Don't use the C prefix for classes, it's unnecessary and an old Microsoft relic.
  • CLights::AddLigth should be named CLights::AddLight
  • locallConverter.hpp should be called localConverter.hpp
  • Keep the code naming consistent; e.g. localConvert should like the rest of the files get called LocalConverter or all member variables should use the m_ prefix, etc.
  • Try to reduce code repetition as much as possible (e.g. the AddLigth calls in RunGame).
  • To get a nicer draw call derive the object which can be drawn from sf::Drawable (object.draw(window) -> window.draw(object)).
  • Make use of the initialization list to initialize member variables.
  • Inventar and Objekt are German, the English words are Inventory and Object. ;)
  • Maybe use more descriptive and less confusing names for Light and Lights.
  • Don't use using namespace std, it's a little more to write, but after some time you get used to std:: and it makes things clearer where they come from.
  • Don't use backslashes for header inclusions. There's no problem with forward slashes under Windows (e.g. #include <SFML\Graphics.hpp> -> #include <SFML/Graphics.hpp>
  • Only include the class headers of the classes which are actually needed in that file. E.g. #include <SFML/Graphics/RenderTexture.hpp> instead of #include <SFML/Graphics.hpp>.
  • Don't use a vector of vectors, but use one vector and calculate the two dimensions on your own.
  • Maybe you should read again a bit about const correctness, I bet most of your arguments shouldn't get altered.
  • Use consistent indenting.
Quite a long list, as you see there's quite a bit that can be improved and when your done, you'll be glad you did it, because the source will look way better and more dense than the current chaos now. ;)

9140
Graphics / Re: sf::Sprite vector reference to sf::Texture vector
« on: November 27, 2012, 04:51:10 pm »
I think a vector of Texture is pretty dangerous in the first place. I'd say a vector of Texture* would be a little easier, since you don't have to worry about such invalidation-on-destructor and so on. Deleting the texture on removal is a small price to pay.
Both are bad ideas! Nowadays there's just no need to manually manage your memory, it's actually even depreciated. :-\

Either use a static number of textures and size the size of the vector in advance or use a recent compiler and std::unique_ptr. ;)

9141
General / Re: Building the SFML aplication on MAC - sfml-system-d not found
« on: November 27, 2012, 03:44:53 pm »
I've no idea about Macs either, but have you been following strictly the official tutorial?
If you do it correctly with Xcode everything should work out fine. ;)

9142
Graphics / Re: Text rendering broken on my machine when using sf::Shape
« on: November 27, 2012, 03:42:49 pm »
...it's not freedraw. If it's not freedraw...
FreeType I assume... ;)

Although I didn't follow the whole other thread and thus don't have as much insight as Qix, but I agree.
Then again we all know that Laurent has little time on his hands and iirc he has a Nvidia card, so maybe we (as a community) can hunt down the problem and try fixing it and I'm sure he'll try to be as much of a help as possible. ;)

9143
SFML projects / Re: My new Project
« on: November 27, 2012, 01:30:29 pm »
Which graphic card have you?
I've an Readeon HD 6470M (ATI).

I quickly skimmed through your code and noticed quite a few things one shouldn't do. One of the things I see that could cause big problems are your global instances... :-\
I strongly advice you to use a class instead of letting everything lie around in the global scope. Just pack all your functions and objects of RunGame into one class, create an instance in main.cpp and use that objects to call functions.

If you want I can also give some more feedback on the code. ;)

9144
Graphics / AW: Re: sf::Texture out of scope?
« on: November 27, 2012, 11:34:28 am »
I tinkered a little more and it looks more like I cannot use multiple class instances with the same texture ... is there a limit on accessing a resource?
No there isn't, since there's no reference counting or similar going.
If you had posted a minimal and complete example, we could've helped you in no time... ;

9145
General / Re: Visual Studio 2012 and SFML 2.0
« on: November 26, 2012, 10:27:31 pm »
Ok, so if I decide to use SFML 2.0 (which I used on the mac for a simple pong game) do I need CMAKE? I installed it and trying to follow the steps in the tutorial using CMAKE GUI.
There's a precompiled RC (release candidate) for SFML 2.0, so you don't need to compile it yourself.
Wait if you're using VS 2012 then you have build it on your own with CMake (yes it's CMake not CMAKE).
Which is what we've been telling you all a long...

9146
SFML projects / Re: My new Project
« on: November 26, 2012, 09:37:54 pm »
my brother-in-law has the same problem whit my program, he runs windows 7.
Then you should probably start describing what goes wrong, rather than 'it doesn't work'. ;)

9147
General / Re: Visual Studio 2012 and SFML 2.0
« on: November 26, 2012, 09:32:04 pm »
Depending on which version I decide to use.
Which would be more stable?
Use SFML 2, because it's more stable and it's maintained. SFML 1.6 hasn't been touched for over 2 years, has many bugs (e.g. the very very bad ATI bug) and lacks a lot of nice features (VertexArray, RenderTexture, ...).

I saw there are A LOT of tutorials for 1.6.
Yes, SFML 2 doesn't have all the tutorials, but it's mostly quite easy to port the 1.6 ones to 2.0. ;)

If I decide to build 1.6, where do I find the sources?
Also ... I need to have CMAKE installed right?
You'd find the source on GitHub in the branch sfml1 and no you wouldn't need CMake, since SFML 1.6 doesn't build with CMake. You'd need to convert the provided VS project file to VS2012 and hope that it works...

9148
Window / Re: Mouse/Keyboard Event issue
« on: November 26, 2012, 09:18:40 pm »
I saw someone do the includefile.h thing and it seemed legit to me because he would only have to include it once, right?

On my other projects I had hpp...  but I just let Codeblocks do it this time for me and didn't really care to much about it.
Mostly because it ran anyway and it didn't bother me that much... to each, there own.
Well it's not about what's most comfortable or nice, but it has an immense effect on the compile time and you won't run into any inclusion problem if you only include what's needed.
Maybe you should read again a bit on that topic and about 'forward declarations'. ;)

9149
SFML projects / Re: My new Project
« on: November 26, 2012, 09:15:23 pm »
i copied CB from my laptop(where everything is ok) to my Tablet, compiled it and......same shit ass before  >:(
Now don't just run it but debug it! ;D

9150
SFML projects / Re: My new Project
« on: November 26, 2012, 08:46:05 pm »
you mean i have to install an IDE on my other pc and try to find the error? sounds horrible   :-\
Well you don't need an IDE for debugging (gdb would be enough), but it's easier to handle with an IDE.
Code::Blocks is portable so you could essentially just copy everything onto the other machine. ;)

which version of Sfml are you using, and which OS
The SFML version doesn't change, since you shipped it with the source and I'm using Windows 8, but this shouldn't really matter either.
But if you ask which version I usually use it's the latest release from GitHub.

Sorry, The Axe and shovel through me off... Minecraft really was a 3D mining game...
Wow, so it takes only a axe and shovel to turn a game into 'Minecraft'? ;D

This whole situation kinda of reminds me of the release of Terraria... With the word "Minecraft" flying around.
Well that's the problem with all the Minecraft kiddies. You can do whatever you want and all they see is Minecraft and as I said, it's sad... :-\

(Also don't take this offensive, my statements are meant to be more general than focused on your opinion.) ;)

Pages: 1 ... 608 609 [610] 611 612 ... 720
anything