Пример #1
0
void Rocket_SetInnerRMLById( const char *name, const char *id, const char *RML, int parseFlags )
{
	Rocket::Core::String newRML = parseFlags  ? Rocket_QuakeToRML( RML, parseFlags ) : RML;

	if ( ( !*name || !*id ) && activeElement )
	{
		Rocket_SetInnerRMLGuarded( activeElement, newRML );
	}

	else
	{
		Rocket::Core::ElementDocument *document = menuContext->GetDocument( name );

		if ( document )
		{
			Rocket::Core::Element *e = document->GetElementById( id );

			if ( e )
			{
				Rocket_SetInnerRMLGuarded( e, newRML );
			}
		}
	}
}
Пример #2
0
GameMenu::GameMenu(WindowFramework* window, Rocket::Core::Context* context) : UiBase(window, context)
{
  Rocket::Core::ElementDocument* doc     = context->LoadDocument("data/main_menu.rml");

  root = doc;
  if (doc)
  {
    doc->Show();

    ToggleEventListener(true, "continue", "click", _continueClicked);
    ToggleEventListener(true, "options",  "click", _optionsClicked);
    ToggleEventListener(true, "exit",     "click", _exitClicked);
    ToggleEventListener(true, "save",     "click", _saveClicked);
    ToggleEventListener(true, "load",     "click", _loadClicked);

    _continueClicked.EventReceived.Connect(*this, &GameMenu::MenuEventContinue);
    _exitClicked.EventReceived.Connect(ExitClicked, &Sync::Signal<void (Rocket::Core::Event&)>::Emit);
    _saveClicked.EventReceived.Connect(SaveClicked, &Sync::Signal<void (Rocket::Core::Event&)>::Emit);
    _loadClicked.EventReceived.Connect(LoadClicked, &Sync::Signal<void (Rocket::Core::Event&)>::Emit);
    _optionsClicked.EventReceived.Connect(OptionsClicked, &Sync::Signal<void (Rocket::Core::Event&)>::Emit);

    Translate();
  }
}
Пример #3
0
bool ElementImage::LoadDiskTexture()
{
	texture_dirty = false;

	// Get the source URL for the image.
	String image_source = GetAttribute< String >("src", "");
	if (image_source.Empty())
		return false;

	geometry_dirty = true;

	Rocket::Core::ElementDocument* document = GetOwnerDocument();
	URL source_url(document == NULL ? "" : document->GetSourceURL());

	if (!texture.Load(image_source, source_url.GetPath()))
	{
		geometry.SetTexture(NULL);
		return false;
	}

	// Set the texture onto our geometry object.
	geometry.SetTexture(&texture);
	return true;
}
void GuiDemo::uninitRocket()
{
	if (m_document) m_document->RemoveReference();
	m_document = 0;

	// Shutdown Rocket.
	if (m_rkContext) m_rkContext->RemoveReference();
	m_rkContext = 0;
	Rocket::Core::Shutdown();

	delete m_rkOgreSystem; m_rkOgreSystem = 0;
	delete m_rkOgreRenderer; m_rkOgreRenderer = 0;
	delete m_rkFileInterface; m_rkFileInterface = 0;

	delete m_rkEventListener; m_rkEventListener = 0;
	delete m_rkRenderListener; m_rkRenderListener = 0;
}
Пример #5
0
// Loads a window and binds the event handler for it.
Rocket::Core::ElementDocument* EventManager::LoadWindow(const Rocket::Core::String& window_name)
{
    // Set the event handler for the new screen, if one has been registered.
    EventHandler* old_event_handler = event_handler;
    EventHandlerMap::iterator iterator = event_handlers.find(window_name);
    if (iterator != event_handlers.end())
    {
        event_handler = iterator->second;
        //Rocket::Core::Log::Message(Rocket::Core::Log::LT_INFO, "%s", window_name.CString());
    }
    else
        event_handler = NULL;

    // Attempt to load the referenced RML document.
    Rocket::Core::String document_path = Rocket::Core::String("data/") + window_name + Rocket::Core::String(".rml");
    Rocket::Core::ElementDocument* document = Context->LoadDocument(document_path.CString());
    if (document == nullptr)
    {
        event_handler = old_event_handler;
        return nullptr;
    }

    document->SetId(window_name);

    // Set the element's title on the title; IDd 'title' in the RML.
    Rocket::Core::Element* title = document->GetElementById("title");
    if (title != NULL)
        title->SetInnerRML(document->GetTitle());

    document->Focus();
    document->Show();

    // Remove the caller's reference.
    document->RemoveReference();

    return document;
}
Пример #6
0
int main(int argc, char **argv)
{
#ifdef ROCKET_PLATFORM_WIN32
        DoAllocConsole();
#endif

        int window_width = 1024;
        int window_height = 768;

	sf::RenderWindow MyWindow(sf::VideoMode(window_width, window_height), "libRocket with SFML");

	RocketSFMLRenderer Renderer;
	RocketSFMLSystemInterface SystemInterface;
	ShellFileInterface FileInterface("../Samples/assets/");

	if(!MyWindow.IsOpened())
		return 1;

	Renderer.SetWindow(&MyWindow);

	Rocket::Core::SetFileInterface(&FileInterface);
	Rocket::Core::SetRenderInterface(&Renderer);
	Rocket::Core::SetSystemInterface(&SystemInterface);

	if(!Rocket::Core::Initialise())
		return 1;

	Rocket::Core::FontDatabase::LoadFontFace("Delicious-Bold.otf");
	Rocket::Core::FontDatabase::LoadFontFace("Delicious-BoldItalic.otf");
	Rocket::Core::FontDatabase::LoadFontFace("Delicious-Italic.otf");
	Rocket::Core::FontDatabase::LoadFontFace("Delicious-Roman.otf");

	Rocket::Core::Context *Context = Rocket::Core::CreateContext("default",
		Rocket::Core::Vector2i(MyWindow.GetWidth(), MyWindow.GetHeight()));

	Rocket::Debugger::Initialise(Context);

	Rocket::Core::ElementDocument *Document = Context->LoadDocument("demo.rml");

	if(Document)
	{
		Document->Show();
		Document->RemoveReference();
	};

	while(MyWindow.IsOpened())
	{
		static sf::Event event;

		MyWindow.Clear();
		Context->Render();
		MyWindow.Display();

		while(MyWindow.GetEvent(event))
		{
			switch(event.Type)
			{
			case sf::Event::Resized:
				Renderer.Resize();
				break;
			case sf::Event::MouseMoved:
				Context->ProcessMouseMove(event.MouseMove.X, event.MouseMove.Y,
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::MouseButtonPressed:
				Context->ProcessMouseButtonDown(event.MouseButton.Button,
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::MouseButtonReleased:
				Context->ProcessMouseButtonUp(event.MouseButton.Button,
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::MouseWheelMoved:
				Context->ProcessMouseWheel(event.MouseWheel.Delta,
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::TextEntered:
				if (event.Text.Unicode > 32)
					Context->ProcessTextInput(event.Text.Unicode);
				break;
			case sf::Event::KeyPressed:
				Context->ProcessKeyDown(SystemInterface.TranslateKey(event.Key.Code),
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::KeyReleased:
				if(event.Key.Code == sf::Key::F8)
				{
					Rocket::Debugger::SetVisible(!Rocket::Debugger::IsVisible());
				};

				Context->ProcessKeyUp(SystemInterface.TranslateKey(event.Key.Code),
					SystemInterface.GetKeyModifiers(&MyWindow));
				break;
			case sf::Event::Closed:
				return 1;
				break;
			};
		};

		Context->Update();
	};

	return 0;
};
Пример #7
0
int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv))
#endif
{
#ifdef ROCKET_PLATFORM_WIN32
	ROCKET_UNUSED(instance_handle);
	ROCKET_UNUSED(previous_instance_handle);
	ROCKET_UNUSED(command_line);
	ROCKET_UNUSED(command_show);
#else
	ROCKET_UNUSED(argc);
	ROCKET_UNUSED(argv);
#endif

#ifdef ROCKET_PLATFORM_LINUX
#define APP_PATH "../Samples/tutorial/datagrid_tree/"
#else
#define APP_PATH "../../Samples/tutorial/datagrid_tree/"
#endif

#ifdef ROCKET_PLATFORM_WIN32
        DoAllocConsole();
#endif

	int window_width = 1024;
	int window_height = 768;

	ShellRenderInterfaceOpenGL opengl_renderer;
	shell_renderer = &opengl_renderer;

	// Generic OS initialisation, creates a window and attaches OpenGL.
	if (!Shell::Initialise(APP_PATH) ||
		!Shell::OpenWindow("Datagrid Tree Tutorial", shell_renderer, window_width, window_height, true))
	{
		Shell::Shutdown();
		return -1;
	}

	// Rocket initialisation.
	Rocket::Core::SetRenderInterface(&opengl_renderer);
	opengl_renderer.SetViewport(window_width, window_height);

	ShellSystemInterface system_interface;
	Rocket::Core::SetSystemInterface(&system_interface);

	Rocket::Core::Initialise();
	Rocket::Controls::Initialise();

	// Create the main Rocket context and set it on the shell's input layer.
	context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(window_width, window_height));
	if (context == NULL)
	{
		Rocket::Core::Shutdown();
		Shell::Shutdown();
		return -1;
	}

	Rocket::Debugger::Initialise(context);
	Input::SetContext(context);
	shell_renderer->SetContext(context);

	Shell::LoadFonts("../../assets/");

	// Load the defender decorator.
	Rocket::Core::DecoratorInstancer* decorator_instancer = Rocket::Core::Factory::RegisterDecoratorInstancer("defender", new DecoratorInstancerDefender());
	if (decorator_instancer != NULL)
		decorator_instancer->RemoveReference();

	// Add the ship formatter.
	HighScoresShipFormatter ship_formatter;

	// Construct the high scores.
	HighScores::Initialise();

	// Load and show the tutorial document.
	Rocket::Core::ElementDocument* document = context->LoadDocument("data/tutorial.rml");
	document->GetElementById("title")->SetInnerRML(document->GetTitle());
	if (document != NULL)
	{
		document->Show();
		document->RemoveReference();
	}

	Shell::EventLoop(GameLoop);

	// Shut down the high scores.
	HighScores::Shutdown();

	// Shutdown Rocket.
	context->RemoveReference();
	Rocket::Core::Shutdown();

	Shell::CloseWindow();
	Shell::Shutdown();

	return 0;
}
Пример #8
0
int main(int ROCKET_UNUSED(argc), char** ROCKET_UNUSED(argv))
#endif
{
    // Generic OS initialisation, creates a window and does not attach OpenGL.
    if (!Shell::Initialise("../Samples/basic/directx/") ||
            !Shell::OpenWindow("DirectX Sample", false))
    {
        Shell::Shutdown();
        return -1;
    }

    // DirectX initialisation.
    if (!InitialiseDirectX())
    {
        Shell::CloseWindow();
        Shell::Shutdown();

        return -1;
    }

    // Install our DirectX render interface into Rocket.
    RenderInterfaceDirectX directx_renderer(g_pD3D, g_pd3dDevice);
    Rocket::Core::SetRenderInterface(&directx_renderer);

    ShellSystemInterface system_interface;
    Rocket::Core::SetSystemInterface(&system_interface);

    Rocket::Core::Initialise();

    // Create the main Rocket context and set it on the shell's input layer.
    context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(1024, 768));
    if (context == NULL)
    {
        Rocket::Core::Shutdown();
        Shell::Shutdown();
        return -1;
    }

    Rocket::Debugger::Initialise(context);
    Input::SetContext(context);

    Shell::LoadFonts("../../assets/");

    // Load and show the tutorial document.
    Rocket::Core::ElementDocument* document = context->LoadDocument("../../assets/demo.rml");
    if (document != NULL)
    {
        document->Show();
        document->RemoveReference();
    }

    Shell::EventLoop(GameLoop);

    // Shutdown Rocket.
    context->RemoveReference();
    Rocket::Core::Shutdown();

    ShutdownDirectX();

    Shell::CloseWindow();
    Shell::Shutdown();

    return 0;
}
Пример #9
0
int main(int ROCKET_UNUSED_PARAMETER(argc), char** ROCKET_UNUSED_PARAMETER(argv))
#endif
{
#ifdef ROCKET_PLATFORM_WIN32
	ROCKET_UNUSED(instance_handle);
	ROCKET_UNUSED(previous_instance_handle);
	ROCKET_UNUSED(command_line);
	ROCKET_UNUSED(command_show);
#else
	ROCKET_UNUSED(argc);
	ROCKET_UNUSED(argv);
#endif

	// Generic OS initialisation, creates a window and attaches OpenGL.
	if (!Shell::Initialise("../Samples/tutorial/template/") ||
		!Shell::OpenWindow("Template Tutorial", true))
	{
		Shell::Shutdown();
		return -1;
	}

	// Rocket initialisation.
	ShellRenderInterfaceOpenGL opengl_renderer;
	Rocket::Core::SetRenderInterface(&opengl_renderer);
    opengl_renderer.SetViewport(1024, 768);

	ShellSystemInterface system_interface;
	Rocket::Core::SetSystemInterface(&system_interface);

	Rocket::Core::Initialise();

	// Create the main Rocket context and set it on the shell's input layer.
	context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(1024, 768));
	if (context == NULL)
	{
		Rocket::Core::Shutdown();
		Shell::Shutdown();
		return -1;
	}

	Rocket::Debugger::Initialise(context);
	Input::SetContext(context);

	Shell::LoadFonts("../../assets/");

	// Load and show the tutorial document.
	Rocket::Core::ElementDocument* document = context->LoadDocument("data/tutorial.rml");
	if (document != NULL)
	{
		document->Show();
		document->RemoveReference();
	}

	Shell::EventLoop(GameLoop);

	// Shutdown Rocket.
	context->RemoveReference();
	Rocket::Core::Shutdown();

	Shell::CloseWindow();
	Shell::Shutdown();

	return 0;
}
Пример #10
0
int main(int ROCKET_UNUSED(argc), char** ROCKET_UNUSED(argv))
#endif
{
	// Generic OS initialisation, creates a window and attaches OpenGL.
	if (!Shell::Initialise("../Samples/basic/customlog/") ||
		!Shell::OpenWindow("Custom File Handler Sample", true))
	{
		Shell::Shutdown();
		return -1;
	}

	// Rocket initialisation.
	ShellRenderInterfaceOpenGL opengl_renderer;
	Rocket::Core::SetRenderInterface(&opengl_renderer);
    opengl_renderer.SetViewport(1024,768);


	// Initialise our system interface to write the log messages to file.
	SystemInterface system_interface;
	Rocket::Core::SetSystemInterface(&system_interface);

	Rocket::Core::Initialise();

	// Create the main Rocket context and set it on the shell's input layer.
	context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(1024, 768));
	if (context == NULL)
	{
		Rocket::Core::Shutdown();
		Shell::Shutdown();
		return -1;
	}

	Rocket::Debugger::Initialise(context);
	Input::SetContext(context);

	Shell::LoadFonts("../../assets/");

	// Load a non-existent document to spawn an error message.
	Rocket::Core::ElementDocument* invalid_document = context->LoadDocument("../../assets/invalid.rml");
	ROCKET_ASSERTMSG(invalid_document != NULL, "Testing ASSERT logging.");
	if (invalid_document != NULL)
	{
		invalid_document->RemoveReference();
		invalid_document->Close();
	}

	// Load and show the demo document.
	Rocket::Core::ElementDocument* document = context->LoadDocument("../../assets/demo.rml");
	if (document != NULL)
	{
		document->Show();
		document->RemoveReference();
	}

	Shell::EventLoop(GameLoop);

	// Shutdown Rocket.
	context->RemoveReference();
	Rocket::Core::Shutdown();

	Shell::CloseWindow();
	Shell::Shutdown();

	return 0;
}
Пример #11
0
 Handle<Value> EDClose(const Arguments& args)
 {
    Rocket::Core::ElementDocument* v = UnwrapElementDocument(args.This());
    v->Close();
    return Undefined();
 }
