Exemple #1
0
 explicit PaintownInstance(PP_Instance instance, pp::Core * core):
     pp::Instance(instance),
     core(core){
     the_instance = this;
     RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
     RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
 }
Exemple #2
0
	explicit GodotInstance(PP_Instance instance) : pp::Instance(instance) {
		printf("GodotInstance!\n");
		state = STATE_METHOD;
		RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_KEYBOARD | PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_TOUCH);
		sd = NULL;
		package_pending = NULL;
		package_loaded = false;
		godot_instance = this;
	}
void MoonlightInstance::OnConnectionStarted(uint32_t unused) {
    // Tell the front end
    pp::Var response("Connection Established");
    PostMessage(response);

    // Start receiving input events
    RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL);

    // Filtering is suboptimal but it ensures that we can pass keyboard events
    // to the browser when mouse lock is disabled. This is neccessary for Esc
    // to kick the app out of full-screen.
    RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
}
Exemple #4
0
bool NaClApplication::tryCreateContext(const Configuration& configuration) {
    CORRADE_ASSERT(!c, "Platform::NaClApplication::tryCreateContext(): context already created", false);

    viewportSize = configuration.size();

    const std::int32_t attributes[] = {
        PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8,
        PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24,
        PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8,
        PP_GRAPHICS3DATTRIB_SAMPLES, configuration.sampleCount(),
        PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, configuration.sampleCount() > 1 ? 1 : 0,
        PP_GRAPHICS3DATTRIB_WIDTH, configuration.size().x(),
        PP_GRAPHICS3DATTRIB_HEIGHT, configuration.size().y(),
        PP_GRAPHICS3DATTRIB_NONE
    };

    graphics = new pp::Graphics3D(this, attributes);
    if(graphics->is_null()) {
        Error() << "Platform::NaClApplication::tryCreateContext(): cannot create context";
        delete graphics;
        graphics = nullptr;
        return false;
    }
    if(!BindGraphics(*graphics)) {
        Error() << "Platform::NaClApplication::tryCreateContext(): cannot bind graphics";
        delete graphics;
        graphics = nullptr;
        return false;
    }

    fullscreen = new pp::Fullscreen(this);

    glSetCurrentContextPPAPI(graphics->pp_resource());

    /* Enable input handling for mouse and keyboard */
    RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE|PP_INPUTEVENT_CLASS_WHEEL);
    RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);

    c = new Context;
    return true;
}
Exemple #5
0
 void GboxInstance::Hello() {
   RequestInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD | PP_INPUTEVENT_CLASS_MOUSE);
   RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
 }
Exemple #6
0
Fuji::Fuji(PP_Instance instance)
: pp::Instance(instance)
{
	// Request to receive input events.
	RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_KEYBOARD);
}