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 ... 651 652 [653] 654 655 ... 720
9781
Graphics / Re: plotting path of a robot in an obstacle filled environment
« on: September 04, 2012, 05:01:44 pm »
I guess you're wrote the last message on your phone or table, but please try to write full English words and sentences, it's quite hard to read otherwise (abt = about, eqns = equations). ;)

Thanks for the reply...what i meant was how to check whether a point lies inside a polygon created using sfml
My polygon would be defined using polygon.addpoint(). How should i go abt checking this?
in matlab you have a function inpolygon() that does this job...what abt sfml
SFML is not a math library and is also not design for that. There doesn't exist a inpolygon() function or similar (afaik).
There are many ways to check it here and here are two possibilities.

For the window limits part...i want to basically set x and y axes limits...for eg x limit:-100 to 100 and y limit:-150 to 200
i hope you get the point
Not really... What should those limits do and what do you actually want to achive?

9782
Graphics / Re: plotting path of a robot in an obstacle filled environment
« on: September 04, 2012, 01:11:44 pm »
Q-1 how to check whether a point lies inside a polygon (this is for obstacle detection)?
This is a puerly mathematical problem and there are many solutions floating around in the internet, just google for it. ;)

Q-2  the default window only works in the first coordinate....how can i deal with negative coordinates? if i try to give position values which are negative then i can't see anything on the window.Does it have to do something with the views?
If I understood you correctly, you want to follow the robot if he'd move out of the window (= negativ coordinates), right?
Then yes you'd just have to move the view of the window.

Q-3 is it even possible to do what i intend to do using sfml?
Everything is possible with C++ and SFML is just a library that will help you with drawing and input stuff and since SFML has a sf::VertexArray it can nearly draw anything you want. ;)

9783
Feature requests / Re: sf::Text constructor
« on: September 04, 2012, 09:17:34 am »
There is such a constructor, mainly the default constructor. ;)

9784
General / Re: Why doesn't my fullscreen window display?
« on: September 04, 2012, 12:53:49 am »
Btw there's a whole quoting system with quote-tags etc. so you don't need to use some strange looking >>> and <<<... ;)

1. Can I continue to load my 1680x1050 image but use fullscreen mode to accomodate lower res monitors?  Or do I need to load a 640x480 image and have fullscreen mode resize it larger to the user's screen resolution?
You can load the highres image and then resize it to fit the monitor resolution, but it may also be good to have diffrent resolution versions at hand (e.g. mipmapping), because the resize algorithm used by SFML/OpenGL might not be as good looking as one you can use in your favourite image editor. ;)

2. Is there an example of actual code to convert coordinates when fullscreen mode is used?  (Or could some kind soul write an example here?)  I had a hard time coming up with the actual code when I looked at the SFML 2.0 documentation on that before.
I'm not quite sure what you're asking here. What exactly do you want to convert?
When you're in fullscreen mode you 'own' the whole screen, i.e. the top left pixel is the 0,0 position of the rendering part.

If you want to prevent the stretching of the rendering area on widescreen monitors, then you should take a look at sf::View. I've written a tutorial on it that also includes a code example. ;)

9785
General / Re: Multiple Object generation
« on: September 04, 2012, 12:26:16 am »
No, but my ship isn't in a vector, it is just a sprite made in my main.cpp. So how would I delete that?
Then don't keep a copy of the sprite in the main function, e.g.
        std::vector<sf::Sprite> asteroidV;
        for(int i=0; i<5; i++)
        {
                asteroidV.push_back(sf::Sprite());
                asteroidV.back().SetImage(asteroid);
                asteroidV.back().SetPosition((float)sf::Randomizer::Random(50, 780), (float)sf::Randomizer::Random(-5, -50));
                asteroidV.back().SetCenter(spriteAsteroid.GetSize().x/2, spriteAsteroid.GetSize().y/2);
        }
And then you can simply call eares e.g.:
asteroidV.erase(asteroidV.begin()+5);

9786
General / Re: Why doesn't my fullscreen window display?
« on: September 03, 2012, 11:25:29 pm »
I'm not really sure what you refere to with 'centered' and 'not display at screen position 0,0'.
The window has a border before the actual rendering part starts, afaik if you set it to 0,0 then the window will be set to 0,0 but it will include the border.

Why don't you just use fullscreen mode, since you want to cover the whole screen?

9787
System / Re: Multiple argument functioned thread
« on: September 03, 2012, 11:18:14 pm »
I'm assuming you're refering to SFML 2.

I guess there are many ways to achive this.
Since you can declare which type you want to pass, you can create the type you want, so it could be your own struct or your own class or just an std::vector, etc...
Another way is to have the variable in the same scope (probably global scope in your case), which needs quite a bit more attetion so you don't run into race conditions. Also keep in mind global variables aren't such a nice code design. For the global scope problem you could make the function a member of a class and then use the member variables (you'll still have to make sure that there are no race conditions). ;)

9788
General / Re: [SFML 2.0] Access violation (debugging)
« on: September 03, 2012, 11:07:04 pm »
How do you check what version of SFML you are using?
I guess you just downloaded the RC release from the download page.

I guess you're experiencing the default font problem, but that's just a guess...
You can test that 'theory' by using a diffrent font and passing it to the sf::Text instance via the constructor or by removing all the text objects to see if you still get the crash at exit.

If we should look more into it you need to provide a minimal and complete example that also crashes on exit.

9789
General / Re: [SFML 2.0] Acess violation (debugging)
« on: September 03, 2012, 09:50:44 pm »
You still could trace the calls back with the callstack provided in VS, but you'd eventually end up in some SFML resource/context code and wouldn't be able to figure out what goes wrong either.

You need to provide a bit more information so we can say what porbably happens. ;)
What exacte version of SFML 2 are you using?
Do you link dynamic or static?
Do you compile in debug or release mode?
Do you use the default font?

