#pragma once #include "boost/shared_ptr.hpp" #include "boost/scoped_ptr.hpp" #include "boost/thread.hpp" #include "v8datamodel/game.h" #include "Util/KeyCode.h" #include "G3D/Vector2.h" #include "rbx/signal.h" namespace RBX { class DataModel; class ViewBase; class FunctionMarshaller; class UserInputService; namespace Tasks { class Sequence; } namespace Reflection { class PropertyDescriptor; } } class RobloxView { boost::shared_ptr view; boost::shared_ptr game; boost::scoped_ptr leaveGameVerb; RBX::FunctionMarshaller* marshaller; rbx::signals::scoped_connection placeIDChangeConnection; boost::shared_ptr sequence; class RenderJob; boost::shared_ptr renderJob; static boost::shared_ptr rbxView; void doTeleport(std::string url, std::string ticket, std::string script); void onPlaceIDChanged(const RBX::Reflection::PropertyDescriptor* desc); public: RobloxView(void* wnd, unsigned int width, unsigned int height); ~RobloxView(void); // request rendering stop as the app goes to background void requestStopRenderingForBackgroundMode(); void requestResumeRendering(); void newGameDidStart(); void setBounds(unsigned int width, unsigned int height); static RobloxView *create_view(shared_ptr game, void* wnd, unsigned int width, unsigned int height); boost::shared_ptr getDataModel() { return game->getDataModel(); } boost::shared_ptr getGame() { return game; } boost::shared_ptr getView() { return view; } private: unsigned int width; unsigned int height; void defineConcurrencyRules(); static void bindWorkspace(boost::shared_ptr view, boost::shared_ptr const dataModel); void completeViewPrep(shared_ptr game); };