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

Pages: 1 ... 3 4 [5] 6 7 ... 83
61
Network / Re: FTP Status 1002
« on: January 03, 2015, 11:45:35 pm »
Oh...well, I guess it would be nice if the tutorial or documentation mentioned this somewhere.

62
Network / Re: FTP Status 1002
« on: January 03, 2015, 11:03:38 pm »
This is purely a question about the FTP protocol.  Unless you have some reason to believe SFML is the root cause of the problem, you would probably be better off googling "FTP 1002".

For example, https://stackoverflow.com/questions/26647423/nsurlerrordomain-error-code-1002-description and http://dev.error1002.com/faq_connect.php#1002 suggest that a bad URL is one possible cause.

63
sfml-opengl32-s-d is not a library that exists, because OpenGL is not part of SFML itself, but a dependency of SFML.  As the official tutorial states, the name of the library should be opengl32.lib.

64
Graphics / Re: Font Aliasing
« on: January 03, 2015, 09:13:55 pm »
Well, const_casting like that is probably undefined behavior so no surprises.  Even if it did work that'd just be a hack around SFML not providing proper access to that option.

https://github.com/SFML/SFML/issues/254 appears to have a lot of relevant discussion about the actual issue here.

65
That error appears to mean you're using a 64-bit ("x64") library with a 32-bit ("x86") compiler, though I'm not quite sure.  It's definitely a 32/64 conflict of some kind.

The official tutorials are probably the only reliable way to get your toolchain set up to actually work correctly. Most other sources gloss over it entirely (since most devs need to know this stuff already) or get it blatantly wrong or provide info that's only appropriate for their particular machines.

66
Graphics / Re: Font Aliasing
« on: January 03, 2015, 09:03:04 pm »
A bit of a blind guess, but since I was browsing the sf::Text code recently and it might save someone some time: Could this be because sf::Font calls setSmooth(true) on the texture it uses to render glyphs? (https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Font.cpp#L716)  I assume that's correct in most cases but maybe it should be configurable?

67
Audio / Re: Can't play several sounds at the same time. :/
« on: January 03, 2015, 07:09:32 pm »
The code is not complete because we can't copy-paste it into ideone or Visual Studio and run it ourselves.  That automatically means we can't do anything but guess what the problem might be.

The code is probably not minimal because most of the functions you've shown in Player and Stream are probably not relevant.  If you made an actual minimal example with just a main() function calling methods on Player/Stream, I doubt you would need that whole interface to reproduce the problem you're describing.  I also don't see why Player is necessary; Stream is the one actually playing sounds.

You've also failed to state what problem you're having.  Since your initial post contains compiler errors and very vague descriptions of runtime errors, which can't possibly be the same issue, we don't even know which problem you're trying to ask for help with.

An actual minimal and complete example that we could help you with would look more like this:
#include <SFML/Audio.hpp>

int main()
{
    sf::SoundBuffer buffer1;
    if (!buffer1.loadFromFile("sound1.wav"))
        return -1;

    sf::SoundBuffer buffer2;
    if (!buffer2.loadFromFile("sound2.wav"))
        return -1;

    sf::Sound sound1, sound2;
    sound1.setBuffer(buffer1);
    sound2.setBuffer(buffer2);

    sound1.play();
    sound2.play(); // I never hear this sound...

    return 0;
}
Provided you attached the sound files and told us some details about your sound card/audio drivers.



Please, at least try to make a help request that the SFML team can work with.  There's really nothing they can do with what you've posted so far, even if they had infinite patience.

68
Try the official SFML tutorials instead: http://www.sfml-dev.org/tutorials/2.2/

All I can say without more information is those linker errors probably mean you aren't linking against the system and graphics modules.

69
General / Re: Simultaneous Drawing/Rendering
« on: January 03, 2015, 01:48:28 am »
I guess that technically is undefined behavior.  Since the % operator is integer-only I was worried doing modulo on a floating point might be non-trivial, but it looks like there is a standard function for floating-point modulo so I definitely agree with using that to keep it safely between 0 and 2pi.

Glad to hear the rest of it is working now. =)

