Skip to content

Commit

Permalink
Pre-Alpha Release
Browse files Browse the repository at this point in the history
  • Loading branch information
SonryP committed Jan 21, 2017
1 parent 217e39a commit 48cfa11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
26 changes: 1 addition & 25 deletions VitaView/GLView1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace VitaView {
class GLView1 : AndroidGameView {
static string ip = "0";
System.Net.Sockets.UdpClient clientSocket;
System.Net.Sockets.UdpClient clientSocket = new System.Net.Sockets.UdpClient();
IPEndPoint ep;
public GLView1(Context context) : base(context) {
}
Expand All @@ -29,13 +29,10 @@ protected override void OnLoad(EventArgs e) {
GL.Enable(All.Texture2D);
GL.GenTextures(1, textureIds);
try {
clientSocket = new System.Net.Sockets.UdpClient();
clientSocket.Connect(ep);
}
catch(Exception ex) {
Log.Verbose("Exception: ", "{0}", ex);
Toast.MakeText(this.Context, "No Connection", ToastLength.Long).Show();
Close();
}

}
Expand Down Expand Up @@ -123,27 +120,6 @@ protected override void OnRenderFrame(FrameEventArgs e) {
};

int x = 0;
private async void dataReceive() {
clientSocket.Send(new byte [] { 1, 2, 3, 4, 5 }, 5);
var receivedData = clientSocket.Receive(ref ep);
x++;
while (true) {
await System.Threading.Tasks.Task.Delay(1);

if (x >= 1) {
try {
receivedData = clientSocket.Receive(ref ep);
Bitmap bitmap = BitmapFactory.DecodeByteArray(receivedData, 0, receivedData.Length);
LoadTextureData(Context, bitmap, textureIds [0]);
bitmap.Recycle();
}
catch (Exception ex) {
Log.Verbose("Exception", "{0}", ex);
}
}
}

}

void LoadTextureData(Context context, Bitmap b, int tex_id) {
GL.BindTexture(All.Texture2D, tex_id);
Expand Down
6 changes: 3 additions & 3 deletions VitaView/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="VitaView.VitaView" android:versionCode="1" android:versionName="1.0">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Sonry.VitaView" android:versionCode="1" android:versionName="0.1" android:installLocation="auto">
<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:label="VitaView"></application>
</manifest>
13 changes: 11 additions & 2 deletions VitaView/VitaView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,25 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<BundleAssemblies>False</BundleAssemblies>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<Debugger>Xamarin</Debugger>
<AotAssemblies>False</AotAssemblies>
<EnableLLVM>False</EnableLLVM>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<EnableProguard>False</EnableProguard>
<AndroidSupportedAbis>armeabi;armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit 48cfa11

Please sign in to comment.