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

Pages: 1 2 [3] 4 5
31
I thought this was funny: "SFML is slow, very slow, and the API isn't really that clean. It's so heavily OOP it doesn't feel natural to use and is more suited to a Java application."

While some of the points are valid, I think a simple explanation of why SFML isn't more utilized is marketing. SDL and many of these other libraries have had time and usage. People see the SDL logo or "Made with SDL" so over time it's developed rapport. Unfortunately SFML hasn't had this publicity yet so dismissal is easy. We all know SFML>SDL any day :P.

32
General discussions / Re: SFML 3 - What is your vision?
« on: May 31, 2014, 02:45:02 am »
There really should be a way of managing the requests better. Personally I have the problem that I quickly lose overview in a forum, because current stuff gets mixed with old stuff. And once you have read the threads marked with "New posts!", it's difficult to remember what's still important and what not.

Just like with this thread: One has to go through *all* posts for collecting all the ideas etc. GitHub's issue tracker would work, however then ideas would be mixed with actual issues, which is not an option as well.

I agree to Nexus that a 100% free-form voting would end up in SFML becoming a 2D game engine with a world editor, tons of effects and a class "sf::GameGenerator" -- probably not what this library is intended for. ;) However a mixture might be interesting, i.e. feature requests are made, everybody discusses them, based on arguments it's accepted or declined, and if it's accepted, people might vote for influencing priority/severity (is that what you meant, binary1248?).

Tello might be something worth looking into. Here's the feature tour and an example:
https://trello.com/tour
https://trello.com/b/nC8QJJoZ/trello-development

33
Do you have an int main function?
I assume you're linking sfml-main, right?
I was just trying to build SFML, no project on my own at all.

[/quote]
Google can be quite useful: http://stackoverflow.com/questions/17959385/using-argc-and-argv-in-mingw
I searched the forum; didn't realize it was MinGW related.

34
General / Building Error With Latest Source and -std=c++11 Flag
« on: May 23, 2014, 07:34:20 am »
Hello all, I tried building the latest source with the G++ flag "-std=c++11", but it gives a compile error in src/SFML/Main/MainWin32.cpp. The error comes from:

extern int main(int argc, char* argv[]);

////////////////////////////////////////////////////////////
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT)
{
    return main(__argc, __argv);//Undefined reference to both of these variables.
}
 

It got me thinking... how did it compile without the C++11 flag in the first place? I tried searching the source, but couldn't find any definition of "__argc" or "__argv". Is it perhaps a WinAPI shadowing issue?

35
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: March 14, 2014, 05:05:43 am »
Looking through the framework more now... I recognize you from the GMC! Welcome to SFML :P

36
Is this issue fixed? If so, has the fix been added to the official SFML repository? I'm getting this error when calling loadFromSamples(), but my current version of SFML is a couple months old.

37
Window / Re: Control RenderWindow from another function.
« on: March 22, 2013, 09:43:03 pm »
I know it may seem harsh, but you should really spend a bit of time reading through this: http://www.cplusplus.com/doc/tutorial/

If you don't grasp basic C++, it is not recommended to try SFML yet.

Specifically, look at references and pointers; both are valid ways to pass the window around. (References being the more "C++" approach and pointers being the more "C" approach.)

38
Network / Re: UDP | Make client receive response from server
« on: February 06, 2013, 04:37:48 am »
Look up UDP hole-punching. Essentially, the client must send the server a UDP packet temporarily opening the port. However, the port can (and most likely will) change by the time the server receives it. So make note of the port when the server receives the data, then send the data back through that port. If the client doesn't receive a reply in a short period of time, the "punched" port will close, and the server wil never get its UDP messages through.

39
Graphics / Re: Issue with vector of sprites
« on: January 31, 2013, 03:42:28 am »
@xDarkShadowKnightx, I've had bad luck trying to work with textures as pointers though (as sprites can't accept a pointer to a texture in their setTexture method usually), so I'm not sure if I'll be able to get that to work.

Why not just dereference the pointer first? Like:
Sprite.setTexture(*texturePointer);

Also, if you use std::unique_ptr<sf::Texture> and std::unique_ptr<sf::Sprite> then you won't have to write the destructor and won't need to worry about memory leaks. :)

40
Graphics / Re: Texture getMaximumSize() Return Value
« on: January 30, 2013, 08:06:22 am »
I figured so, thanks!

41
Graphics / Texture getMaximumSize() Return Value
« on: January 30, 2013, 03:49:49 am »
Hello folks, quick question. The value that sf::Texture::getMaximumSize() returns is maximum total pixels, or maximum pixels per dimension?

Thanks!

42
Network / Re: Download File Http
« on: January 26, 2013, 02:21:56 am »
Thank you so much! The problem was on my code.
Your code solve the error!

No problem, glad I could help!

43
Network / Re: Download File Http
« on: January 23, 2013, 02:12:11 am »
I haven't tested your code, but I use this (it was originally from somebody else on this forum actually, I just adapted it. Not trying to steal any credit here:P):
void DownloadFile(const std::string& Host, const std::string& RemoteFile, const std::string& LocalFile, unsigned short Port = 0)
{
        sf::Http Http;
        sf::Http::Request Request;
        unsigned int FileSize = 0;
       
        Http.setHost(Host,Port);
        Request.setMethod(sf::Http::Request::Get);
        Request.setUri(RemoteFile);
       
        sf::Http::Response Page = Http.sendRequest(Request);//Get the data
       
        FileSize = Page.getBody().size();//Get the size that was returned
       
        std::string FileContainer = Page.getBody();
        std::ofstream File(LocalFile.c_str(), std::ios::out | std::ios::binary);
        File.write(FileContainer.c_str(), FileSize);//Write the file
        File.close();
}
 

As you can see my function saves the file to the local drive, however you can modify it to return the string rather than writing the string to the file.

44
Audio / Re: "SoundBuffer* s = new SoundBuffer;" freezes the application
« on: January 12, 2013, 05:58:57 am »
I do sort of what eXpl0it3r says. For example, I have and init(), spriteManager(), and cleanup() functions. In main it looks like:

int main()
{
     if (!init()) {error and stuff}
     spriteManager.loadFromFile("...");
     ...
     cleanup();
}

Then globally I have:
namespace
{
     cSpriteManager* SpriteManager = nullptr;
}

bool init()
{
     if (SpriteManager == nullptr) SpriteManager = new cSpriteManager;
     return cSpriteManager != nullptr;
}

cSpriteManager& spriteManager() {return *cSpriteManager;}

void cleanup() {if (SpriteManager != nullptr) delete SpriteManager;}
 

There are probably better ways of doing this, but it works if you still want the global-ish syntax.

45
Audio / Re: "SoundBuffer* s = new SoundBuffer;" freezes the application
« on: January 11, 2013, 10:12:05 pm »
That's odd, I didn't get a crash by throwing this in main():
sf::SoundBuffer* s = new sf::SoundBuffer;

Some people around here REALLY hate that you used "new" by the way, so maybe consider a unique/shared pointer?

At Laurent: Why can't we load resources on the heap? I've written "managers" that allocate things with new all the time and it seems to work. They are pretty simple, and they use a vector. Something like:
std::vector<sf::Whatever*> m_Whatevers;

Are sf::SoundBuffers an exception to this?

Edit: Nevermind. I'm dumb; he initialized on the global scope, not just the heap. The audio system probably doesn't exist at the time he calls "new". Disregard all the above junk.

Pages: 1 2 [3] 4 5
anything