70
Graphics / Re: Mouse input with sf::View
« on: January 02, 2015, 05:59:54 pm »
The solution is at the end of the official tutorial on views.

Quote
When you use a custom view, or when you resize the window without using the code above, pixels displayed on the target no longer match units in the 2D world. For example, clicking on pixel (10, 50) may hit the point (26.5, -84) of your world. You end up having to use a conversion function to map your pixel coordinates to world coordinates: mapPixelToCoords.

// get the current mouse position in the window
sf::Vector2i pixelPos = sf::Mouse::getPosition(window);

// convert it to world coordinates
sf::Vector2f worldPos = window.mapPixelToCoords(pixelPos);

By default, mapPixelToCoords uses the current view. If you want to convert the coordinates using view which is not the active one, you can pass it as an additional argument to the function.

The opposite, converting world coordinates to pixel coordinates, is also possible with the mapCoordsToPixel function.

71
Graphics / Re: Can't compile basic circle
« on: January 02, 2015, 05:14:51 pm »
I can't really tell what you're trying to describe there, but if you're asking for the ability to change the text in the console window's titlebar, I don't believe SFML provides that feature (it kind of assumes you want a "real" window you can draw things in; if you actually want to write a command-line console app then SFML isn't much use anyway).

72
Graphics / Re: Can't compile basic circle
« on: January 02, 2015, 04:50:54 pm »
A console window (where cin/cout go) and a gui window are two different things.  You can't do both in the same window.

You can draw text in your non-console window with things like sf::Text, but if the goal is to see debugging output it's easiest to just configure your project so you have the console window in debug mode but not release mode.

73
General / Re: Strange OpenGL bug thingy and problems
« on: January 02, 2015, 04:25:37 pm »
Well, obviously deltaTime goes up when FPS go down, they're inverses of each other.  It's still not a significant difference.  Like Laurent said, at FPS that high (or deltaTimes that low) these kinds of differences really don't mean anything other than you aren't drawing much yet.  Don't worry about it until you're falling below 60.

Still need minimal & complete examples for the real issues.

74
General / Re: Strange OpenGL bug thingy and problems
« on: January 02, 2015, 03:52:59 pm »
Like any other issue, we're going to need to see complete and minimal examples before we can do anything besides blind guessing.

Also, you can very easily google error 1280.  From the results I see, that error almost certainly means you made a mistake in your code somewhere.

75
General / Re: Simultaneous Drawing/Rendering
« on: January 02, 2015, 02:40:05 am »
Quote
Shouldn't I call clear inside 'someFun' as well? The display idea makes sense,
It's exactly the same for clear and display.  You call them exactly once per frame in the main game loop, and each entity only worries about how to draw itself.

Quote
Also since 'theta' would keep incrementing, wouldn't this eventually cause the game to crash since 'theta' would keep increasing towards infinity?
I don't see why big numbers would make things crash (the sin() and cos() functions can handle larger angles than that), but you're right, I should I have put a modulo 2pi in there.

Edit: Come to think of it, sin() and cos() will return the same results whether we make the variable wrap around or not, so technically it doesn't matter.

Quote
I am still unclear though how your code will work. What would the loop that calls your 'draw' look like inside the game loop?

int main() {
    sf::RenderWindow window(...);

    Star sol(...);
    Celestial test(100,sol,10);
    Celestial other(140,sol,10);

    sf::Clock clock;
    while(window.isOpen()) {
        // process events

        sf::Time deltaTime = clock.restart();

        window.clear();
        test.draw(window, deltaTime);
        other.draw(window, deltaTime);
        window.display();
    }
}

The main loop of an SFML program is always supposed to look something like this.  You should see very similar loops in the official tutorials (like this one: http://www.sfml-dev.org/tutorials/2.2/graphics-draw.php#the-drawing-window).

Pages: 1 ... 3 4 [5] 6 7 ... 83