src/video/windowsrt/SDL_WinRTApp.h
author David Ludwig <dludwig@pobox.com>
Sun, 28 Oct 2012 20:47:33 -0400
changeset 8332 ea83d191cc17
parent 8331 737dc8a4f49f
child 8333 49973bfb8d23
permissions -rw-r--r--
WinRT: added mouse button event support
dludwig@8322
     1
#pragma once
dludwig@8322
     2
dludwig@8322
     3
#include "SDLmain_WinRT_common.h"
dludwig@8322
     4
#include "CubeRenderer.h"
dludwig@8329
     5
#include <vector>
dludwig@8329
     6
dludwig@8329
     7
using namespace Windows::UI::Core;
dludwig@8322
     8
dludwig@8322
     9
ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
dludwig@8322
    10
{
dludwig@8322
    11
public:
dludwig@8322
    12
	SDL_WinRTApp();
dludwig@8322
    13
	
dludwig@8322
    14
	// IFrameworkView Methods.
dludwig@8322
    15
	virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
dludwig@8322
    16
	virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
dludwig@8322
    17
	virtual void Load(Platform::String^ entryPoint);
dludwig@8322
    18
	virtual void Run();
dludwig@8322
    19
	virtual void Uninitialize();
dludwig@8322
    20
dludwig@8329
    21
internal:
dludwig@8329
    22
    // SDL-specific methods
dludwig@8329
    23
    SDL_DisplayMode GetMainDisplayMode();
dludwig@8331
    24
    void PumpEvents();
dludwig@8329
    25
dludwig@8322
    26
protected:
dludwig@8322
    27
	// Event Handlers.
dludwig@8322
    28
	void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
dludwig@8322
    29
	void OnLogicalDpiChanged(Platform::Object^ sender);
dludwig@8322
    30
	void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
dludwig@8322
    31
	void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
dludwig@8322
    32
	void OnResuming(Platform::Object^ sender, Platform::Object^ args);
dludwig@8322
    33
	void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
dludwig@8322
    34
	void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
dludwig@8322
    35
	void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
dludwig@8332
    36
	void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
dludwig@8322
    37
	void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
dludwig@8322
    38
dludwig@8322
    39
private:
dludwig@8322
    40
	CubeRenderer^ m_renderer;
dludwig@8322
    41
	bool m_windowClosed;
dludwig@8322
    42
	bool m_windowVisible;
dludwig@8322
    43
};
dludwig@8322
    44
dludwig@8322
    45
ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
dludwig@8322
    46
{
dludwig@8322
    47
public:
dludwig@8322
    48
	virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
dludwig@8322
    49
};