9790
General / Re: how to compile under cygwin
« on: September 03, 2012, 09:32:01 pm »
But I see that MinGW compilers seem to be available in the cygwin environment.
What about using it ?

I haven't found much tutorial about how to compile with MinGW under Cygwin. Maybe this is not a good solution ?
You can use it if you want, but the binaries will also need the cygwin DLL (unless you set the flag to not use cygwin stuff).
If you've installed them, then you can easily call them with mingw32-make or mingw32-gcc, etc. IMHO it doesn't make that much sense to use MinGW in combination with cygwin, since cygwin already provides gcc, make, etc.

9791
General / Re: how to compile under cygwin
« on: September 03, 2012, 08:31:01 pm »
Cygwin tries to 'emulate' a POSIX/Linux enviroment under Windows, for that it makes use of various tricks and if you compile an application with GCC under cygwin you'll also have to provide the cygwin DLL.
I'd also say that you'll have to recompile SFML for cygwin.

If you've all the needed tools installed from the cygwin repository it should work very similar to Linux.
You'll also have to make sure that you don't have any interference with other application installed on your system, e.g. if you have CMake installed for Windows, make sure it doesn't get called from the command line, etc.

I'd say it would be better to use something like MSYS, MinGW and Code::Blocks or if you want to leave the gcc area you could also use Visual Studio Express which can also compile on the command line, if you don't want to use the IDE itself. ;)

9792
Feature requests / Re: sf:Color float form
« on: September 03, 2012, 07:39:13 pm »
Why?
Probably because of some old habit. Otherwise I don't really see a benefit either, since there would always be some strange converting...

And how (new constructor? new class? ...)?
Or more specific, do you just want the constructor to make the convertion for your, or would you then also expect that the porperties (i.e. red, green, blue, alpha) would be of a float value?

I don't really see any advantages in this 'feature' for SFML. It just makes the API more complex. Percentages of colors isn't really a describtion of a color, so it doesn't make that much sense.
And on top of this, if you need such a convertion functionality it's quite easy to create a factory class with additional convertion functions, or similar constructs which can be placed on top of the sf::Color class. ;)

So tell us more what your use case would be and what you'd exactly expect from sf::Color to handle your idea. :)

9793
Graphics / Re: Member function sprite call
« on: September 03, 2012, 06:26:10 pm »
My (beautiful ;) ) background appears at last!
Btw I advice you to always call Window.clear() (unless you know what you're doing). ;)

9794
Graphics / Re: Member function sprite call
« on: September 03, 2012, 05:22:50 pm »
Deleted the "public: sf::Sprite" line in the class header.
I realized that was pointless after your "where do you derive from sf::Sprite" remark.
Oh now I've seen it. ;D

And nicely done: 1000th post! ;)
Thanks! ;)

I deleted the "sf::Sprite m_sprite" line in the constructor, and my sprites don't appear black anymore...
Now they're white... ^^
This means that the texture got lost somewhere on the way from loading to display it. My guess would be that this happens at the point where you hand over your image manager by value instead of a reference on the constructor of InterfaceElement. ;)

What happens if you change the decleration to the following code:
InterfaceElement (const std::string& imageToLoad, int positionX, int positionY, ImageManager& ImageManager);
Or maybe even a const ref
InterfaceElement (const std::string& imageToLoad, int positionX, int positionY, const ImageManager& ImageManager);

9795
SFML website / Re: Search/Database problem
« on: September 03, 2012, 04:48:31 pm »
Well the search function seems to become more and more useless, i.e. I've now tried to search something 10 times in a row and always either got the PHP error from above or an EMPTY_RESPONSE from the server... >:(

I did a little research and came up with this statement about the error (source):
Quote from:  Spuds
This error basically means that sometime between when the page load began (which means an sql connection was made) but before the end the page the mysql connection dropped.  This should *never* happen but it does, I don't know why but it does.
Laurent: Could you maybe check the MySQL logs & SFM logs for strange mysql drops or similar and/or contact your hoster, maybe they know more about this...

I've also found these two threads, but I haven't digged all the way through it, but maybe there's a solution somewhere:
http://www.simplemachines.org/community/index.php?topic=423482.0
http://portamx.com/2835/error_log-shows-an-error-in-subs-db-mysql-php-on-line-130/

Or does this solution fix it?

Edit: Ah well binary actually linked already to that issue, so it seems to be that the MySQL server just drops the connection because of too much load. So this should be solved by the hoster...

Pages: 1 ... 651 652 [653] 654 655 ... 720
anything