mirror of https://github.com/axmolengine/axmol.git
remove PhoneDirect3DXamlAppComponent namesapce refactor
This commit is contained in:
parent
3d16bbc6b9
commit
1112cad792
|
@ -27,8 +27,8 @@ THE SOFTWARE.
|
|||
#define __INPUT_EVENT_TYPES__
|
||||
|
||||
|
||||
namespace PhoneDirect3DXamlAppComponent
|
||||
{
|
||||
NS_CC_BEGIN
|
||||
|
||||
|
||||
public enum class Cocos2dEvent
|
||||
{
|
||||
|
@ -46,7 +46,8 @@ public enum class Cocos2dKeyEvent : int
|
|||
Enter
|
||||
};
|
||||
|
||||
}
|
||||
NS_CC_END
|
||||
|
||||
|
||||
#endif // #ifndef __INPUT_EVENT_TYPES__
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ using namespace DirectX;
|
|||
using namespace Microsoft::WRL;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::UI::Core;
|
||||
using namespace PhoneDirect3DXamlAppComponent;
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
|
@ -151,7 +150,7 @@ void Cocos2dRenderer::OnCocos2dKeyEvent(Cocos2dKeyEvent event)
|
|||
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate)
|
||||
void Cocos2dRenderer::SetXamlEventDelegate(Cocos2dEventDelegate^ delegate)
|
||||
{
|
||||
m_delegate = delegate;
|
||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
||||
|
@ -161,7 +160,7 @@ void Cocos2dRenderer::SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2
|
|||
}
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate)
|
||||
void Cocos2dRenderer::SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate)
|
||||
{
|
||||
m_messageBoxDelegate = delegate;
|
||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
||||
|
@ -171,7 +170,7 @@ void Cocos2dRenderer::SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::C
|
|||
}
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate)
|
||||
void Cocos2dRenderer::SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate)
|
||||
{
|
||||
m_editBoxDelegate = delegate;
|
||||
GLViewImpl* eglView = GLViewImpl::sharedOpenGLView();
|
||||
|
@ -181,7 +180,7 @@ void Cocos2dRenderer::SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Coco
|
|||
}
|
||||
}
|
||||
|
||||
void Cocos2dRenderer::SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate)
|
||||
void Cocos2dRenderer::SetXamlOpenURLDelegate(Cocos2dOpenURLDelegate^ delegate)
|
||||
{
|
||||
m_openURLDelegate = delegate;
|
||||
Application* app = Application::getInstance();
|
||||
|
|
|
@ -41,11 +41,11 @@ public:
|
|||
|
||||
void OnBackButton();
|
||||
void OnKeyPressed(Platform::String^ text);
|
||||
void OnCocos2dKeyEvent(PhoneDirect3DXamlAppComponent::Cocos2dKeyEvent event);
|
||||
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate);
|
||||
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate);
|
||||
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate);
|
||||
void SetXamlOpenURLDelegate(PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ delegate);
|
||||
void OnCocos2dKeyEvent(cocos2d::Cocos2dKeyEvent event);
|
||||
void SetXamlEventDelegate(cocos2d::Cocos2dEventDelegate^ delegate);
|
||||
void SetXamlMessageBoxDelegate(cocos2d::Cocos2dMessageBoxDelegate^ delegate);
|
||||
void SetXamlEditBoxDelegate(cocos2d::Cocos2dEditBoxDelegate^ delegate);
|
||||
void SetXamlOpenURLDelegate(cocos2d::Cocos2dOpenURLDelegate^ delegate);
|
||||
|
||||
Windows::Foundation::IAsyncAction^ OnSuspending();
|
||||
void Connect();
|
||||
|
@ -59,10 +59,10 @@ private:
|
|||
bool m_loadingComplete;
|
||||
bool mInitialized;
|
||||
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||
cocos2d::Cocos2dEventDelegate^ m_delegate;
|
||||
cocos2d::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
cocos2d::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
cocos2d::Cocos2dOpenURLDelegate^ m_openURLDelegate;
|
||||
|
||||
// The AppDelegate for the Cocos2D app
|
||||
AppDelegate* mApp;
|
||||
|
|
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||
#include "Direct3DContentProvider.h"
|
||||
#include "Direct3DInterop.h"
|
||||
|
||||
using namespace PhoneDirect3DXamlAppComponent;
|
||||
using namespace cocos2d;
|
||||
|
||||
Direct3DContentProvider::Direct3DContentProvider(Direct3DInterop^ controller) :
|
||||
m_controller(controller)
|
||||
|
|
|
@ -37,7 +37,7 @@ class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass<
|
|||
IDrawingSurfaceBackgroundContentProviderNative>
|
||||
{
|
||||
public:
|
||||
Direct3DContentProvider(PhoneDirect3DXamlAppComponent::Direct3DInterop^ controller);
|
||||
Direct3DContentProvider(cocos2d::Direct3DInterop^ controller);
|
||||
|
||||
// IDrawingSurfaceContentProviderNative
|
||||
HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host, _In_ ID3D11Device1* device);
|
||||
|
@ -47,6 +47,6 @@ public:
|
|||
HRESULT STDMETHODCALLTYPE Draw(_In_ ID3D11Device1* device, _In_ ID3D11DeviceContext1* context, _In_ ID3D11RenderTargetView* renderTargetView);
|
||||
|
||||
private:
|
||||
PhoneDirect3DXamlAppComponent::Direct3DInterop^ m_controller;
|
||||
cocos2d::Direct3DInterop^ m_controller;
|
||||
Microsoft::WRL::ComPtr<IDrawingSurfaceRuntimeHostNative> m_host;
|
||||
};
|
||||
|
|
|
@ -35,9 +35,8 @@ using namespace Windows::Phone::Graphics::Interop;
|
|||
using namespace Windows::Phone::Input::Interop;
|
||||
using namespace Windows::Graphics::Display;
|
||||
using namespace DirectX;
|
||||
using namespace PhoneDirect3DXamlAppComponent;
|
||||
|
||||
namespace PhoneDirect3DXamlAppComponent
|
||||
namespace cocos2d
|
||||
{
|
||||
|
||||
Direct3DInterop::Direct3DInterop(Windows::Graphics::Display::DisplayOrientations orientation)
|
||||
|
|
|
@ -34,7 +34,7 @@ THE SOFTWARE.
|
|||
#include <DrawingSurfaceNative.h>
|
||||
|
||||
|
||||
namespace PhoneDirect3DXamlAppComponent
|
||||
namespace cocos2d
|
||||
{
|
||||
|
||||
public delegate void RequestAdditionalFrameHandler();
|
||||
|
|
|
@ -26,9 +26,9 @@ THE SOFTWARE.
|
|||
|
||||
using namespace Platform;
|
||||
|
||||
namespace PhoneDirect3DXamlAppComponent
|
||||
namespace cocos2d
|
||||
{
|
||||
EditBoxEvent::EditBoxEvent( Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
|
||||
EditBoxEvent::EditBoxEvent( Platform::Object^ sender, Platform::String^ arg, Windows::Foundation::EventHandler<Platform::String^>^ handle ):
|
||||
m_sender(sender),
|
||||
m_args(arg),
|
||||
m_handler(handle)
|
||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
|||
#include <agile.h>
|
||||
|
||||
|
||||
namespace PhoneDirect3DXamlAppComponent
|
||||
namespace cocos2d
|
||||
{
|
||||
class EditBoxEvent : public cocos2d::InputEvent
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Application
|
||||
x:Class="PhoneDirect3DXamlAppInterop.App"
|
||||
x:Class="cocos2d.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
|
@ -7,7 +7,7 @@
|
|||
|
||||
<!--Application Resources-->
|
||||
<Application.Resources>
|
||||
<local:LocalizedStrings xmlns:local="clr-namespace:PhoneDirect3DXamlAppInterop" x:Key="LocalizedStrings"/>
|
||||
<local:LocalizedStrings xmlns:local="clr-namespace:cocos2d" x:Key="LocalizedStrings"/>
|
||||
</Application.Resources>
|
||||
|
||||
<Application.ApplicationLifetimeObjects>
|
||||
|
|
|
@ -7,9 +7,8 @@ using System.Windows.Navigation;
|
|||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using System.IO.IsolatedStorage;
|
||||
using PhoneDirect3DXamlAppInterop.Resources;
|
||||
|
||||
namespace PhoneDirect3DXamlAppInterop
|
||||
namespace cocos2d
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<UserControl x:Class="PhoneDirect3DXamlAppInterop.EditBox"
|
||||
<UserControl x:Class="cocos2d.EditBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
|
|
|
@ -31,11 +31,10 @@ using System.Windows.Controls;
|
|||
using System.Windows.Navigation;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using PhoneDirect3DXamlAppComponent;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace PhoneDirect3DXamlAppInterop
|
||||
namespace cocos2d
|
||||
{
|
||||
public partial class EditBox : UserControl
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<phone:PhoneApplicationPage
|
||||
x:Class="PhoneDirect3DXamlAppInterop.MainPage"
|
||||
x:Class="cocos2d.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
|
|
|
@ -16,7 +16,6 @@ using System.Windows.Media;
|
|||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Shapes;
|
||||
using Microsoft.Phone.Controls;
|
||||
using PhoneDirect3DXamlAppComponent;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -27,7 +26,7 @@ using Microsoft.Phone.Info;
|
|||
using Windows.Graphics.Display;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
namespace PhoneDirect3DXamlAppInterop
|
||||
namespace cocos2d
|
||||
{
|
||||
public partial class MainPage : PhoneApplicationPage
|
||||
{
|
||||
|
@ -141,13 +140,15 @@ namespace PhoneDirect3DXamlAppInterop
|
|||
|
||||
public void OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
|
||||
m_textBox.Text = "";
|
||||
}
|
||||
|
||||
public void OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
|
||||
if (m_textBox.Text.Length > 0)
|
||||
{
|
||||
m_d3dInterop.OnCocos2dKeyEvent(Cocos2dKeyEvent.Text, m_textBox.Text);
|
||||
m_textBox.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Called by the Cocos2d-x C++ engine to display a MessageBox
|
||||
|
@ -181,7 +182,6 @@ namespace PhoneDirect3DXamlAppInterop
|
|||
m_textBox.TextChanged += OnTextChanged;
|
||||
DrawingSurfaceBackground.Children.Add(m_textBox);
|
||||
}
|
||||
m_textBox.Text = text;
|
||||
m_textBox.SelectionLength = 0;
|
||||
m_textBox.SelectionStart = int.MaxValue;
|
||||
m_textBox.Focus();
|
||||
|
|
|
@ -49,7 +49,6 @@ using namespace Windows::ApplicationModel::Activation;
|
|||
using namespace Windows::Phone::UI::Core;
|
||||
using namespace Platform;
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace PhoneDirect3DXamlAppComponent;
|
||||
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
|
|
@ -95,9 +95,9 @@ public:
|
|||
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void GLViewImpl::QueueEvent(std::shared_ptr<InputEvent>& event);
|
||||
|
||||
void SetXamlEventDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
|
||||
void SetXamlMessageBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
|
||||
void SetXamlEditBoxDelegate(PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
|
||||
void SetXamlEventDelegate(Cocos2dEventDelegate^ delegate) { m_delegate = delegate; };
|
||||
void SetXamlMessageBoxDelegate(Cocos2dMessageBoxDelegate^ delegate) { m_messageBoxDelegate = delegate; };
|
||||
void SetXamlEditBoxDelegate(Cocos2dEditBoxDelegate^ delegate) { m_editBoxDelegate = delegate; };
|
||||
|
||||
bool ShowMessageBox(Platform::String^ title, Platform::String^ message);
|
||||
bool OpenXamlEditBox(Platform::String^ strPlaceHolder, Platform::String^ strText, int maxLength, int inputMode, int inputFlag, Windows::Foundation::EventHandler<Platform::String^>^ receiveHandler);
|
||||
|
@ -178,9 +178,9 @@ private:
|
|||
EGLDisplay m_eglDisplay;
|
||||
EGLContext m_eglContext;
|
||||
EGLSurface m_eglSurface;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dEventDelegate^ m_delegate;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
PhoneDirect3DXamlAppComponent::Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
Cocos2dEventDelegate^ m_delegate;
|
||||
Cocos2dMessageBoxDelegate^ m_messageBoxDelegate;
|
||||
Cocos2dEditBoxDelegate^ m_editBoxDelegate;
|
||||
|
||||
std::queue<std::shared_ptr<InputEvent>> mInputEvents;
|
||||
std::mutex mMutex;
|
||||
|
|
Loading…
Reference in New Issue