Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/.idea.Furball.Vixie/.idea/codestream.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/.idea.Furball.Vixie/.idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
31 changes: 31 additions & 0 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Furball.Vixie.Backends.Direct3D11/Direct3D11Backend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Direct3D11Backend : IGraphicsBackend {
private TextureD3D11 _privateWhitePixelTexture;
internal TextureD3D11 GetPrivateWhitePixelTexture() => this._privateWhitePixelTexture;

public override void Initialize(IWindow window, IInputContext inputContext) {
public override void Initialize(IView window, IInputContext inputContext) {
FeatureLevel featureLevel = FeatureLevel.Level_11_0;
DeviceCreationFlags deviceFlags = DeviceCreationFlags.BgraSupport;

Expand Down
2 changes: 1 addition & 1 deletion Furball.Vixie.Backends.OpenGL20/OpenGL20Backend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void CheckErrorInternal(string erorr = "") {
}
}

public override void Initialize(IWindow window, IInputContext inputContext) {
public override void Initialize(IView window, IInputContext inputContext) {
this.gl = window.CreateLegacyOpenGL();

//TODO: Lets just assume they have it for now :^)
Expand Down
4 changes: 2 additions & 2 deletions Furball.Vixie.Backends.OpenGL41/OpenGL41Backend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal void CheckThread() {
if (Thread.CurrentThread != _mainThread)
throw new ThreadStateException("You are calling GL on the wrong thread!");
}
internal IWindow Window;
internal IView Window;
private bool _screenshotQueued;
private Vector2D<int> _Viewport;

Expand All @@ -70,7 +70,7 @@ internal void CheckThread() {
/// <param name="window"></param>
/// <param name="inputContext"></param>
/// <param name="game"></param>
public override void Initialize(IWindow window, IInputContext inputContext) {
public override void Initialize(IView window, IInputContext inputContext) {
this.GetMainThread();

this.gl = window.CreateOpenGL();
Expand Down
12 changes: 6 additions & 6 deletions Furball.Vixie.Backends.OpenGLES/OpenGLESBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ internal void CheckThread() {
if (Thread.CurrentThread != _mainThread)
throw new ThreadStateException("You are calling GL on the wrong thread!");
}
internal IWindow Window;
internal IView Window;
private bool _screenshotQueued;
private readonly bool Is32;

public OpenGLESBackend(bool is32) {
this.Is32 = is32;
}

/// <summary>
/// Used to Initialize the Backend
/// </summary>
/// <param name="window"></param>
/// <param name="inputContext"></param>
/// <param name="game"></param>
public override void Initialize(IWindow window, IInputContext inputContext) {
public override void Initialize(IView window, IInputContext inputContext) {
this.GetMainThread();

this.gl = window.CreateOpenGLES();
Expand All @@ -105,7 +105,7 @@ public override void Initialize(IWindow window, IInputContext inputContext) {
this.gl.Enable(EnableCap.Blend);
this.gl.BlendFunc(GLEnum.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

this.ImGuiController = new ImGuiController(this.gl, window, inputContext);
// this.ImGuiController = new ImGuiController(this.gl, window, inputContext);

BackendInfoSection mainSection = new BackendInfoSection("OpenGL Info");
mainSection.Contents.Add(("OpenGL Version", this.gl.GetStringS(StringName.Version)));
Expand Down Expand Up @@ -274,14 +274,14 @@ public override Texture CreateWhitePixelTexture() {
/// </summary>
/// <param name="deltaTime">Delta Time</param>
public override void ImGuiUpdate(double deltaTime) {
this.ImGuiController.Update((float)deltaTime);
// this.ImGuiController.Update((float)deltaTime);
}
/// <summary>
/// Used to Draw the ImGuiController in charge of rendering ImGui on this backend
/// </summary>
/// <param name="deltaTime">Delta Time</param>
public override void ImGuiDraw(double deltaTime) {
this.ImGuiController.Render();
// this.ImGuiController.Render();
}
/// <summary>
/// Returns the OpenGLES API
Expand Down
2 changes: 1 addition & 1 deletion Furball.Vixie.Backends.Shared/Backends/IGraphicsBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class IGraphicsBackend {
/// </summary>
/// <param name="window"></param>
/// <param name="inputContext"></param>
public abstract void Initialize(IWindow window, IInputContext inputContext);
public abstract void Initialize(IView window, IInputContext inputContext);
/// <summary>
/// Used to Cleanup the Backend
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Furball.Vixie.Backends.Veldrid/VeldridBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class VeldridBackend : IGraphicsBackend {
internal CommandList CommandList;

internal Matrix4x4 ProjectionMatrix;
private IWindow _window;
private IView _window;
private ImGuiController _imgui;

internal ResourceLayout SamplerResourceLayout;
Expand All @@ -41,7 +41,7 @@ public class VeldridBackend : IGraphicsBackend {
public FullScreenQuad FullScreenQuad;
private bool _screenshotQueued;

public override void Initialize(IWindow window, IInputContext inputContext) {
public override void Initialize(IView window, IInputContext inputContext) {
this._window = window;

GraphicsDeviceOptions options = new() {
Expand Down
10 changes: 10 additions & 0 deletions Furball.Vixie.TestApplication.Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0"
package="com.furball.vixie.testapplication">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true">
</application>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<!-- <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>-->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Silk.NET" Version="2.15.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Furball.Vixie.TestApplication\Furball.Vixie.TestApplication.csproj" />
<ProjectReference Include="..\Furball.Vixie\Furball.Vixie.csproj" />
</ItemGroup>
</Project>
22 changes: 22 additions & 0 deletions Furball.Vixie.TestApplication.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Android.App;
using Android.OS;
using Furball.Vixie.Backends.Shared.Backends;
using Silk.NET.Windowing;
using Silk.NET.Windowing.Sdl.Android;

namespace Furball.Vixie.TestApplication.Android
{
[Activity(Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : SilkActivity
{
protected override void OnRun() {
var options = ViewOptions.Default;

options.VSync = false;

GraphicsBackend.PrefferedBackends = Backend.OpenGL41 | Backend.OpenGLES32 | Backend.OpenGLES30;

new TestGame().RunAndroid(options);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0"
package="Furball.Vixie.TestApplication.Android.Furball.Vixie.TestApplication.Android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:allowBackup="true" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme">
</application>
</manifest>
44 changes: 44 additions & 0 deletions Furball.Vixie.TestApplication.Android/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable/
icon.png

layout/
main.xml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "Resource"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the Resource class would expose:

public class Resource {
public class Drawable {
public const int icon = 0x123;
}

public class Layout {
public const int main = 0x456;
}

public class Strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use Resource.Drawable.icon to reference the drawable/icon.png file, or
Resource.Layout.main to reference the layout/main.xml file, or Resource.Strings.first_string
to reference the first string in the dictionary file values/strings.xml.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/app_text"
/>
</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2C3E50</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<string name="app_name">AndroidDemo</string>
<string name="app_text">Hello, Android!</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Configurations>Debug;Release;DebugWithGL</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion>9</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'DebugWithGL' ">
<DebugSymbols Condition=" '$(DebugSymbols)' == '' ">true</DebugSymbols>
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Furball.Vixie.TestApplication\Furball.Vixie.TestApplication.csproj" />
<ProjectReference Include="..\Furball.Vixie\Furball.Vixie.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Silk.NET.Input" Version="2.15.0" />
<PackageReference Include="Silk.NET.Input.Extensions" Version="2.15.0" />
<PackageReference Include="Silk.NET.Windowing" Version="2.15.0" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions Furball.Vixie.TestApplication.Desktop.Framework/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Furball.Vixie;
using Furball.Vixie.Backends.Shared.Backends;
using Furball.Vixie.Backends.Veldrid;
using Furball.Vixie.TestApplication;
using Silk.NET.Windowing;

var options = WindowOptions.Default;

options.VSync = false;

GraphicsBackend.PrefferedBackends = Backend.OpenGL41 | Backend.OpenGLES32;

VeldridBackend.PrefferedBackend = Veldrid.GraphicsBackend.Vulkan;

new TestGame().Run(options);
Loading