Пример #12
0
void Rocket_DocumentAction(const char* name, const char* action) {
    if (!Q_stricmp(action, "show") || !Q_stricmp(action, "open")) {
        Rocket::Core::ElementDocument* document = menuContext->GetDocument(name);
        if (document) {
            document->Show();
        }
    } else if (!Q_stricmp("close", action)) {
        if (!*name) // If name is empty, hide active
        {
            if (menuContext->GetFocusElement() &&
                menuContext->GetFocusElement()->GetOwnerDocument()) {
                menuContext->GetFocusElement()->GetOwnerDocument()->Close();
            }

            return;
        }

        Rocket::Core::ElementDocument* document = menuContext->GetDocument(name);
        if (document) {
            document->Close();
        }
    } else if (!Q_stricmp("goto", action)) {
        Rocket::Core::ElementDocument* document = menuContext->GetDocument(name);
        if (document) {
            Rocket::Core::ElementDocument* owner =
                    menuContext->GetFocusElement()->GetOwnerDocument();
            if (owner) {
                owner->Close();
            }
            document->Show();
        }
    } else if (!Q_stricmp("load", action)) {
        Rocket_LoadDocument(name);
    } else if (!Q_stricmp("blur", action) || !Q_stricmp("hide", action)) {
        Rocket::Core::ElementDocument* document = nullptr;

        if (!*name) // If name is empty, hide active
        {
            if (menuContext->GetFocusElement() &&
                menuContext->GetFocusElement()->GetOwnerDocument()) {
                document = menuContext->GetFocusElement()->GetOwnerDocument();
            }
        } else {
            document = menuContext->GetDocument(name);
        }

        if (document) {
            document->Hide();
        }
    } else if (!Q_stricmp("blurall", action)) {
        for (int i = 0; i < menuContext->GetNumDocuments(); ++i) {
            menuContext->GetDocument(i)->Hide();
        }
    } else if (!Q_stricmp("reload", action)) {
        Rocket::Core::ElementDocument* document = nullptr;

        if (!*name) // If name is empty, hide active
        {
            if (menuContext->GetFocusElement() &&
                menuContext->GetFocusElement()->GetOwnerDocument()) {
                document = menuContext->GetFocusElement()->GetOwnerDocument();
            }
        } else {
            document = menuContext->GetDocument(name);
        }

        if (document) {
            Rocket::Core::String url = document->GetSourceURL();
            document->Close();
            document = menuContext->LoadDocument(url);
            document->Show();
        }
    }
}
Пример #13
0
void Rocket_LoadCursor(const char* path) {
    Rocket::Core::ElementDocument* document = menuContext->LoadMouseCursor(path);
    if (document) {
        document->RemoveReference();
    }
}
Пример #14
0
int main(int argc, char *argv[])
{
    Options& options = Options::GetInstance();
    options.LoadFromCommandLine(argc, argv);
	options.LoadFromIniFile("gravity.ini");

    GRAVITY_LOG(info, "Client started.");

    sf::ContextSettings settings;
	settings.depthBits = 0;
	settings.stencilBits = 8;
	settings.antialiasingLevel = options.msaa;
	int style = options.fullscreen ? sf::Style::Fullscreen : sf::Style::Default;

    sf::RenderWindow window(sf::VideoMode(options.hres, options.vres, options.bitdepth), "Gravity", style, settings);
    ::Gravity::Game::Game game;
	
    game.Start();
    
	BoundingCamera camera(Vec2f(400, 300), Vec2f());


    // ROCKET

    RocketRendererInterfaceImpl rendererInterface;
    RocketSystemInterfaceImpl systemInterface;
    RocketShellInterfaceImpl shellInterface("../data/gui/");

    rendererInterface.target =  &window;
    rendererInterface.states = (sf::RenderStates *) &sf::RenderStates::Default;

    Rocket::Core::SetFileInterface(&shellInterface);
    Rocket::Core::SetRenderInterface(&rendererInterface);
    Rocket::Core::SetSystemInterface(&systemInterface);

    if(!Rocket::Core::Initialise())
        return 0;

	Rocket::Controls::Initialise();

    Rocket::Core::FontDatabase::LoadFontFace("Delicious-Bold.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Delicious-BoldItalic.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Delicious-Italic.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Delicious-Roman.otf");
    Rocket::Core::FontDatabase::LoadFontFace("DejaVuSans-Bold.ttf");
    Rocket::Core::FontDatabase::LoadFontFace("DejaVuSans-BoldOblique.ttf");
    Rocket::Core::FontDatabase::LoadFontFace("DejaVuSans-Oblique.ttf");
    Rocket::Core::FontDatabase::LoadFontFace("DejaVuSans.ttf");

    Rocket::Core::Context *Context = Rocket::Core::CreateContext("default",
        Rocket::Core::Vector2i(window.getSize().x, window.getSize().y));
    
    Rocket::Debugger::Initialise(Context);
	//Rocket::Debugger::SetVisible(true);
    
    Rocket::Core::ElementDocument *document = Context->LoadDocument("my.rml");

    if(document)
    {
        document->Show();
        document->RemoveReference();
    };

    // END ROCKET


    //Rocket::Core::ElementDocument* document;

	std::cout << "OpenGL Version" << window.getSettings().ContextSettings::majorVersion << "." << window.getSettings().ContextSettings::minorVersion << std::endl;
    sf::ContextSettings settingz = window.getSettings();
    std::cout << settingz.majorVersion << "." << settingz.minorVersion << std::endl;

    while(window.isOpen()) {
    	sf::Event event;
        Entity* ship = game.GetWorld().GetEntities()[0];

		while (window.pollEvent(event)) {
        //window.PollEvent(event);
			if (event.type == sf::Event::Closed)
				window.close();

			if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))
				return 0;

			if ((event.type == sf::Event::MouseWheelMoved)) {
				options.renderscale += event.mouseWheel.delta*.1f;
			}

			if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Space)) {
                Shape* bombShape = Shape::CreateBombShape();
				Entity* bomb = new Entity(game.GetWorld(), *bombShape, ship->GetPos() + Vec2f(1, 1));
                bomb->SetVel(ship->GetVel());
                bomb->SetMass(0.01f);
                game.GetWorld().AddEntity(*bomb);
                
			}
            
            switch(event.type)
            {
                case sf::Event::Resized:
                    //rendererInterface.Resize();
                    break;
                case sf::Event::MouseMoved:
                    Context->ProcessMouseMove(event.mouseMove.x, event.mouseMove.y,
                                              systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::MouseButtonPressed:
                    Context->ProcessMouseButtonDown(event.mouseButton.button,
                            systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::MouseButtonReleased:
                    Context->ProcessMouseButtonUp(event.mouseButton.button,
                            systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::MouseWheelMoved:
                    Context->ProcessMouseWheel(event.mouseWheel.delta,
                                               systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::TextEntered:
                    if (event.text.unicode > 32)
                        Context->ProcessTextInput(event.text.unicode);
                    break;
                case sf::Event::KeyPressed:
                    Context->ProcessKeyDown(systemInterface.TranslateKey(event.key.code),
                                            systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::KeyReleased:
                    if(event.key.code == sf::Keyboard::F8)
                    {
                        Rocket::Debugger::SetVisible(!Rocket::Debugger::IsVisible());
                    };

                    Context->ProcessKeyUp(systemInterface.TranslateKey(event.key.code),
                                          systemInterface.GetKeyModifiers(&window));
                    break;
                case sf::Event::Closed:
                    return 1;
                    break;
            };
		}       
        
        int rotate = sf::Keyboard::isKeyPressed(sf::Keyboard::Right) - sf::Keyboard::isKeyPressed(sf::Keyboard::Left);
		bool forward = sf::Keyboard::isKeyPressed(sf::Keyboard::Up);



		sf::View nView(Vec2f(options.hres, options.vres), Vec2f(options.hres, options.vres));
		camera.Update(ship->GetPos() * options.renderscale);
		nView.move(camera.GetPos() - Vec2f(options.hres, options.vres));

        ship->Rotate(rotate*2);
		if (forward)
			ship->ApplyForce(Vec2f(0.f, 2.f).Rotate(ship->GetAngle()));

        window.clear();
        window.setView(nView);
        DrawWorld(window, game.GetWorld(), 0.f);

        sf::View viewEmpty = window.getDefaultView();
        window.setView(viewEmpty);
        Context->Update();
        Context->Render();
        window.setFramerateLimit(60);
        window.display();

        
        game.Step();

    }

    game.Stop();
    return 0;
}