-
Notifications
You must be signed in to change notification settings - Fork 12
Prepare code to run in NativeAOT #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kant2002
wants to merge
6
commits into
JamesRandall:main
Choose a base branch
from
kant2002:kant/nativeaot
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
406ade9
Prepare code to run in NativeAOT
kant2002 59ad221
This brings application to 14Mb.
kant2002 47f9961
Update data
kant2002 365e4ee
Merge branch 'main' into kant/nativeaot
kant2002 c5a3abe
Merge branch 'main' into kant/nativeaot
kant2002 8aa5a7b
Remove not needed changes
kant2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <Directives> | ||
| <!-- | ||
| This file is part of RdXmlLibrary project. | ||
| Visit https://github.com/kant2002/rdxmllibrary for latest version. | ||
| If you have modifications specific to this Nuget package, | ||
| please contribute back. | ||
| --> | ||
| <Application> | ||
| <Assembly Name="FSharp.Core"> | ||
| <!-- | ||
| This is less developed version then other RD.xml files. | ||
| Depending on the sprint usages, these commands would have slight variance. | ||
| I think more examples mapped to existing printf commands should be added here. | ||
| --> | ||
| <Type Name="Microsoft.FSharp.Core.PrintfImpl+Specializations`3[[System.IO.TextWriter,System.Private.CoreLib],[Microsoft.FSharp.Core.Unit,FSharp.Core],[Microsoft.FSharp.Core.Unit,FSharp.Core]]" Dynamic="Required All"> | ||
| <!-- Pattern for printfn "%f" 1.0 --> | ||
| <Method Name="CaptureFinal1" Dynamic="Required"> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| </Method> | ||
| <Method Name="OneStepWithArg" Dynamic="Required"> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| </Method> | ||
|
|
||
| <!-- Pattern for printfn "%s %f" "" 3.0 --> | ||
| <Method Name="CaptureFinal2" Dynamic="Required"> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| </Method> | ||
| <Method Name="TwoStepWithArg" Dynamic="Required"> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| </Method> | ||
|
|
||
| <Method Name="CaptureFinal3" Dynamic="Required"> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| </Method> | ||
|
|
||
| <!-- Pattern for printfn "%d %s" 3 "" --> | ||
| <Method Name="CaptureFinal2" Dynamic="Required"> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| </Method> | ||
| <Method Name="TwoStepWithArg" Dynamic="Required"> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.String, System.Private.CoreLib" /> | ||
| </Method> | ||
|
|
||
| <!-- Pattern for printfn "%d" 1 --> | ||
| <Method Name="CaptureFinal1" Dynamic="Required"> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| </Method> | ||
| <Method Name="OneStepWithArg" Dynamic="Required"> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| </Method> | ||
|
|
||
| <!-- Pattern for printfn "%f %d" 3.0 2 --> | ||
| <Method Name="CaptureFinal2" Dynamic="Required"> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| </Method> | ||
| <Method Name="TwoStepWithArg" Dynamic="Required"> | ||
| <GenericArgument Name="System.Double, System.Private.CoreLib" /> | ||
| <GenericArgument Name="System.Int32, System.Private.CoreLib" /> | ||
| </Method> | ||
| </Type> | ||
| </Assembly> | ||
| </Application> | ||
| </Directives> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,6 +267,8 @@ let main _ = | |
| let mutable options = WindowOptions.Default | ||
| options.Size <- Vector2D<int>(int(float screenWidth * zoom),int (float screenHeight * zoom)) | ||
| options.Title <- "F# Wolfenstein" | ||
| Silk.NET.Input.Sdl.SdlInput.RegisterPlatform() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's manual registration of platforms. By default Silk.Net uses dynamic platform registration, and this is not working well with NativeAOT, so registering platforms manually. |
||
| Silk.NET.Input.Glfw.GlfwInput.RegisterPlatform() | ||
| let window = Window.Create(options) | ||
| window.add_Load (load window) | ||
| window.add_Render render | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be not needed once dotnet/Silk.NET#959 lands in Silk.Net and they release new version.