Fixed Window::isMaximized.

http_request without parameters now prints --help.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-10-18 18:07:15 -03:00
parent bb30c62fab
commit 0322d13206
3 changed files with 8 additions and 19 deletions

View File

@@ -532,6 +532,10 @@ void WindowSDL::maximize() {
SDL_MaximizeWindow( mSDLWindow );
}
bool WindowSDL::isMaximized() {
return SDL_GetWindowFlags( mSDLWindow ) & SDL_WINDOW_MAXIMIZED;
}
void WindowSDL::hide() {
SDL_HideWindow( mSDLWindow );
}

View File

@@ -45,6 +45,8 @@ class EE_API WindowSDL : public Window {
virtual void maximize();
virtual bool isMaximized();
virtual void hide();
virtual void raise();

View File

@@ -53,25 +53,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) {
Http::Request request;
if ( !url ) {
// We'll work on en.wikipedia.org
if ( SSLSocket::isSupported() ) {
http.setHost("https://en.wikipedia.org");
} else {
http.setHost("http://en.wikipedia.org");
}
// Creates an async http request and set the path requested
Http::Request asyncRequest( "/wiki/" + Version::getCodename() );
http.sendAsyncRequest([]( const Http& http, Http::Request& request, Http::Response& response ) {
std::cout << "Got response from request: " << http.getHostName() << request.getUri() << std::endl;
if ( response.getStatus() == Http::Response::Ok ) {
std::cout << response.getBody() << std::endl;
} else {
std::cout << "Error " << response.getStatus() << std::endl;
}
}, asyncRequest, Seconds( 5 ) );
std::cout << parser;
return EXIT_SUCCESS;
} else {
// If the user provided the URL, creates an instance of URI to parse it.
URI uri( url.Get() );