Skip to content

Commit 6a07702

Browse files
PerkseyHurricanKai
andauthored
[2.0] Silk.NET on Android (#341)
* Progress commit, by no means done or ready * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * Push latest progress on iOS and Android * Update most NuGet packages * Push latest progress on iOS * Push latest progress on Android * Introduce PInvokeOverride * Add ZeroStart * Zero start of alloced memory * Don't inline zeroing * Remove Debug statement * Less debug more functioning * Cast count to int * Stop forwarding SilkMarshal to Marshal, as this is inconsistent * Add Allocate/FreeStringPtr use new methods in SilkTouch * See previous * Push GLSL ES shaders * Rename Allocate/FreeString and fix a bug * A workingish prototype of Silk on Android * This is Silk.NET on Android * Update src/Lab/Triangle/Triangle.csproj Co-authored-by: Kai Jellinghaus <kai.jellinghaus1@gmail.com> * Update src/Input/Silk.NET.Input.Common/Interfaces/IKeyboard.cs * Update src/Input/Silk.NET.Input.Common/Interfaces/IKeyboard.cs Co-authored-by: Kai Jellinghaus <contact@kaij.tech> Co-authored-by: Kai Jellinghaus <kai.jellinghaus1@gmail.com>
1 parent 76141d6 commit 6a07702

File tree

132 files changed

+25161
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+25161
-312
lines changed

.gitignore

+141
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,144 @@ ASALocalRun/
329329

330330
# MFractors (Xamarin productivity tool) working folder
331331
.mfractor/
332+
333+
334+
# Created by https://www.toptal.com/developers/gitignore/api/android,java,gradle
335+
# Edit at https://www.toptal.com/developers/gitignore?templates=android,java,gradle
336+
337+
### Android ###
338+
# Built application files
339+
*.apk
340+
*.aar
341+
*.ap_
342+
*.aab
343+
344+
# Files for the ART/Dalvik VM
345+
*.dex
346+
347+
# Java class files
348+
*.class
349+
350+
# Generated files
351+
bin/
352+
gen/
353+
out/
354+
# Uncomment the following line in case you need and you don't have the release build type files in your app
355+
# release/
356+
357+
# Gradle files
358+
.gradle/
359+
build/
360+
361+
# Local configuration file (sdk path, etc)
362+
local.properties
363+
364+
# Proguard folder generated by Eclipse
365+
proguard/
366+
367+
# Log Files
368+
*.log
369+
370+
# Android Studio Navigation editor temp files
371+
.navigation/
372+
373+
# Android Studio captures folder
374+
captures/
375+
376+
# IntelliJ
377+
*.iml
378+
.idea/workspace.xml
379+
.idea/tasks.xml
380+
.idea/gradle.xml
381+
.idea/assetWizardSettings.xml
382+
.idea/dictionaries
383+
.idea/libraries
384+
# Android Studio 3 in .gitignore file.
385+
.idea/caches
386+
.idea/modules.xml
387+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
388+
.idea/navEditor.xml
389+
390+
# Keystore files
391+
# Uncomment the following lines if you do not want to check your keystore files in.
392+
#*.jks
393+
#*.keystore
394+
395+
# External native build folder generated in Android Studio 2.2 and later
396+
.externalNativeBuild
397+
.cxx/
398+
399+
# Google Services (e.g. APIs or Firebase)
400+
# google-services.json
401+
402+
# Freeline
403+
freeline.py
404+
freeline/
405+
freeline_project_description.json
406+
407+
# fastlane
408+
fastlane/report.xml
409+
fastlane/Preview.html
410+
fastlane/screenshots
411+
fastlane/test_output
412+
fastlane/readme.md
413+
414+
# Version control
415+
vcs.xml
416+
417+
# lint
418+
lint/intermediates/
419+
lint/generated/
420+
lint/outputs/
421+
lint/tmp/
422+
# lint/reports/
423+
424+
### Android Patch ###
425+
gen-external-apklibs
426+
output.json
427+
428+
# Replacement of .externalNativeBuild directories introduced
429+
# with Android Studio 3.5.
430+
431+
### Java ###
432+
# Compiled class file
433+
434+
# Log file
435+
436+
# BlueJ files
437+
*.ctxt
438+
439+
# Mobile Tools for Java (J2ME)
440+
.mtj.tmp/
441+
442+
# Package Files #
443+
*.jar
444+
*.war
445+
*.nar
446+
*.ear
447+
*.zip
448+
*.tar.gz
449+
*.rar
450+
451+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
452+
hs_err_pid*
453+
454+
### Gradle ###
455+
.gradle
456+
457+
# Ignore Gradle GUI config
458+
gradle-app.setting
459+
460+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
461+
!gradle-wrapper.jar
462+
463+
# Cache of project
464+
.gradletasknamecache
465+
466+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
467+
# gradle/wrapper/gradle-wrapper.properties
468+
469+
### Gradle Patch ###
470+
**/build/
471+
472+
# End of https://www.toptal.com/developers/gitignore/api/android,java,gradle

Silk.NET.sln

+237-161
Large diffs are not rendered by default.

examples/CSharp/Tutorial 1.4 - Textures/Tutorial 1.4 - Textures.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 1.5 - Transformations/Tutorial 1.5 - Transformations.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 2.1 - Co-ordinate Systems/Tutorial 2.1 - Co-ordinate Systems.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 2.2 - Camera/Tutorial 2.2 - Camera.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 3.1 - Ambient Lighting/Tutorial 3.1 - Ambient Lighting.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 3.2 - Diffuse Lighting/Tutorial 3.2 - Diffuse Lighting.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 3.3 - Specular Lighting/Tutorial 3.3 - Specular Lighting.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 3.4 - Materials/Tutorial 3.4 - Materials.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

examples/CSharp/Tutorial 3.5 - Lighting Maps/Tutorial 3.5 - Lighting Maps.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-rc0003" />
11+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/Core/Silk.NET.BuildTools/Silk.NET.BuildTools.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="ClangSharp" Version="10.0.0-beta" />
16-
<PackageReference Include="CommandLineParser" Version="2.7.82" />
17-
<PackageReference Include="HtmlAgilityPack" Version="1.11.18" />
18-
<PackageReference Include="Humanizer.Core" Version="2.7.9" />
19-
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.4.0" />
21-
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.6" />
16+
<PackageReference Include="CommandLineParser" Version="2.8.0" />
17+
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
18+
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
19+
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
20+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0-3.final" />
21+
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.8" />
2222
<PackageReference Include="morelinq" Version="3.3.2" />
2323
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
2424
</ItemGroup>

src/Core/Silk.NET.Core/Loader/LibraryLoader.cs

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Runtime.InteropServices;
1111
#endif
1212
using System;
13+
using System.Diagnostics;
1314
using System.IO;
1415

1516
namespace Silk.NET.Core.Loader
@@ -250,6 +251,8 @@ public IntPtr LoadFunctionPointer(IntPtr handle, string functionName)
250251
ThrowSymbolLoading(functionName);
251252
return default;
252253
}
254+
255+
Debug.WriteLine("Silk.NET loaded: " + functionName);
253256

254257
return ret;
255258
}

src/Core/Silk.NET.Core/Native/FuncPtr.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public FuncPtr(Delegate @delegate)
8282
{
8383
var handle = GCHandle.Alloc(@delegate);
8484
Value = Marshal.GetFunctionPointerForDelegate(@delegate);
85-
FuncPtrInternal.Storage.Add(Value, new FuncPtrInternal {Delegate = @delegate, Handle = handle});
85+
FuncPtrInternal.Storage[Value] = new FuncPtrInternal {Delegate = @delegate, Handle = handle};
8686
}
8787

8888
/// <summary>

0 commit comments

Comments
 (0)