2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-03 11:09:40 -04:00

- Improvements for 2.5 release. Alot more work than I expected.

- Examples are out of date and will need to be regenerated before release.
This commit is contained in:
ChrisDill 2019-04-22 07:40:01 +01:00 committed by Chris Dill
parent 1236e4979a
commit dd9710fc57
35 changed files with 5867 additions and 11824 deletions

View File

@ -1,35 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

956
.gitignore vendored
View File

@ -1,477 +1,479 @@
# User defined
# Created by https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Binaries
![Bb]in/
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.exe
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Bb]in/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Bb]uild/
[Dd]ebug
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.pch
# *.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
#*.pubxml
*.pubxml.user
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
### Git ###
*.orig
### Linux ###
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
# Build results
# Visual Studio 2015 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
# NUNIT
# Build Results of an ATL Project
# .NET Core
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# JustCode is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
#*.pubxml
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target.
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
# Others
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
# SQL Server files
# Business Intelligence projects
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Typescript v1 declaration files
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# JetBrains Rider
# CodeRush
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
# BizTalk build output
### VisualStudio Patch ###
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
# End of https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio
Test
/Examples/core/storage.data
# User defined
# Created by https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
.vscode/
# Binaries
![Bb]in/
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
*.exe
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Bb]in/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Bb]uild/
[Dd]ebug
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.pch
# *.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
#*.pubxml
*.pubxml.user
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
### Git ###
*.orig
### Linux ###
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
# Build results
# Visual Studio 2015 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
# NUNIT
# Build Results of an ATL Project
# .NET Core
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# JustCode is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
#*.pubxml
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target.
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
# Others
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
# SQL Server files
# Business Intelligence projects
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Typescript v1 declaration files
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# JetBrains Rider
# CodeRush
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
# BizTalk build output
### VisualStudio Patch ###
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
# End of https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio
Test
/Examples/core/storage.data

View File

@ -1,273 +1,272 @@
/* Raylib-cs
* Easings.cs - Useful easing functions for values animation
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
public static partial class Raylib
{
// Linear Easing functions
public static float EaseLinearNone(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearIn(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearOut(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearInOut(float t,float b, float c, float d)
{
return (c * t / d + b);
}
// Sine Easing functions
public static float EaseSineIn(float t, float b, float c, float d)
{
return (-c * (float)Math.Cos(t / d * ((float)Math.PI / 2)) + c + b);
}
public static float EaseSineOut(float t, float b, float c, float d)
{
return (c * (float)Math.Sin(t / d * ((float)Math.PI / 2)) + b);
}
public static float EaseSineInOut(float t, float b, float c, float d)
{
return (-c / 2 * ((float)Math.Cos((float)Math.PI * t / d) - 1) + b);
}
// Circular Easing functions
public static float EaseCircIn(float t, float b, float c, float d)
{
return (-c * ((float)Math.Sqrt(1 - (t /= d) * t) - 1) + b);
}
public static float EaseCircOut(float t, float b, float c, float d)
{
return (c * (float)Math.Sqrt(1 - (t = t / d - 1) * t) + b);
}
public static float EaseCircInOut(float t, float b, float c, float d)
{
if ((t /= d / 2) < 1)
{
return (-c / 2 * ((float)Math.Sqrt(1 - t * t) - 1) + b);
}
return (c / 2 * ((float)Math.Sqrt(1 - t * (t -= 2)) + 1) + b);
}
// Cubic Easing functions
public static float EaseCubicIn(float t, float b, float c, float d)
{
return (c*(t /= d) * t * t + b);
}
public static float EaseCubicOut(float t, float b, float c, float d)
{
return (c * ((t = t / d - 1) * t * t + 1) + b);
}
public static float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1)
{
return (c / 2 * t * t * t + b);
}
return (c / 2 * ((t -= 2)* t * t + 2) + b);
}
// Quadratic Easing functions
public static float EaseQuadIn(float t, float b, float c, float d)
{
return (c * (t /= d) * t + b);
}
public static float EaseQuadOut(float t, float b, float c, float d)
{
return (-c * (t /= d) * (t - 2) + b);
}
public static float EaseQuadInOut(float t, float b, float c, float d)
{
if ((t /= d / 2) < 1)
{
return (((c / 2) * (t * t)) + b);
}
return (-c / 2 * (((t - 2) * (--t)) - 1) + b);
}
// Exponential Easing functions
public static float EaseExpoIn(float t, float b, float c, float d)
{
return (t == 0) ? b : (c * (float)Math.Pow(2, 10 * (t / d - 1)) + b);
}
public static float EaseExpoOut(float t, float b, float c, float d)
{
return (t == d) ? (b + c) : (c * (-(float)Math.Pow(2, -10 * t / d) + 1) + b);
}
public static float EaseExpoInOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if (t == d)
{
return (b + c);
}
if ((t /= d / 2) < 1)
{
return (c / 2 * (float)Math.Pow(2, 10 * (t - 1)) + b);
}
return (c / 2 * (-(float)Math.Pow(2, -10 * --t) + 2) + b);
}
// Back Easing functions
public static float EaseBackIn(float t, float b, float c, float d)
{
float s = 1.70158f;
float postFix = t /= d;
return (c * (postFix) * t *((s + 1) * t - s) + b);
}
public static float EaseBackOut(float t, float b, float c, float d)
{
float s = 1.70158f;
return (c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b);
}
public static float EaseBackInOut(float t, float b, float c, float d)
{
float s = 1.70158f;
if ((t/=d/2) < 1)
{
return (c/2*(t*t*(((s*=(1.525f)) + 1)*t - s)) + b);
}
float postFix = t-=2;
return (c/2*((postFix)*t*(((s*=(1.525f)) + 1)*t + s) + 2) + b);
}
// Bounce Easing functions
public static float EaseBounceOut(float t, float b, float c, float d)
{
if ((t /= d) < (1/2.75f))
{
return (c * (7.5625f * t * t) + b);
}
else if (t < (2/2.75f))
{
float postFix = t -= (1.5f/2.75f);
return (c * (7.5625f * (postFix) * t + 0.75f) + b);
}
else if (t < (2.5/2.75))
{
float postFix = t -= (2.25f/2.75f);
return (c * (7.5625f * (postFix)*t + 0.9375f) + b);
}
else
{
float postFix = t -= (2.625f / 2.75f);
return (c * (7.5625f * (postFix) * t + 0.984375f) + b);
}
}
public static float EaseBounceIn(float t, float b, float c, float d)
{
return (c - EaseBounceOut(d - t, 0, c, d) + b);
}
public static float EaseBounceInOut(float t, float b, float c, float d)
{
if (t < d / 2)
{
return (EaseBounceIn(t * 2, 0, c, d) * 0.5f + b);
}
else
{
return (EaseBounceOut(t * 2 - d, 0, c, d) * 0.5f + c * 0.5f + b);
}
}
// Elastic Easing functions
public static float EaseElasticIn(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d) == 1)
{
return (b + c);
}
float p = d * 0.3f;
float a = c;
float s = p / 4;
float postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
return (-(postFix * (float)Math.Sin((t * d - s)*(2 * (float)Math.PI) /p )) + b);
}
public static float EaseElasticOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d) == 1)
{
return (b + c);
}
float p = d * 0.3f;
float a = c;
float s = p / 4;
return (a * (float)Math.Pow(2,-10 * t) * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p) + c + b);
}
public static float EaseElasticInOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d / 2) == 2)
{
return (b + c);
}
float p = d * (0.3f * 1.5f);
float a = c;
float s = p / 4;
float postFix = 0f;
if (t < 1)
{
postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
return -0.5f * (postFix * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p)) + b;
}
postFix = a * (float)Math.Pow(2, -10 * (t -= 1));
return (postFix * (float)Math.Sin((t * d -s)*(2 * (float)Math.PI)/p) * 0.5f + c + b);
}
}
}
/* Raylib-cs
* Easings.cs - Useful easing functions for values animation
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
namespace Raylib
{
public static partial class Raylib
{
// Linear Easing functions
public static float EaseLinearNone(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearIn(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearOut(float t, float b, float c, float d)
{
return (c * t / d + b);
}
public static float EaseLinearInOut(float t, float b, float c, float d)
{
return (c * t / d + b);
}
// Sine Easing functions
public static float EaseSineIn(float t, float b, float c, float d)
{
return (-c * (float)Math.Cos(t / d * ((float)Math.PI / 2)) + c + b);
}
public static float EaseSineOut(float t, float b, float c, float d)
{
return (c * (float)Math.Sin(t / d * ((float)Math.PI / 2)) + b);
}
public static float EaseSineInOut(float t, float b, float c, float d)
{
return (-c / 2 * ((float)Math.Cos((float)Math.PI * t / d) - 1) + b);
}
// Circular Easing functions
public static float EaseCircIn(float t, float b, float c, float d)
{
return (-c * ((float)Math.Sqrt(1 - (t /= d) * t) - 1) + b);
}
public static float EaseCircOut(float t, float b, float c, float d)
{
return (c * (float)Math.Sqrt(1 - (t = t / d - 1) * t) + b);
}
public static float EaseCircInOut(float t, float b, float c, float d)
{
if ((t /= d / 2) < 1)
{
return (-c / 2 * ((float)Math.Sqrt(1 - t * t) - 1) + b);
}
return (c / 2 * ((float)Math.Sqrt(1 - t * (t -= 2)) + 1) + b);
}
// Cubic Easing functions
public static float EaseCubicIn(float t, float b, float c, float d)
{
return (c * (t /= d) * t * t + b);
}
public static float EaseCubicOut(float t, float b, float c, float d)
{
return (c * ((t = t / d - 1) * t * t + 1) + b);
}
public static float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t /= d / 2) < 1)
{
return (c / 2 * t * t * t + b);
}
return (c / 2 * ((t -= 2) * t * t + 2) + b);
}
// Quadratic Easing functions
public static float EaseQuadIn(float t, float b, float c, float d)
{
return (c * (t /= d) * t + b);
}
public static float EaseQuadOut(float t, float b, float c, float d)
{
return (-c * (t /= d) * (t - 2) + b);
}
public static float EaseQuadInOut(float t, float b, float c, float d)
{
if ((t /= d / 2) < 1)
{
return (((c / 2) * (t * t)) + b);
}
return (-c / 2 * (((t - 2) * (--t)) - 1) + b);
}
// Exponential Easing functions
public static float EaseExpoIn(float t, float b, float c, float d)
{
return (t == 0) ? b : (c * (float)Math.Pow(2, 10 * (t / d - 1)) + b);
}
public static float EaseExpoOut(float t, float b, float c, float d)
{
return (t == d) ? (b + c) : (c * (-(float)Math.Pow(2, -10 * t / d) + 1) + b);
}
public static float EaseExpoInOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if (t == d)
{
return (b + c);
}
if ((t /= d / 2) < 1)
{
return (c / 2 * (float)Math.Pow(2, 10 * (t - 1)) + b);
}
return (c / 2 * (-(float)Math.Pow(2, -10 * --t) + 2) + b);
}
// Back Easing functions
public static float EaseBackIn(float t, float b, float c, float d)
{
float s = 1.70158f;
float postFix = t /= d;
return (c * (postFix) * t * ((s + 1) * t - s) + b);
}
public static float EaseBackOut(float t, float b, float c, float d)
{
float s = 1.70158f;
return (c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b);
}
public static float EaseBackInOut(float t, float b, float c, float d)
{
float s = 1.70158f;
if ((t /= d / 2) < 1)
{
return (c / 2 * (t * t * (((s *= (1.525f)) + 1) * t - s)) + b);
}
float postFix = t -= 2;
return (c / 2 * ((postFix) * t * (((s *= (1.525f)) + 1) * t + s) + 2) + b);
}
// Bounce Easing functions
public static float EaseBounceOut(float t, float b, float c, float d)
{
if ((t /= d) < (1 / 2.75f))
{
return (c * (7.5625f * t * t) + b);
}
else if (t < (2 / 2.75f))
{
float postFix = t -= (1.5f / 2.75f);
return (c * (7.5625f * (postFix) * t + 0.75f) + b);
}
else if (t < (2.5 / 2.75))
{
float postFix = t -= (2.25f / 2.75f);
return (c * (7.5625f * (postFix) * t + 0.9375f) + b);
}
else
{
float postFix = t -= (2.625f / 2.75f);
return (c * (7.5625f * (postFix) * t + 0.984375f) + b);
}
}
public static float EaseBounceIn(float t, float b, float c, float d)
{
return (c - EaseBounceOut(d - t, 0, c, d) + b);
}
public static float EaseBounceInOut(float t, float b, float c, float d)
{
if (t < d / 2)
{
return (EaseBounceIn(t * 2, 0, c, d) * 0.5f + b);
}
else
{
return (EaseBounceOut(t * 2 - d, 0, c, d) * 0.5f + c * 0.5f + b);
}
}
// Elastic Easing functions
public static float EaseElasticIn(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d) == 1)
{
return (b + c);
}
float p = d * 0.3f;
float a = c;
float s = p / 4;
float postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
return (-(postFix * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p)) + b);
}
public static float EaseElasticOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d) == 1)
{
return (b + c);
}
float p = d * 0.3f;
float a = c;
float s = p / 4;
return (a * (float)Math.Pow(2, -10 * t) * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p) + c + b);
}
public static float EaseElasticInOut(float t, float b, float c, float d)
{
if (t == 0)
{
return b;
}
if ((t /= d / 2) == 2)
{
return (b + c);
}
float p = d * (0.3f * 1.5f);
float a = c;
float s = p / 4;
float postFix = 0f;
if (t < 1)
{
postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
return -0.5f * (postFix * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p)) + b;
}
postFix = a * (float)Math.Pow(2, -10 * (t -= 1));
return (postFix * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p) * 0.5f + c + b);
}
}
}

View File

@ -1,344 +1,526 @@
/* Raylib-cs
* Extensions.cs - Extra features
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
public struct Tween
{
public delegate float Callback(float t, float b, float c, float d);
public Callback easer;
public float start;
public float end;
public float currentTime;
public float duration;
public bool completed;
public Tween(Callback easer, float start, float end, float duration)
{
this.easer = easer;
this.start = start;
this.end = end;
this.currentTime = 0f;
this.duration = duration;
this.completed = false;
}
public void Reset()
{
currentTime = 0f;
completed = false;
}
public float Apply(float dt)
{
currentTime += dt;
if (currentTime > duration)
{
currentTime = duration;
completed = true;
}
return easer(currentTime, start, end - start, duration);
}
}
public partial struct Color
{
public Color(byte r, byte g, byte b, byte a)
{
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
public Color(int r, int g, int b, int a)
{
this.r = Convert.ToByte(r);
this.g = Convert.ToByte(g);
this.b = Convert.ToByte(b);
this.a = Convert.ToByte(a);
}
internal string DebugDisplayString
{
get
{
return string.Concat(
r.ToString(), " ",
g.ToString(), " ",
b.ToString(), " ",
a.ToString()
);
}
}
/// <summary>
/// Performs linear interpolation of <see cref="Color"/>.
/// </summary>
/// <param name="value1">Source <see cref="Color"/>.</param>
/// <param name="value2">Destination <see cref="Color"/>.</param>
/// <param name="amount">Interpolation factor.</param>
/// <returns>Interpolated <see cref="Color"/>.</returns>
public static Color Lerp(Color value1, Color value2, float amount)
{
amount = Raylib.Clamp(amount, 0.0f, 1.0f);
return new Color(
(int) Raylib.Lerp(value1.r, value2.r, amount),
(int) Raylib.Lerp(value1.g, value2.g, amount),
(int) Raylib.Lerp(value1.b, value2.b, amount),
(int) Raylib.Lerp(value1.a, value2.a, amount)
);
}
}
// Utlity for accessing math functions through struct
public partial struct Vector2
{
public float X {get{return x;} set {x = value;}}
public float Y {get{return y;} set {y = value;}}
public Vector2(float x, float y)
{
this.x = x;
this.y = y;
}
public Vector2(float value)
{
this.x = value;
this.y = value;
}
public override bool Equals(object obj) => (obj is Vector2) && Equals((Vector2)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode();
public float Length() => Raylib.Vector2Length(this);
public float LengthSquared() => (x * x) + (y * y);
public override string ToString()
{
return "Vector2(" + x + " " + y + ")";
}
// common values
public static Vector2 Zero { get { return Raylib.Vector2Zero(); } }
public static Vector2 One { get { return Raylib.Vector2One(); } }
public static Vector2 UnitX { get { return new Vector2(1, 0); } }
public static Vector2 UnitY { get { return new Vector2(0, 1); } }
// convienient operators
public static bool operator ==(Vector2 v1, Vector2 v2) => (v1.x == v2.x && v1.y == v2.y);
public static bool operator !=(Vector2 v1, Vector2 v2) => !(v1 == v2);
public static bool operator >(Vector2 v1, Vector2 v2) => v1.x > v2.x && v1.y > v2.y;
public static bool operator <(Vector2 v1, Vector2 v2) => v1.x < v2.x && v1.y < v2.y;
public static Vector2 operator +(Vector2 v1, Vector2 v2) => Raylib.Vector2Add(v1, v2);
public static Vector2 operator -(Vector2 v1, Vector2 v2) => Raylib.Vector2Subtract(v1, v2);
public static Vector2 operator *(Vector2 v1, Vector2 v2) => Raylib.Vector2Multiplyv(v1, v2);
public static Vector2 operator *(Vector2 v, float scale) => Raylib.Vector2Scale(v, scale);
public static Vector2 operator *(float scale, Vector2 v) => Raylib.Vector2Scale(v, scale);
public static Vector2 operator /(Vector2 v1, Vector2 v2) => Raylib.Vector2DivideV(v1, v2);
public static Vector2 operator /(Vector2 v1, float div) => Raylib.Vector2Divide(v1, div);
public static Vector2 operator -(Vector2 v1) => Raylib.Vector2Negate(v1);
public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
{
return new Vector2(
Raylib.Lerp(value1.X, value2.X, amount),
Raylib.Lerp(value1.Y, value2.Y, amount)
);
}
public static float Length(Vector2 v)
{
return Raylib.Vector2Length(v);
}
public static float Dot(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2DotProduct(v1, v2);
}
public static void Dot(ref Vector2 v1, ref Vector2 v2, out float result)
{
result = Raylib.Vector2DotProduct(v1, v2);
}
public static float DotProduct(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2DotProduct(v1, v2);
}
public static float Distance(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Distance(v1, v2);
}
public static float DistanceSquared(Vector2 v1, Vector2 v2)
{
float a = v1.X - v2.X, b = v1.Y - v2.Y;
return (a * a) + (b * b);
}
public static float Angle(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Angle(v1, v2);
}
public static Vector2 Scale(Vector2 v, float scale)
{
return Raylib.Vector2Scale(v, scale);
}
public static Vector2 Negate(Vector2 v)
{
return Raylib.Vector2Negate(v);
}
public static Vector2 Divide(Vector2 v, float div)
{
return Raylib.Vector2Divide(v, div);
}
public static void Normalize(ref Vector2 v)
{
v = Raylib.Vector2Normalize(v);
}
public static Vector2 Normalize(Vector2 v)
{
return Raylib.Vector2Normalize(v);
}
// Creates a new <see cref="Vector2"/> that contains a maximal values from the two vectors.
public static Vector2 Max(Vector2 v1, Vector2 v2)
{
return new Vector2(
v1.X > v2.X ? v1.X : v2.X,
v1.Y > v2.Y ? v1.Y : v2.Y
);
}
// Creates a new <see cref="Vector2"/> that contains a minimal values from the two vectors.
public static Vector2 Min(Vector2 v1, Vector2 v2)
{
return new Vector2(
v1.X < v2.X ? v1.X : v2.X,
v1.Y < v2.Y ? v1.Y : v2.Y
);
}
// Clamps the specified value within a range.
public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
{
return new Vector2(
Raylib.Clamp(value1.X, min.X, max.X),
Raylib.Clamp(value1.Y, min.Y, max.Y)
);
}
}
// Vector3 type
public partial struct Vector3
{
// captial option for xna/fna/monogame compatability
public float X { get => x; set => x = value; }
public float Y { get => y; set => y = value; }
public float Z { get => z; set => z = value; }
public Vector3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Vector3(float value)
{
this.x = value;
this.y = value;
this.z = value;
}
// extensions
public override bool Equals(object obj) => (obj is Vector3) && Equals((Vector3)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode();
public override string ToString()
{
return "Vector3(" + x + " " + y + " " + z + ")";
}
// common values
public static Vector3 Zero { get { return Raylib.Vector3Zero(); } }
public static Vector3 One { get { return Raylib.Vector3One(); } }
public static Vector3 UnitX { get { return new Vector3(1, 0, 0); } }
public static Vector3 UnitY { get { return new Vector3(0, 1, 0); } }
public static Vector3 UnitZ { get { return new Vector3(0, 0, 1); } }
// convienient operators
public static bool operator ==(Vector3 v1, Vector3 v2) => (v1.x == v2.x && v1.y == v2.y && v1.z == v2.z);
public static bool operator !=(Vector3 v1, Vector3 v2) => !(v1 == v2);
public static bool operator >(Vector3 v1, Vector3 v2) => v1.x > v2.x && v1.y > v2.y && v1.z > v2.z;
public static bool operator <(Vector3 v1, Vector3 v2) => v1.x < v2.x && v1.y < v2.y && v1.z < v2.z;
public static Vector3 operator +(Vector3 v1, Vector3 v2) => Raylib.Vector3Add(v1, v2);
public static Vector3 operator -(Vector3 v1, Vector3 v2) => Raylib.Vector3Subtract(v1, v2);
public static Vector3 operator *(Vector3 v1, Vector3 v2) => Raylib.Vector3MultiplyV(v1, v2);
public static Vector3 operator *(Vector3 v, float scale) => Raylib.Vector3Scale(v, scale);
public static Vector3 operator *(float scale, Vector3 v) => Raylib.Vector3Scale(v, scale);
public static Vector3 operator /(Vector3 v1, Vector3 v2) => Raylib.Vector3DivideV(v1, v2);
public static Vector3 operator /(Vector3 v1, float div) => Raylib.Vector3Divide(v1, div);
public static Vector3 operator -(Vector3 v1) => Raylib.Vector3Negate(v1);
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
{
return new Vector3(
Raylib.Lerp(value1.X, value2.X, amount),
Raylib.Lerp(value1.Y, value2.Y, amount),
Raylib.Lerp(value1.Z, value2.Z, amount)
);
}
}
// Vector4 type
public partial struct Vector4
{
public Vector4(float x, float y, float z, float w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
public Vector4(float value)
{
this.x = value;
this.y = value;
this.z = value;
this.w = value;
}
public override bool Equals(object obj) => (obj is Vector4) && Equals((Vector4)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode() + w.GetHashCode();
public override string ToString()
{
return "Vector4(" + x + " " + y + " " + z + " " + w + ")";
}
// convienient operators
public static bool operator ==(Vector4 v1, Vector4 v2) => (v1.x == v2.x && v1.y == v2.y && v1.z == v2.z && v1.w == v2.w);
public static bool operator !=(Vector4 v1, Vector4 v2) => !(v1 == v2);
public static bool operator >(Vector4 v1, Vector4 v2) => v1.x > v2.x && v1.y > v2.y && v1.z > v2.z && v2.w > v2.w;
public static bool operator <(Vector4 v1, Vector4 v2) => v1.x < v2.x && v1.y < v2.y && v1.z < v2.z && v1.w < v2.w;
}
}
/* Raylib-cs
* Extensions.cs - Higher level features over bindings. This file is not automatically generated.
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
using System.Text;
using System.Numerics;
namespace Raylib
{
// Extensions to the raylib bindings.
// Seperate for easier code generation.
public partial class Raylib
{
// extension providing SubText
public static string SubText(this string input, int position, int length)
{
return input.Substring(position, Math.Min(length, input.Length));
}
// Here (in the public method) we hide some low level details
// memory allocation, string manipulations etc.
public static bool CoreGuiTextBox(Rectangle bounds, ref string text, int textSize, bool freeEdit)
{
if (null == text)
{
return false; // or throw exception; or assign "" to text
}
StringBuilder sb = new StringBuilder(text);
// If we allow editing we should allocate enough size (Length) within StringBuilder
if (textSize > sb.Length)
{
sb.Length = textSize;
}
bool result = GuiTextBox(bounds, sb, sb.Length, freeEdit);
// Back to string (StringBuilder can have been edited)
// You may want to add some logic here; e.g. trim trailing '\0'
text = sb.ToString();
return result;
}
// Text Box control with multiple lines
public static bool CoreTextBoxMulti(Rectangle bounds, ref string text, int textSize, bool freeEdit)
{
if (null == text)
{
return false; // or throw exception; or assign "" to text
}
StringBuilder sb = new StringBuilder(text);
// If we allow editing we should allocate enough size (Length) within StringBuilder
if (textSize > sb.Length)
{
sb.Length = textSize;
}
bool result = GuiTextBoxMulti(bounds, sb, sb.Length, freeEdit);
// Back to string (StringBuilder can have been edited)
// You may want to add some logic here; e.g. trim trailing '\0'
text = sb.ToString();
return result;
}
}
// Small utility for tweening values
public struct Tween
{
public delegate float Callback(float t, float b, float c, float d);
public Callback easer;
public float start;
public float end;
public float currentTime;
public float duration;
public bool completed;
public Tween(Callback easer, float start, float end, float duration)
{
this.easer = easer;
this.start = start;
this.end = end;
this.currentTime = 0f;
this.duration = duration;
this.completed = false;
}
public void Reset()
{
currentTime = 0f;
completed = false;
}
public float Apply(float dt)
{
currentTime += dt;
if (currentTime > duration)
{
currentTime = duration;
completed = true;
}
return easer(currentTime, start, end - start, duration);
}
}
public partial struct Color
{
// Example - Color.RED instead of RED
// Custom raylib color palette for amazing visuals
public static Color LIGHTGRAY = new Color(200, 200, 200, 255);
public static Color GRAY = new Color(130, 130, 130, 255);
public static Color DARKGRAY = new Color(80, 80, 80, 255);
public static Color YELLOW = new Color(253, 249, 0, 255);
public static Color GOLD = new Color(255, 203, 0, 255);
public static Color ORANGE = new Color(255, 161, 0, 255);
public static Color PINK = new Color(255, 109, 194, 255);
public static Color RED = new Color(230, 41, 55, 255);
public static Color MAROON = new Color(190, 33, 55, 255);
public static Color GREEN = new Color(0, 228, 48, 255);
public static Color LIME = new Color(0, 158, 47, 255);
public static Color DARKGREEN = new Color(0, 117, 44, 255);
public static Color SKYBLUE = new Color(102, 191, 255, 255);
public static Color BLUE = new Color(0, 121, 241, 255);
public static Color DARKBLUE = new Color(0, 82, 172, 255);
public static Color PURPLE = new Color(200, 122, 255, 255);
public static Color VIOLET = new Color(135, 60, 190, 255);
public static Color DARKPURPLE = new Color(112, 31, 126, 255);
public static Color BEIGE = new Color(211, 176, 131, 255);
public static Color BROWN = new Color(127, 106, 79, 255);
public static Color DARKBROWN = new Color(76, 63, 47, 255);
public static Color WHITE = new Color(255, 255, 255, 255);
public static Color BLACK = new Color(0, 0, 0, 255);
public static Color BLANK = new Color(0, 0, 0, 0);
public static Color MAGENTA = new Color(255, 0, 255, 255);
public static Color RAYWHITE = new Color(245, 245, 245, 255);
public Color(byte r, byte g, byte b, byte a)
{
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}
public Color(int r, int g, int b, int a)
{
this.r = Convert.ToByte(r);
this.g = Convert.ToByte(g);
this.b = Convert.ToByte(b);
this.a = Convert.ToByte(a);
}
internal string DebugDisplayString
{
get
{
return string.Concat(
r.ToString(), " ",
g.ToString(), " ",
b.ToString(), " ",
a.ToString()
);
}
}
// Performs linear interpolation of <see cref="Color"/>.
public static Color Lerp(Color value1, Color value2, float amount)
{
amount = Raylib.Clamp(amount, 0.0f, 1.0f);
return new Color(
(int)Raylib.Lerp(value1.r, value2.r, amount),
(int)Raylib.Lerp(value1.g, value2.g, amount),
(int)Raylib.Lerp(value1.b, value2.b, amount),
(int)Raylib.Lerp(value1.a, value2.a, amount)
);
}
}
public partial struct Rectangle
{
public Rectangle(float x, float y, float width, float height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
}
public partial struct BoundingBox
{
public BoundingBox(Vector3 min, Vector3 max)
{
this.min = min;
this.max = max;
}
}
public partial struct Camera3D
{
public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy = 90, CameraType type = CameraType.CAMERA_PERSPECTIVE)
{
this.position = position;
this.target = target;
this.up = up;
this.fovy = fovy;
this.type = type;
}
}
public partial struct Ray
{
public Ray(Vector3 position, Vector3 direction)
{
this.position = position;
this.direction = direction;
}
}
public partial struct RayHitInfo
{
public RayHitInfo(bool hit, float distance, Vector3 position, Vector3 normal)
{
this.hit = hit;
this.distance = distance;
this.position = position;
this.normal = normal;
}
}
// Utlity for accessing math functions through struct
public partial struct Vector2
{
public Vector2(float x, float y)
{
this.x = x;
this.y = y;
}
public Vector2(float value)
{
this.x = value;
this.y = value;
}
public override bool Equals(object obj) => (obj is Vector2) && Equals((Vector2)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode();
public float Length() => Raylib.Vector2Length(this);
public float LengthSquared() => (x * x) + (y * y);
public override string ToString()
{
return "Vector2(" + x + " " + y + ")";
}
// common values
public static Vector2 Zero { get { return Raylib.Vector2Zero(); } }
public static Vector2 One { get { return Raylib.Vector2One(); } }
public static Vector2 UnitX { get { return new Vector2(1, 0); } }
public static Vector2 UnitY { get { return new Vector2(0, 1); } }
// convienient operators
public static bool operator ==(Vector2 v1, Vector2 v2) => (v1.x == v2.x && v1.y == v2.y);
public static bool operator !=(Vector2 v1, Vector2 v2)
{
return !(v1 == v2);
}
public static bool operator >(Vector2 v1, Vector2 v2)
{
return v1.x > v2.x && v1.y > v2.y;
}
public static bool operator <(Vector2 v1, Vector2 v2)
{
return v1.x < v2.x && v1.y < v2.y;
}
public static Vector2 operator +(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Add(v1, v2);
}
public static Vector2 operator -(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Subtract(v1, v2);
}
public static Vector2 operator *(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Multiplyv(v1, v2);
}
public static Vector2 operator *(Vector2 v, float scale)
{
return Raylib.Vector2Scale(v, scale);
}
public static Vector2 operator *(float scale, Vector2 v)
{
return Raylib.Vector2Scale(v, scale);
}
public static Vector2 operator /(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2DivideV(v1, v2);
}
public static Vector2 operator /(Vector2 v1, float div)
{
return Raylib.Vector2Divide(v1, div);
}
public static Vector2 operator -(Vector2 v1)
{
return Raylib.Vector2Negate(v1);
}
public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
{
return new Vector2(
Raylib.Lerp(value1.x, value2.x, amount),
Raylib.Lerp(value1.y, value2.y, amount)
);
}
public static float Length(Vector2 v)
{
return Raylib.Vector2Length(v);
}
public static float Dot(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2DotProduct(v1, v2);
}
public static void Dot(ref Vector2 v1, ref Vector2 v2, out float result)
{
result = Raylib.Vector2DotProduct(v1, v2);
}
public static float DotProduct(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2DotProduct(v1, v2);
}
public static float Distance(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Distance(v1, v2);
}
public static float DistanceSquared(Vector2 v1, Vector2 v2)
{
float a = v1.x - v2.x, b = v1.y - v2.y;
return (a * a) + (b * b);
}
public static float Angle(Vector2 v1, Vector2 v2)
{
return Raylib.Vector2Angle(v1, v2);
}
public static Vector2 Scale(Vector2 v, float scale)
{
return Raylib.Vector2Scale(v, scale);
}
public static Vector2 Negate(Vector2 v)
{
return Raylib.Vector2Negate(v);
}
public static Vector2 Divide(Vector2 v, float div)
{
return Raylib.Vector2Divide(v, div);
}
public static void Normalize(ref Vector2 v)
{
v = Raylib.Vector2Normalize(v);
}
public static Vector2 Normalize(Vector2 v)
{
return Raylib.Vector2Normalize(v);
}
// Creates a new <see cref="Vector2"/> that contains a maximal values from the two vectors.
public static Vector2 Max(Vector2 v1, Vector2 v2)
{
return new Vector2(
v1.x > v2.x ? v1.x : v2.x,
v1.y > v2.y ? v1.y : v2.y
);
}
// Creates a new <see cref="Vector2"/> that contains a minimal values from the two vectors.
public static Vector2 Min(Vector2 v1, Vector2 v2)
{
return new Vector2(
v1.x < v2.x ? v1.x : v2.x,
v1.y < v2.y ? v1.y : v2.y
);
}
// Clamps the specified value within a range.
public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
{
return new Vector2(
Raylib.Clamp(value1.x, min.x, max.x),
Raylib.Clamp(value1.y, min.y, max.y)
);
}
}
// Vector3 type
public partial struct Vector3
{
public Vector3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Vector3(float value)
{
this.x = value;
this.y = value;
this.z = value;
}
// extensions
public override bool Equals(object obj) => (obj is Vector3) && Equals((Vector3)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode();
public override string ToString()
{
return "Vector3(" + x + " " + y + " " + z + ")";
}
// common values
public static Vector3 Zero { get { return Raylib.Vector3Zero(); } }
public static Vector3 One { get { return Raylib.Vector3One(); } }
public static Vector3 UnitX { get { return new Vector3(1, 0, 0); } }
public static Vector3 UnitY { get { return new Vector3(0, 1, 0); } }
public static Vector3 UnitZ { get { return new Vector3(0, 0, 1); } }
// convienient operators
public static bool operator ==(Vector3 v1, Vector3 v2) => (v1.x == v2.x && v1.y == v2.y && v1.z == v2.z);
public static bool operator !=(Vector3 v1, Vector3 v2) => !(v1 == v2);
public static bool operator >(Vector3 v1, Vector3 v2) => v1.x > v2.x && v1.y > v2.y && v1.z > v2.z;
public static bool operator <(Vector3 v1, Vector3 v2) => v1.x < v2.x && v1.y < v2.y && v1.z < v2.z;
public static Vector3 operator +(Vector3 v1, Vector3 v2) => Raylib.Vector3Add(v1, v2);
public static Vector3 operator -(Vector3 v1, Vector3 v2) => Raylib.Vector3Subtract(v1, v2);
public static Vector3 operator *(Vector3 v1, Vector3 v2) => Raylib.Vector3MultiplyV(v1, v2);
public static Vector3 operator *(Vector3 v, float scale) => Raylib.Vector3Scale(v, scale);
public static Vector3 operator *(float scale, Vector3 v) => Raylib.Vector3Scale(v, scale);
public static Vector3 operator /(Vector3 v1, Vector3 v2) => Raylib.Vector3DivideV(v1, v2);
public static Vector3 operator /(Vector3 v1, float div) => Raylib.Vector3Divide(v1, div);
public static Vector3 operator -(Vector3 v1) => Raylib.Vector3Negate(v1);
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
{
return new Vector3(
Raylib.Lerp(value1.x, value2.x, amount),
Raylib.Lerp(value1.y, value2.y, amount),
Raylib.Lerp(value1.z, value2.z, amount)
);
}
}
// Vector4 type
public partial struct Vector4
{
public Vector4(float x, float y, float z, float w)
{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
public Vector4(float value)
{
x = value;
y = value;
z = value;
w = value;
}
public override bool Equals(object obj) => (obj is Vector4) && Equals((Vector4)obj);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode() + w.GetHashCode();
public override string ToString()
{
return "Vector4(" + x + " " + y + " " + z + " " + w + ")";
}
// convienient operators
public static bool operator ==(Vector4 v1, Vector4 v2) => (v1.x == v2.x && v1.y == v2.y && v1.z == v2.z && v1.w == v2.w);
public static bool operator !=(Vector4 v1, Vector4 v2) => !(v1 == v2);
public static bool operator >(Vector4 v1, Vector4 v2) => v1.x > v2.x && v1.y > v2.y && v1.z > v2.z && v2.w > v2.w;
public static bool operator <(Vector4 v1, Vector4 v2) => v1.x < v2.x && v1.y < v2.y && v1.z < v2.z && v1.w < v2.w;
}
}

View File

@ -1,258 +1,258 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
#region Raylib-cs Enums
public enum PhysicsShapeType
{
PHYSICS_CIRCLE,
PHYSICS_POLYGON
}
#endregion
#region Raylib-cs Types
// Mat2 type (used for polygon shape rotation matrix)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Mat2
{
public float m00;
public float m01;
public float m10;
public float m11;
}
// @TODO Custom array marshall issue https://github.com/ChrisDill/Raylib-cs/issues/9
// hack same as raylib.cs _MaterialMap_e_FixedBuffer
// no easy way to marshall arrays of custom types. no idea why?!?!
// Span<T> seems to need ref struct.
public unsafe struct _Polygon_e_FixedBuffer
{
public Vector2 v0;
public Vector2 v1;
public Vector2 v2;
public Vector2 v3;
public Vector2 v4;
public Vector2 v5;
public Vector2 v6;
public Vector2 v7;
public Vector2 v8;
public Vector2 v9;
public Vector2 v10;
public Vector2 v11;
public Vector2 v12;
public Vector2 v13;
public Vector2 v14;
public Vector2 v15;
public Vector2 v16;
public Vector2 v17;
public Vector2 v18;
public Vector2 v19;
public Vector2 v20;
public Vector2 v21;
public Vector2 v22;
public Vector2 v23;
public Vector2 v24;
public Vector2 this[int index]
{
get
{
fixed (Vector2* e = &v0)
return e[index];
}
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PolygonData
{
public uint vertexCount; // Current used vertex and normals count
public _Polygon_e_FixedBuffer positions; // Polygon vertex positions vectors
public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsShape
{
public PhysicsShapeType type; // Physics shape type (circle or polygon)
public IntPtr body; // Shape physics body reference
public float radius; // Circle shape radius (used for circle shapes)
public Mat2 transform; // Vertices transform matrix 2x2
public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes)
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct PhysicsBodyData
{
public uint id;
[MarshalAs(UnmanagedType.Bool)]
public bool enabled;
public Vector2 position;
public Vector2 velocity;
public Vector2 force;
public float angularVelocity;
public float torque;
public float orient;
public float inertia;
public float inverseInertia;
public float mass;
public float inverseMass;
public float staticFriction;
public float dynamicFriction;
public float restitution;
[MarshalAs(UnmanagedType.Bool)]
public bool useGravity;
[MarshalAs(UnmanagedType.Bool)]
public bool isGrounded;
[MarshalAs(UnmanagedType.Bool)]
public bool freezeOrient;
public PhysicsShape shape;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsManifoldData
{
public uint id; // Reference unique identifier
public IntPtr bodyA; // Manifold first physics body reference
public IntPtr bodyB; // Manifold second physics body reference
public float penetration; // Depth of penetration from collision
public Vector2 normal; // Normal direction vector from 'a' to 'b'
public Vector2 contactsA; // Points of contact during collision
public Vector2 contactsB; // Points of contact during collision
public uint contactsCount; // Current collision number of contacts
public float restitution; // Mixed restitution during collision
public float dynamicFriction; // Mixed dynamic friction during collision
public float staticFriction; // Mixed static friction during collision
}
#endregion
public static partial class Raylib
{
#region Raylib-cs Variables
public const int PHYSAC_MAX_BODIES = 64;
public const int PHYSAC_MAX_MANIFOLDS = 4096;
public const int PHYSAC_MAX_VERTICES = 24;
public const int PHYSAC_CIRCLE_VERTICES = 24;
public const float PHYSAC_DESIRED_DELTATIME = 1.0f / 60.0f;
public const float PHYSAC_MAX_TIMESTEP = 0.02f;
public const int PHYSAC_COLLISION_ITERATIONS = 100;
public const float PHYSAC_PENETRATION_ALLOWANCE = 0.05f;
public const float PHYSAC_PENETRATION_CORRECTION = 0.4f;
public const float PHYSAC_PI = 3.14159265358979323846f;
public const float PHYSAC_DEG2RAD = (PHYSAC_PI / 180.0f);
#endregion
#region Raylib-cs Functions
// Initializes physics values, pointers and creates physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void InitPhysics();
// Run physics step, to be used if PHYSICS_NO_THREADS is set in your main loop
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void RunPhysicsStep();
// Returns true if physics thread is currently enabled
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsPhysicsEnabled();
// Sets physics global gravity force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsGravity(float x, float y);
// Creates a new circle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyCircle")]
private static extern IntPtr CreatePhysicsBodyCircleImport(Vector2 pos, float radius, float density);
public static PhysicsBodyData CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
{
var body = CreatePhysicsBodyCircleImport(pos, radius, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Creates a new rectangle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyRectangle")]
private static extern IntPtr CreatePhysicsBodyRectangleImport(Vector2 pos, float width, float height, float density);
public static PhysicsBodyData CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
{
var body = CreatePhysicsBodyRectangleImport(pos, width, height, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Creates a new polygon physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyPolygon")]
private static extern IntPtr CreatePhysicsBodyPolygonImport(Vector2 pos, float radius, int sides, float density);
public static PhysicsBodyData CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
{
var body = CreatePhysicsBodyPolygonImport(pos, radius, sides, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Adds a force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddForce(PhysicsBodyData body, Vector2 force);
// Adds an angular force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddTorque(PhysicsBodyData body, float amount);
// Shatters a polygon shape physics body to little physics bodies with explosion force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsShatter(PhysicsBodyData body, Vector2 position, float force);
// Returns the current amount of created physics bodies
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsBodiesCount();
// Returns a physics body of the bodies pool at a specific index
[DllImport(nativeLibName, EntryPoint = "GetPhysicsBody")]
public static extern IntPtr GetPhysicsBodyImport(int index);
public static PhysicsBodyData GetPhysicsBody(int index)
{
var body = GetPhysicsBodyImport(index);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeType(int index);
// Returns the amount of vertices of a physics body shape
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeVerticesCount(int index);
// Returns transformed position of a body shape (body position + vertex transformed position)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetPhysicsShapeVertex(PhysicsBodyData body, int vertex);
// Sets physics body shape transform based on radians parameter
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsBodyRotation(PhysicsBodyData body, float radians);
// Unitializes and destroy a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void DestroyPhysicsBody(PhysicsBodyData body);
// Destroys created physics bodies and manifolds and resets global values
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ResetPhysics();
// Unitializes physics pointers and closes physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ClosePhysics();
#endregion
}
}
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
#region Raylib-cs Enums
public enum PhysicsShapeType
{
PHYSICS_CIRCLE,
PHYSICS_POLYGON
}
#endregion
#region Raylib-cs Types
// Mat2 type (used for polygon shape rotation matrix)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Mat2
{
public float m00;
public float m01;
public float m10;
public float m11;
}
// @TODO Custom array marshall issue https://github.com/ChrisDill/Raylib-cs/issues/9
// hack same as raylib.cs _MaterialMap_e_FixedBuffer
// no easy way to marshall arrays of custom types. no idea why?!?!
// Span<T> seems to need ref struct.
public unsafe struct _Polygon_e_FixedBuffer
{
public Vector2 v0;
public Vector2 v1;
public Vector2 v2;
public Vector2 v3;
public Vector2 v4;
public Vector2 v5;
public Vector2 v6;
public Vector2 v7;
public Vector2 v8;
public Vector2 v9;
public Vector2 v10;
public Vector2 v11;
public Vector2 v12;
public Vector2 v13;
public Vector2 v14;
public Vector2 v15;
public Vector2 v16;
public Vector2 v17;
public Vector2 v18;
public Vector2 v19;
public Vector2 v20;
public Vector2 v21;
public Vector2 v22;
public Vector2 v23;
public Vector2 v24;
public Vector2 this[int index]
{
get
{
fixed (Vector2* e = &v0)
return e[index];
}
}
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PolygonData
{
public uint vertexCount; // Current used vertex and normals count
public _Polygon_e_FixedBuffer positions; // Polygon vertex positions vectors
public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsShape
{
public PhysicsShapeType type; // Physics shape type (circle or polygon)
public IntPtr body; // Shape physics body reference
public float radius; // Circle shape radius (used for circle shapes)
public Mat2 transform; // Vertices transform matrix 2x2
public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes)
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct PhysicsBodyData
{
public uint id;
[MarshalAs(UnmanagedType.Bool)]
public bool enabled;
public Vector2 position;
public Vector2 velocity;
public Vector2 force;
public float angularVelocity;
public float torque;
public float orient;
public float inertia;
public float inverseInertia;
public float mass;
public float inverseMass;
public float staticFriction;
public float dynamicFriction;
public float restitution;
[MarshalAs(UnmanagedType.Bool)]
public bool useGravity;
[MarshalAs(UnmanagedType.Bool)]
public bool isGrounded;
[MarshalAs(UnmanagedType.Bool)]
public bool freezeOrient;
public PhysicsShape shape;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsManifoldData
{
public uint id; // Reference unique identifier
public IntPtr bodyA; // Manifold first physics body reference
public IntPtr bodyB; // Manifold second physics body reference
public float penetration; // Depth of penetration from collision
public Vector2 normal; // Normal direction vector from 'a' to 'b'
public Vector2 contactsA; // Points of contact during collision
public Vector2 contactsB; // Points of contact during collision
public uint contactsCount; // Current collision number of contacts
public float restitution; // Mixed restitution during collision
public float dynamicFriction; // Mixed dynamic friction during collision
public float staticFriction; // Mixed static friction during collision
}
#endregion
public static partial class Raylib
{
#region Raylib-cs Variables
public const int PHYSAC_MAX_BODIES = 64;
public const int PHYSAC_MAX_MANIFOLDS = 4096;
public const int PHYSAC_MAX_VERTICES = 24;
public const int PHYSAC_CIRCLE_VERTICES = 24;
public const float PHYSAC_DESIRED_DELTATIME = 1.0f / 60.0f;
public const float PHYSAC_MAX_TIMESTEP = 0.02f;
public const int PHYSAC_COLLISION_ITERATIONS = 100;
public const float PHYSAC_PENETRATION_ALLOWANCE = 0.05f;
public const float PHYSAC_PENETRATION_CORRECTION = 0.4f;
public const float PHYSAC_PI = 3.14159265358979323846f;
public const float PHYSAC_DEG2RAD = (PHYSAC_PI / 180.0f);
#endregion
#region Raylib-cs Functions
// Initializes physics values, pointers and creates physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void InitPhysics();
// Run physics step, to be used if PHYSICS_NO_THREADS is set in your main loop
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void RunPhysicsStep();
// Returns true if physics thread is currently enabled
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsPhysicsEnabled();
// Sets physics global gravity force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsGravity(float x, float y);
// Creates a new circle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyCircle")]
private static extern IntPtr CreatePhysicsBodyCircleImport(Vector2 pos, float radius, float density);
public static PhysicsBodyData CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
{
var body = CreatePhysicsBodyCircleImport(pos, radius, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Creates a new rectangle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyRectangle")]
private static extern IntPtr CreatePhysicsBodyRectangleImport(Vector2 pos, float width, float height, float density);
public static PhysicsBodyData CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
{
var body = CreatePhysicsBodyRectangleImport(pos, width, height, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Creates a new polygon physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyPolygon")]
private static extern IntPtr CreatePhysicsBodyPolygonImport(Vector2 pos, float radius, int sides, float density);
public static PhysicsBodyData CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
{
var body = CreatePhysicsBodyPolygonImport(pos, radius, sides, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Adds a force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddForce(PhysicsBodyData body, Vector2 force);
// Adds an angular force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddTorque(PhysicsBodyData body, float amount);
// Shatters a polygon shape physics body to little physics bodies with explosion force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsShatter(PhysicsBodyData body, Vector2 position, float force);
// Returns the current amount of created physics bodies
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsBodiesCount();
// Returns a physics body of the bodies pool at a specific index
[DllImport(nativeLibName, EntryPoint = "GetPhysicsBody")]
public static extern IntPtr GetPhysicsBodyImport(int index);
public static PhysicsBodyData GetPhysicsBody(int index)
{
var body = GetPhysicsBodyImport(index);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data;
}
// Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeType(int index);
// Returns the amount of vertices of a physics body shape
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeVerticesCount(int index);
// Returns transformed position of a body shape (body position + vertex transformed position)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetPhysicsShapeVertex(PhysicsBodyData body, int vertex);
// Sets physics body shape transform based on radians parameter
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsBodyRotation(PhysicsBodyData body, float radians);
// Unitializes and destroy a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void DestroyPhysicsBody(PhysicsBodyData body);
// Destroys created physics bodies and manifolds and resets global values
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ResetPhysics();
// Unitializes physics pointers and closes physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ClosePhysics();
#endregion
}
}

View File

@ -1,292 +1,292 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Raylib
{
// Gui global state enum
enum GuiControlState
{
GUI_STATE_NORMAL = 0,
GUI_STATE_FOCUSED,
GUI_STATE_PRESSED,
GUI_STATE_DISABLED,
}
// Gui standard controls
enum GuiControlStandard
{
DEFAULT = 0,
LABEL, // LABELBUTTON
BUTTON, // IMAGEBUTTON
TOGGLE, // TOGGLEGROUP
SLIDER, // SLIDERBAR
PROGRESSBAR,
CHECKBOX,
COMBOBOX,
DROPDOWNBOX,
TEXTBOX, // VALUEBOX, SPINNER
LISTVIEW,
COLORPICKER
}
// Gui default properties for every control
enum GuiControlProperty
{
BORDER_COLOR_NORMAL = 0,
BASE_COLOR_NORMAL,
TEXT_COLOR_NORMAL,
BORDER_COLOR_FOCUSED,
BASE_COLOR_FOCUSED,
TEXT_COLOR_FOCUSED,
BORDER_COLOR_PRESSED,
BASE_COLOR_PRESSED,
TEXT_COLOR_PRESSED,
BORDER_COLOR_DISABLED,
BASE_COLOR_DISABLED,
TEXT_COLOR_DISABLED,
BORDER_WIDTH,
INNER_PADDING,
RESERVED01,
RESERVED02
}
// Gui extended properties depending on control type
// NOTE: We reserve a fixed size of additional properties per control (8)
// Default properties
enum GuiDefaultProperty
{
TEXT_SIZE = 16,
TEXT_SPACING,
LINES_COLOR,
BACKGROUND_COLOR,
}
// Toggle / ToggleGroup
enum GuiToggleProperty
{
GROUP_PADDING = 16,
}
// Slider / SliderBar
enum GuiSliderProperty
{
SLIDER_WIDTH = 16,
EX_TEXT_PADDING
}
// TextBox / ValueBox / Spinner
enum GuiTextBoxProperty
{
MULTILINE_PADDING = 16,
SPINNER_BUTTON_WIDTH,
SPINNER_BUTTON_PADDING,
SPINNER_BUTTON_BORDER_WIDTH
}
// CheckBox
enum GuiCheckBoxProperty
{
CHECK_TEXT_PADDING = 16
}
// ComboBox
enum GuiComboBoxProperty
{
SELECTOR_WIDTH = 16,
SELECTOR_PADDING
}
// DropdownBox
enum GuiDropdownBoxProperty
{
ARROW_RIGHT_PADDING = 16,
}
// ColorPicker
enum GuiColorPickerProperty
{
COLOR_SELECTOR_SIZE = 16,
BAR_WIDTH, // Lateral bar width
BAR_PADDING, // Lateral bar separation from panel
BAR_SELECTOR_HEIGHT, // Lateral bar selector height
BAR_SELECTOR_PADDING // Lateral bar selector outer padding
}
// ListView
enum GuiListViewProperty
{
ELEMENTS_HEIGHT = 16,
ELEMENTS_PADDING,
SCROLLBAR_WIDTH,
}
public static partial class Raylib
{
// Global gui modification functions
// Enable gui controls (global state)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiEnable();
// Disable gui controls (global state)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiDisable();
// Lock gui controls (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLock();
// Unlock gui controls (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiUnlock();
// Set gui state (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiState(int state);
// Set gui custom font (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiFont(Font font);
// Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiFade(float alpha);
// Style set/get functions
// Set one style property
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiSetStyle(int control, int property, int value);
// Get one style property
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiGetStyle(int control, int property);
// Container/separator controls, useful for controls organization
// Window Box control, shows a window that can be closed
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiWindowBox(Rectangle bounds, string text);
// Group Box control with title name
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiGroupBox(Rectangle bounds, string text);
// Line separator control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLine(Rectangle bounds, int thick);
// Panel control, useful to group controls
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiPanel(Rectangle bounds);
// Scroll Panel control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 viewScroll);
// Basic controls set
// Label control, shows text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLabel(Rectangle bounds, string text);
// Button control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiButton(Rectangle bounds, string text);
// Label button control, show true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiLabelButton(Rectangle bounds, string text);
// Image button control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiImageButton(Rectangle bounds, Texture2D texture);
// Image button extended control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiImageButtonEx(Rectangle bounds, Texture2D texture, Rectangle texSource, string text);
// Toggle Button control, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiToggleButton(Rectangle bounds, string text, bool toggle);
// Toggle Group control, returns toggled button index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiToggleGroup(Rectangle bounds, string text, int count, int active);
// Check Box control, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiCheckBox(Rectangle bounds, bool isChecked);
// Check Box control with text, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiCheckBoxEx(Rectangle bounds, bool isChecked, string text);
// Combo Box control, returns selected item index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiComboBox(Rectangle bounds, string text, int count, int active);
// Dropdown Box control, returns selected item
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiDropdownBox(Rectangle bounds, string[] text, int count, int active);
// Spinner control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiSpinner(Rectangle bounds, int value, int maxValue, int btnWidth);
// Value Box control, updates input text with numbers
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiValueBox(Rectangle bounds, int value, int maxValue);
// Text Box control, updates input text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiTextBox(Rectangle bounds, StringBuilder text, int textSize, bool freeEdit);
// Text Box control with multiple lines
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiTextBoxMulti(Rectangle bounds, StringBuilder text, int textSize, bool editMode);
// Slider control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue);
// Slider control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
// Slider Bar control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue);
// Slider Bar control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderBarEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
// Progress Bar control, shows current progress value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiProgressBar(Rectangle bounds, float value, float minValue, float maxValue);
// Progress Bar control, shows current progress value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiProgressBarEx(Rectangle bounds, float value, float minValue, float maxValue, bool showValue);
// Status Bar control, shows info text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiStatusBar(Rectangle bounds, string text, int offsetX);
// Dummy control for placeholders
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiDummyRec(Rectangle bounds, string text);
// Advance controls set
// List View control, returns selected list element index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiListView(Rectangle bounds, string text, int count, int active);
// Color Picker control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Color GuiColorPicker(Rectangle bounds, Color color);
// Message Box control, displays a message
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiMessageBox(Rectangle bounds, string windowTitle, string message);
}
}
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Raylib
{
// Gui global state enum
enum GuiControlState
{
GUI_STATE_NORMAL = 0,
GUI_STATE_FOCUSED,
GUI_STATE_PRESSED,
GUI_STATE_DISABLED,
}
// Gui standard controls
enum GuiControlStandard
{
DEFAULT = 0,
LABEL, // LABELBUTTON
BUTTON, // IMAGEBUTTON
TOGGLE, // TOGGLEGROUP
SLIDER, // SLIDERBAR
PROGRESSBAR,
CHECKBOX,
COMBOBOX,
DROPDOWNBOX,
TEXTBOX, // VALUEBOX, SPINNER
LISTVIEW,
COLORPICKER
}
// Gui default properties for every control
enum GuiControlProperty
{
BORDER_COLOR_NORMAL = 0,
BASE_COLOR_NORMAL,
TEXT_COLOR_NORMAL,
BORDER_COLOR_FOCUSED,
BASE_COLOR_FOCUSED,
TEXT_COLOR_FOCUSED,
BORDER_COLOR_PRESSED,
BASE_COLOR_PRESSED,
TEXT_COLOR_PRESSED,
BORDER_COLOR_DISABLED,
BASE_COLOR_DISABLED,
TEXT_COLOR_DISABLED,
BORDER_WIDTH,
INNER_PADDING,
RESERVED01,
RESERVED02
}
// Gui extended properties depending on control type
// NOTE: We reserve a fixed size of additional properties per control (8)
// Default properties
enum GuiDefaultProperty
{
TEXT_SIZE = 16,
TEXT_SPACING,
LINES_COLOR,
BACKGROUND_COLOR,
}
// Toggle / ToggleGroup
enum GuiToggleProperty
{
GROUP_PADDING = 16,
}
// Slider / SliderBar
enum GuiSliderProperty
{
SLIDER_WIDTH = 16,
EX_TEXT_PADDING
}
// TextBox / ValueBox / Spinner
enum GuiTextBoxProperty
{
MULTILINE_PADDING = 16,
SPINNER_BUTTON_WIDTH,
SPINNER_BUTTON_PADDING,
SPINNER_BUTTON_BORDER_WIDTH
}
// CheckBox
enum GuiCheckBoxProperty
{
CHECK_TEXT_PADDING = 16
}
// ComboBox
enum GuiComboBoxProperty
{
SELECTOR_WIDTH = 16,
SELECTOR_PADDING
}
// DropdownBox
enum GuiDropdownBoxProperty
{
ARROW_RIGHT_PADDING = 16,
}
// ColorPicker
enum GuiColorPickerProperty
{
COLOR_SELECTOR_SIZE = 16,
BAR_WIDTH, // Lateral bar width
BAR_PADDING, // Lateral bar separation from panel
BAR_SELECTOR_HEIGHT, // Lateral bar selector height
BAR_SELECTOR_PADDING // Lateral bar selector outer padding
}
// ListView
enum GuiListViewProperty
{
ELEMENTS_HEIGHT = 16,
ELEMENTS_PADDING,
SCROLLBAR_WIDTH,
}
public static partial class Raylib
{
// Global gui modification functions
// Enable gui controls (global state)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiEnable();
// Disable gui controls (global state)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiDisable();
// Lock gui controls (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLock();
// Unlock gui controls (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiUnlock();
// Set gui state (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiState(int state);
// Set gui custom font (global state)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiFont(Font font);
// Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiFade(float alpha);
// Style set/get functions
// Set one style property
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiSetStyle(int control, int property, int value);
// Get one style property
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiGetStyle(int control, int property);
// Container/separator controls, useful for controls organization
// Window Box control, shows a window that can be closed
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiWindowBox(Rectangle bounds, string text);
// Group Box control with title name
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiGroupBox(Rectangle bounds, string text);
// Line separator control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLine(Rectangle bounds, int thick);
// Panel control, useful to group controls
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiPanel(Rectangle bounds);
// Scroll Panel control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 viewScroll);
// Basic controls set
// Label control, shows text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiLabel(Rectangle bounds, string text);
// Button control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiButton(Rectangle bounds, string text);
// Label button control, show true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiLabelButton(Rectangle bounds, string text);
// Image button control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiImageButton(Rectangle bounds, Texture2D texture);
// Image button extended control, returns true when clicked
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiImageButtonEx(Rectangle bounds, Texture2D texture, Rectangle texSource, string text);
// Toggle Button control, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiToggleButton(Rectangle bounds, string text, bool toggle);
// Toggle Group control, returns toggled button index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiToggleGroup(Rectangle bounds, string text, int count, int active);
// Check Box control, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiCheckBox(Rectangle bounds, bool isChecked);
// Check Box control with text, returns true when active
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiCheckBoxEx(Rectangle bounds, bool isChecked, string text);
// Combo Box control, returns selected item index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiComboBox(Rectangle bounds, string text, int count, int active);
// Dropdown Box control, returns selected item
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiDropdownBox(Rectangle bounds, string[] text, int count, int active);
// Spinner control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiSpinner(Rectangle bounds, int value, int maxValue, int btnWidth);
// Value Box control, updates input text with numbers
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiValueBox(Rectangle bounds, int value, int maxValue);
// Text Box control, updates input text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiTextBox(Rectangle bounds, StringBuilder text, int textSize, bool freeEdit);
// Text Box control with multiple lines
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiTextBoxMulti(Rectangle bounds, StringBuilder text, int textSize, bool editMode);
// Slider control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue);
// Slider control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
// Slider Bar control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue);
// Slider Bar control, returns selected value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiSliderBarEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
// Progress Bar control, shows current progress value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiProgressBar(Rectangle bounds, float value, float minValue, float maxValue);
// Progress Bar control, shows current progress value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float GuiProgressBarEx(Rectangle bounds, float value, float minValue, float maxValue, bool showValue);
// Status Bar control, shows info text
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiStatusBar(Rectangle bounds, string text, int offsetX);
// Dummy control for placeholders
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void GuiDummyRec(Rectangle bounds, string text);
// Advance controls set
// List View control, returns selected list element index
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GuiListView(Rectangle bounds, string text, int count, int active);
// Color Picker control
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Color GuiColorPicker(Rectangle bounds, Color color);
// Message Box control, displays a message
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool GuiMessageBox(Rectangle bounds, string windowTitle, string message);
}
}

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata minClientVersion="3.3.0">
<id>Raylib-cs</id>
<version>1.4</version>
<authors>mysterious_space</authors>
<owners>mysterious_space</owners>
<licenseUrl>https://github.com/ChrisDill/Raylib-cs/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/ChrisDill/Raylib-cs</projectUrl>
<iconUrl>https://github.com/ChrisDill/Raylib-cs/blob/master/Logo/raylib-cs.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>C# bindings for raylib, a simple and easy-to-use library to learn videogames programming.</description>
<copyright>Copyright 2018</copyright>
<tags>raylib csharp binding opengl gamedev</tags>
<contentFiles>
<files include="Easings.cs" buildAction="Content" />
<files include="Raygui.cs" buildAction="Content" />
<files include="Raymath.cs" buildAction="Content" />
<files include="Raylib.cs" buildAction="Content" />
</contentFiles>
</metadata>
<files>
<!-- <file src="Raylib.cs" target="contentFiles" /> -->
<file src="Raylib.cs" target="contentFiles" />
</files>
</package>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition=" '$(Platform)' == 'x64' ">
<Content Include="$(MSBuildThisFileDirectory)..\native\x64\raylib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>raylib.dll</Link>
</Content>
</ItemGroup>
<ItemGroup Condition=" '$(Platform)' == 'x86' OR '$(Platform)' == 'AnyCPU' ">
<Content Include="$(MSBuildThisFileDirectory)..\native\x86\raylib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>raylib.dll</Link>
</Content>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f660ff67-d70e-4ae0-9080-d922243e9b6e</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Raylib</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Easings.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Physac.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raygui.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raylib.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raymath.cs" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f660ff67-d70e-4ae0-9080-d922243e9b6e</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Raylib</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Easings.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Physac.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raygui.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raylib.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Raymath.cs" />
</ItemGroup>
</Project>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>f660ff67-d70e-4ae0-9080-d922243e9b6e</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Raylib.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>f660ff67-d70e-4ae0-9080-d922243e9b6e</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Raylib.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>

View File

@ -1,405 +1,405 @@
/* Raylib-cs
* Raymath.cs - Core bindings to raymth
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
// Vector2 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector2
{
public float x;
public float y;
}
// Vector3 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector3
{
public float x;
public float y;
public float z;
}
// Vector4 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector4
{
public float x;
public float y;
public float z;
public float w;
}
// Matrix type (OpenGL style 4x4 - right handed, column major)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Matrix
{
public float m0, m4, m8, m12;
public float m1, m5, m9, m13;
public float m2, m6, m10, m14;
public float m3, m7, m11, m15;
public override string ToString()
{
return $"Matrix({m0}, {m4}, {m8}, {m12}\n {m1}, {m5}, {m9}, {m13}\n {m2}, {m6}, {m10}, {m14}\n {m3}, {m7}, {m11}, {m15})";
}
}
// Quaternion type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Quaternion
{
public float x;
public float y;
public float z;
public float w;
public override string ToString()
{
return "Quaternion(" + x + " " + y + " " + z + " " + w + ")";
}
}
public static partial class Raylib
{
// Clamp float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Clamp(float value, float min, float max);
/// <summary>
/// Linearly interpolates between two values.
/// </summary>
/// <param name="value1">Source value.</param>
/// <param name="value2">Source value.</param>
/// <param name="amount">
/// Value between 0 and 1 indicating the weight of value2.
/// </param>
/// <returns>Interpolated value.</returns>
/// <remarks>
/// This method performs the linear interpolation based on the following formula.
/// <c>value1 + (value2 - value1) * amount</c>
/// Passing amount a value of 0 will cause value1 to be returned, a value of 1 will
/// cause value2 to be returned.
/// </remarks>
public static float Lerp(float value1, float value2, float amount)
{
return value1 + (value2 - value1) * amount;
}
// Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Zero();
// Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2One();
// Add two vectors (v1 + v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
// Subtract two vectors (v1 - v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
// Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Length(Vector2 v);
// Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
// Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
// Calculate angle from two vectors in X-axis
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
// Scale vector (multiply by value)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Scale(Vector2 v, float scale);
// Multiply vector by a vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Multiplyv(Vector2 v1, Vector2 v2);
// Negate vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Negate(Vector2 v);
// Divide vector by a float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Divide(Vector2 v, float div);
// Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2DivideV(Vector2 v1, Vector2 v2);
// Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Normalize(Vector2 v);
// Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Zero();
// Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3One();
// Add two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
// Substract two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
// Multiply vector by scalar
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Multiply(Vector3 v, float scalar);
// Multiply vector by vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2);
// Calculate two vectors cross product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
// Calculate one vector perpendicular vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Perpendicular(Vector3 v);
// Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Length(Vector3 v);
// Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
// Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
// Scale provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Scale(Vector3 v, float scale);
// Negate provided vector (invert direction)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Negate(Vector3 v);
// Divide vector by a float value
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Divide(Vector3 v, float div);
// Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3DivideV(Vector3 v1, Vector3 v2);
// Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Normalize(Vector3 v);
// Orthonormalize provided vectors
// Makes vectors normalized and orthogonal to each other
// Gram-Schmidt function implementation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void Vector3OrthoNormalize(out Vector3 v1, out Vector3 v2);
// Transforms a Vector3 by a given Matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat);
// Transform a vector by quaternion rotation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
// Calculate linear interpolation between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
// Calculate reflected vector to normal
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
// Return min value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
// Return max value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2);
// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
// NOTE: Assumes P is on the plane of the triangle
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
// Returns Vector3 as float array
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] Vector3ToFloatV(Vector3 v);
// Compute matrix determinant
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixDeterminant(Matrix mat);
// Returns the trace of the matrix (sum of the values along the diagonal)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixTrace(Matrix mat);
// Transposes provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranspose(Matrix mat);
// Invert provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixInvert(Matrix mat);
// Normalize provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixNormalize(Matrix mat);
// Returns identity matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixIdentity();
// Add two matrices
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixAdd(Matrix left, Matrix right);
// Substract two matrices (left - right)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixSubstract(Matrix left, Matrix right);
// Create rotation matrix from axis and angle
// NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranslate(float x, float y, float z);
// Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotate(Vector3 axis, float angle);
// Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateX(float angle);
// Returns y-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateY(float angle);
// Returns z-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateZ(float angle);
// Returns scaling matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixScale(float x, float y, float z);
// Returns two matrix multiplication
// NOTE: When multiplying matrices... the order matters!
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
// Returns perspective projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
// Returns perspective projection matrix
// NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
// Returns orthographic projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
// Returns camera look-at matrix (view matrix)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
// Returns float array of matrix data
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] MatrixToFloatV(Matrix mat);
// Returns identity quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionIdentity();
// Computes the length of a quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float QuaternionLength(Quaternion q);
// Normalize provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNormalize(Quaternion q);
// Invert provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionInvert(Quaternion q);
// Calculate two quaternion multiplication
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
// Calculate linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
// Calculate slerp-optimized interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
// Calculates spherical linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
// Calculate quaternion based on the rotation from one vector to another
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
// Returns a quaternion for a given rotation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromMatrix(Matrix mat);
// Returns a matrix for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix QuaternionToMatrix(Quaternion q);
// Returns rotation quaternion for an angle and axis
// NOTE: angle must be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
// Returns the rotation angle and axis for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void QuaternionToAxisAngle(Quaternion q, out Vector3 outAxis, float[] outAngle);
// Returns he quaternion equivalent to Euler angles
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromEuler(float roll, float pitch, float yaw);
// Return the Euler angles equivalent to quaternion (roll, pitch, yaw)
// NOTE: Angles are returned in a Vector3 struct in degrees
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 QuaternionToEuler(Quaternion q);
// Transform a quaternion given a transformation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat);
}
}
/* Raylib-cs
* Raymath.cs - Core bindings to raymth
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
using System;
using System.Runtime.InteropServices;
namespace Raylib
{
// Vector2 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector2
{
public float x;
public float y;
}
// Vector3 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector3
{
public float x;
public float y;
public float z;
}
// Vector4 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector4
{
public float x;
public float y;
public float z;
public float w;
}
// Matrix type (OpenGL style 4x4 - right handed, column major)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Matrix
{
public float m0, m4, m8, m12;
public float m1, m5, m9, m13;
public float m2, m6, m10, m14;
public float m3, m7, m11, m15;
public override string ToString()
{
return $"Matrix({m0}, {m4}, {m8}, {m12}\n {m1}, {m5}, {m9}, {m13}\n {m2}, {m6}, {m10}, {m14}\n {m3}, {m7}, {m11}, {m15})";
}
}
// Quaternion type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Quaternion
{
public float x;
public float y;
public float z;
public float w;
public override string ToString()
{
return "Quaternion(" + x + " " + y + " " + z + " " + w + ")";
}
}
public static partial class Raylib
{
// Clamp float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Clamp(float value, float min, float max);
/// <summary>
/// Linearly interpolates between two values.
/// </summary>
/// <param name="value1">Source value.</param>
/// <param name="value2">Source value.</param>
/// <param name="amount">
/// Value between 0 and 1 indicating the weight of value2.
/// </param>
/// <returns>Interpolated value.</returns>
/// <remarks>
/// This method performs the linear interpolation based on the following formula.
/// <c>value1 + (value2 - value1) * amount</c>
/// Passing amount a value of 0 will cause value1 to be returned, a value of 1 will
/// cause value2 to be returned.
/// </remarks>
public static float Lerp(float value1, float value2, float amount)
{
return value1 + (value2 - value1) * amount;
}
// Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Zero();
// Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2One();
// Add two vectors (v1 + v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
// Subtract two vectors (v1 - v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
// Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Length(Vector2 v);
// Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
// Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
// Calculate angle from two vectors in X-axis
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
// Scale vector (multiply by value)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Scale(Vector2 v, float scale);
// Multiply vector by a vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Multiplyv(Vector2 v1, Vector2 v2);
// Negate vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Negate(Vector2 v);
// Divide vector by a float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Divide(Vector2 v, float div);
// Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2DivideV(Vector2 v1, Vector2 v2);
// Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Normalize(Vector2 v);
// Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Zero();
// Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3One();
// Add two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
// Substract two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
// Multiply vector by scalar
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Multiply(Vector3 v, float scalar);
// Multiply vector by vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2);
// Calculate two vectors cross product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
// Calculate one vector perpendicular vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Perpendicular(Vector3 v);
// Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Length(Vector3 v);
// Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
// Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
// Scale provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Scale(Vector3 v, float scale);
// Negate provided vector (invert direction)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Negate(Vector3 v);
// Divide vector by a float value
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Divide(Vector3 v, float div);
// Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3DivideV(Vector3 v1, Vector3 v2);
// Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Normalize(Vector3 v);
// Orthonormalize provided vectors
// Makes vectors normalized and orthogonal to each other
// Gram-Schmidt function implementation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void Vector3OrthoNormalize(out Vector3 v1, out Vector3 v2);
// Transforms a Vector3 by a given Matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat);
// Transform a vector by quaternion rotation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
// Calculate linear interpolation between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
// Calculate reflected vector to normal
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
// Return min value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
// Return max value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2);
// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
// NOTE: Assumes P is on the plane of the triangle
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
// Returns Vector3 as float array
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] Vector3ToFloatV(Vector3 v);
// Compute matrix determinant
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixDeterminant(Matrix mat);
// Returns the trace of the matrix (sum of the values along the diagonal)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixTrace(Matrix mat);
// Transposes provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranspose(Matrix mat);
// Invert provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixInvert(Matrix mat);
// Normalize provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixNormalize(Matrix mat);
// Returns identity matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixIdentity();
// Add two matrices
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixAdd(Matrix left, Matrix right);
// Substract two matrices (left - right)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixSubstract(Matrix left, Matrix right);
// Create rotation matrix from axis and angle
// NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranslate(float x, float y, float z);
// Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotate(Vector3 axis, float angle);
// Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateX(float angle);
// Returns y-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateY(float angle);
// Returns z-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateZ(float angle);
// Returns scaling matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixScale(float x, float y, float z);
// Returns two matrix multiplication
// NOTE: When multiplying matrices... the order matters!
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
// Returns perspective projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
// Returns perspective projection matrix
// NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
// Returns orthographic projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
// Returns camera look-at matrix (view matrix)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
// Returns float array of matrix data
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] MatrixToFloatV(Matrix mat);
// Returns identity quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionIdentity();
// Computes the length of a quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float QuaternionLength(Quaternion q);
// Normalize provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNormalize(Quaternion q);
// Invert provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionInvert(Quaternion q);
// Calculate two quaternion multiplication
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
// Calculate linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
// Calculate slerp-optimized interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
// Calculates spherical linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
// Calculate quaternion based on the rotation from one vector to another
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
// Returns a quaternion for a given rotation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromMatrix(Matrix mat);
// Returns a matrix for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix QuaternionToMatrix(Quaternion q);
// Returns rotation quaternion for an angle and axis
// NOTE: angle must be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
// Returns the rotation angle and axis for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void QuaternionToAxisAngle(Quaternion q, out Vector3 outAxis, float[] outAngle);
// Returns he quaternion equivalent to Euler angles
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromEuler(float roll, float pitch, float yaw);
// Return the Euler angles equivalent to quaternion (roll, pitch, yaw)
// NOTE: Angles are returned in a Vector3 struct in degrees
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 QuaternionToEuler(Quaternion q);
// Transform a quaternion given a transformation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat);
}
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

View File

@ -185,29 +185,27 @@ namespace Generator
var TypeMap = new Dictionary<string, string>();
typesfile = typesfile.Where(x => x != "").ToArray();
Console.WriteLine("Enter the path to raylib.");
var raylibPath = Console.ReadLine() + "/src/";
var sources = new KeyValuePair<string, string>[] {
new KeyValuePair<string, string>( "raylib.h","RLAPI"),
// new KeyValuePair<string, string>("physac.h", "PHYSACDEF"),
// new KeyValuePair<string, string>( "easings.h","EASEDEF"),
// new KeyValuePair<string, string>( "raygui.h","RAYGUIDEF")
new KeyValuePair<string, string>("raylib.h","RLAPI"),
new KeyValuePair<string, string>("raymath.h", "RMDEF"),
new KeyValuePair<string, string>("physac.h", "PHYSACDEF"),
new KeyValuePair<string, string>( "easings.h","EASEDEF"),
new KeyValuePair<string, string>( "raygui.h","RAYGUIDEF")
};
foreach (var sourcefilenameandexporttag in sources)
foreach (var sourceAndExportTag in sources)
{
var functions = new List<string>();
var types = new HashSet<string>();
var enums = new HashSet<string>();
var Funcs = new List<Function>();
var sourcefilename = sourcefilenameandexporttag.Key;
var sourcefilename = sourceAndExportTag.Key;
var FileName = new CultureInfo("en-us", false).TextInfo.ToTitleCase(sourcefilename.Replace(".h", ""));
var ExportTag = sourcefilenameandexporttag.Value;
var sourcefile = File.ReadAllLines(sourcefilename);
var ExportTag = sourceAndExportTag.Value;
var sourcefile = File.ReadAllLines(raylibPath + sourcefilename);
var syntax = GetSyntax(sourcefile, ExportTag, TypeMap, typesfile);
GenerateBinding(syntax, FileName);
}
return;
}
// Takes the source from a raylib module and stores the syntax data
@ -708,6 +706,7 @@ namespace Generator
new[]{
Token(SyntaxKind.PublicKeyword),
Token(SyntaxKind.ConstKeyword)}));
RaylibClass = RaylibClass.AddMembers(LibraryNameField);
foreach (var Func in Funcs)
{
@ -784,6 +783,14 @@ namespace Generator
Console.WriteLine("Finished generating bindings for file ");
Console.ReadLine();
/* Raylib-cs
* Raylib.cs - Core bindings to raylib
* Copyright 2019 Chris Dill
*
* Release under zLib License.
* See LICENSE for details.
*/
}
}
}

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Generator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Generator")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0adeb5b1-bf57-4d45-be28-176c1d79c764")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

810
Generator/Raylib.cs Normal file
View File

@ -0,0 +1,810 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Security;
using System.Runtime.InteropServices;
namespace Raylib
{
[SuppressUnmanagedCodeSecurity]
public static partial class Raylib
{
public const string nativeLibName = "raylib";
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void InitWindow(int width, int height, IntPtr title);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool WindowShouldClose();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void CloseWindow();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsWindowReady();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsWindowMinimized();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsWindowResized();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsWindowHidden();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ToggleFullscreen();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnhideWindow();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void HideWindow();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowIcon(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowTitle(IntPtr title);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowPosition(int x, int y);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowMonitor(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowMinSize(int width, int height);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetWindowSize(int width, int height);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetWindowHandle();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetScreenWidth();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetScreenHeight();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorCount();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorWidth(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorHeight(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorPhysicalWidth(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorPhysicalHeight(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetMonitorName(int monitor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetClipboardText();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetClipboardText(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ShowCursor();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void HideCursor();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsCursorHidden();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EnableCursor();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DisableCursor();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearBackground(Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginDrawing();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndDrawing();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginMode2D(Camera2D camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndMode2D();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginMode3D(Camera3D camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndMode3D();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginTextureMode(RenderTexture2D target);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndTextureMode();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetWorldToScreen(Vector3 position, Camera3D camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix GetCameraMatrix(Camera3D camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTargetFPS(int fps);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetFPS();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetFrameTime();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern double GetTime();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int ColorToInt(Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector4 ColorNormalize(Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 ColorToHSV(Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color ColorFromHSV(Vector3 hsv);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color GetColor(int hexValue);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color Fade(Color color, float alpha);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetConfigFlags(byte flags);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTraceLogLevel(int logType);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTraceLogExit(int logType);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTraceLogCallback(TraceLogCallback callback);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void TraceLog(int logType, IntPtr text, params object[] args);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void TakeScreenshot(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetRandomValue(int min, int max);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool FileExists(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsFileExtension(IntPtr fileName, IntPtr ext);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetExtension(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetFileName(IntPtr filePath);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetFileNameWithoutExt(IntPtr filePath);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetDirectoryPath(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetWorkingDirectory();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetDirectoryFiles(IntPtr dirPath, IntPtr count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearDirectoryFiles();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool ChangeDirectory(IntPtr dir);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsFileDropped();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetDroppedFiles(IntPtr count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearDroppedFiles();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern long GetFileModTime(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void StorageSaveValue(int position, int value);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int StorageLoadValue(int position);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void OpenURL(IntPtr url);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsKeyPressed(int key);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsKeyDown(int key);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsKeyReleased(int key);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsKeyUp(int key);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetKeyPressed();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetExitKey(int key);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadAvailable(int gamepad);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadName(int gamepad, IntPtr name);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetGamepadName(int gamepad);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadButtonPressed(int gamepad, int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadButtonDown(int gamepad, int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadButtonReleased(int gamepad, int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGamepadButtonUp(int gamepad, int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetGamepadButtonPressed();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetGamepadAxisCount(int gamepad);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetGamepadAxisMovement(int gamepad, int axis);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsMouseButtonPressed(int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsMouseButtonDown(int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsMouseButtonReleased(int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsMouseButtonUp(int button);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMouseX();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMouseY();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetMousePosition();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMousePosition(int x, int y);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMouseOffset(int offsetX, int offsetY);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMouseScale(float scaleX, float scaleY);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMouseWheelMove();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTouchX();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTouchY();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetTouchPosition(int index);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetGesturesEnabled(uint gestureFlags);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsGestureDetected(int gesture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetGestureDetected();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTouchPointsCount();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetGestureHoldDuration();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetGestureDragVector();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetGestureDragAngle();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetGesturePinchVector();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetGesturePinchAngle();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetCameraMode(Camera3D camera, int mode);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateCamera(IntPtr camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetCameraPanControl(int panKey);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetCameraAltControl(int altKey);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetCameraSmoothZoomControl(int szKey);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPixel(int posX, int posY, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPixelV(Vector2 position, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircle(int centerX, int centerY, float radius, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircleV(Vector2 center, float radius, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircleLines(int centerX, int centerY, float radius, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangle(int posX, int posY, int width, int height, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleV(Vector2 position, Vector2 size, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleRec(Rectangle rec, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleLines(int posX, int posY, int width, int height, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPolyEx(IntPtr points, int numPoints, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPolyExLines(IntPtr points, int numPoints, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShapesTexture(Texture2D texture, Rectangle source);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image LoadImage(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image LoadImageEx(IntPtr pixels, int width, int height);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image LoadImagePro(IntPtr data, int width, int height, int format);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image LoadImageRaw(IntPtr fileName, int width, int height, int format, int headerSize);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportImage(Image image, IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportImageAsCode(Image image, IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D LoadTexture(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D LoadTextureFromImage(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D LoadTextureCubemap(Image image, int layoutType);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern RenderTexture2D LoadRenderTexture(int width, int height);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadImage(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadTexture(Texture2D texture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadRenderTexture(RenderTexture2D target);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetImageData(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetImageDataNormalized(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPixelDataSize(int width, int height, int format);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GetTextureData(Texture2D texture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GetScreenData();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateTexture(Texture2D texture, IntPtr pixels);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image ImageCopy(Image image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageToPOT(IntPtr image, Color fillColor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageFormat(IntPtr image, int newFormat);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageAlphaMask(IntPtr image, Image alphaMask);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageAlphaClear(IntPtr image, Color color, float threshold);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageAlphaCrop(IntPtr image, float threshold);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageAlphaPremultiply(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageCrop(IntPtr image, Rectangle crop);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageResize(IntPtr image, int newWidth, int newHeight);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageResizeNN(IntPtr image, int newWidth, int newHeight);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageResizeCanvas(IntPtr image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageMipmaps(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDither(IntPtr image, int rBpp, int gBpp, int bBpp, int aBpp);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr ImageExtractPalette(Image image, int maxPaletteSize, IntPtr extractCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image ImageText(IntPtr text, int fontSize, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image ImageTextEx(Font font, IntPtr text, float fontSize, float spacing, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDraw(IntPtr dst, Image src, Rectangle srcRec, Rectangle dstRec);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDrawRectangle(IntPtr dst, Rectangle rec, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDrawRectangleLines(IntPtr dst, Rectangle rec, int thick, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDrawText(IntPtr dst, Vector2 position, IntPtr text, int fontSize, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageDrawTextEx(IntPtr dst, Vector2 position, Font font, IntPtr text, float fontSize, float spacing, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageFlipVertical(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageFlipHorizontal(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageRotateCW(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageRotateCCW(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorTint(IntPtr image, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorInvert(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorGrayscale(IntPtr image);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorContrast(IntPtr image, float contrast);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorBrightness(IntPtr image, int brightness);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageColorReplace(IntPtr image, Color color, Color replace);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageColor(int width, int height, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageGradientV(int width, int height, Color top, Color bottom);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageGradientH(int width, int height, Color left, Color right);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageWhiteNoise(int width, int height, float factor);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageCellular(int width, int height, int tileSize);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GenTextureMipmaps(IntPtr texture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTextureFilter(Texture2D texture, int filterMode);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetTextureWrap(Texture2D texture, int wrapMode);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTexture(Texture2D texture, int posX, int posY, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Font GetFontDefault();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Font LoadFont(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Font LoadFontEx(IntPtr fileName, int fontSize, IntPtr fontChars, int charsCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Font LoadFontFromImage(Image image, Color key, int firstChar);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadFontData(IntPtr fileName, int fontSize, IntPtr fontChars, int charsCount, int type);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Image GenImageFontAtlas(IntPtr chars, int charsCount, int fontSize, int padding, int packMethod);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadFont(Font font);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawFPS(int posX, int posY);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawText(IntPtr text, int posX, int posY, int fontSize, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextEx(Font font, IntPtr text, Vector2 position, float fontSize, float spacing, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextRec(Font font, IntPtr text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawTextRecEx(Font font, IntPtr text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int MeasureText(IntPtr text, int fontSize);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 MeasureTextEx(Font font, IntPtr text, float fontSize, float spacing);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetGlyphIndex(Font font, int character);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool TextIsEqual(IntPtr text1, IntPtr text2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern unsigned int TextLength(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextFormat(IntPtr text, params object[] args);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextSubtext(IntPtr text, int position, int length);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextReplace(IntPtr text, IntPtr replace, IntPtr by);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextInsert(IntPtr text, IntPtr insert, int position);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextJoin(IntPtr textList, int count, IntPtr delimiter);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextSplit(IntPtr text, char delimiter, IntPtr count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void TextAppend(IntPtr text, IntPtr append, IntPtr position);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int TextFindIndex(IntPtr text, IntPtr find);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextToUpper(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextToLower(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr TextToPascal(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int TextToInteger(IntPtr text);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCube(Vector3 position, float width, float height, float length, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCubeV(Vector3 position, Vector3 size, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCubeWiresV(Vector3 position, Vector3 size, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSphere(Vector3 centerPos, float radius, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawPlane(Vector3 centerPos, Vector2 size, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawRay(Ray ray, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawGrid(int slices, float spacing);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawGizmo(Vector3 position);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Model LoadModel(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Model LoadModelFromMesh(Mesh mesh);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadModel(Model model);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadMeshes(IntPtr fileName, IntPtr meshCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportMesh(Mesh mesh, IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadMesh(IntPtr mesh);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadMaterials(IntPtr fileName, IntPtr materialCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Material LoadMaterialDefault();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadMaterial(Material material);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMaterialTexture(IntPtr material, int mapType, Texture2D texture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetModelMeshMaterial(IntPtr model, int meshId, int materialId);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadModelAnimations(IntPtr fileName, IntPtr animsCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateModelAnimation(Model model, ModelAnimation anim, int frame);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadModelAnimation(ModelAnimation anim);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsModelAnimationValid(Model model, ModelAnimation anim);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshPoly(int sides, float radius);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshPlane(float width, float length, int resX, int resZ);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshCube(float width, float height, float length);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshSphere(float radius, int rings, int slices);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshHemiSphere(float radius, int rings, int slices);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshCylinder(float radius, float height, int slices);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshTorus(float radius, float size, int radSeg, int sides);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshKnot(float radius, float size, int radSeg, int sides);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshHeightmap(Image heightmap, Vector3 size);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern BoundingBox MeshBoundingBox(Mesh mesh);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void MeshTangents(IntPtr mesh);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void MeshBinormals(IntPtr mesh);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawModel(Model model, Vector3 position, float scale, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawModelWires(Model model, Vector3 position, float scale, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawBoundingBox(BoundingBox box, Color color);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawBillboard(Camera3D camera, Texture2D texture, Vector3 center, float size, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawBillboardRec(Camera3D camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, IntPtr collisionPoint);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool CheckCollisionRayBox(Ray ray, BoundingBox box);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern RayHitInfo GetCollisionRayModel(Ray ray, IntPtr model);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadText(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Shader LoadShader(IntPtr vsFileName, IntPtr fsFileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Shader LoadShaderCode(IntPtr vsCode, IntPtr fsCode);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadShader(Shader shader);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Shader GetShaderDefault();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D GetTextureDefault();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetShaderLocation(Shader shader, IntPtr uniformName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShaderValue(Shader shader, int uniformLoc, IntPtr value, int uniformType);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShaderValueV(Shader shader, int uniformLoc, IntPtr value, int uniformType, int count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMatrixProjection(Matrix proj);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMatrixModelview(Matrix view);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix GetMatrixModelview();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Texture2D GenTextureBRDF(Shader shader, int size);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginShaderMode(Shader shader);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndShaderMode();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginBlendMode(int mode);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndBlendMode();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginScissorMode(int x, int y, int width, int height);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndScissorMode();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void InitVrSimulator();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void CloseVrSimulator();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateVrTracking(IntPtr camera);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetVrConfiguration(VrDeviceInfo info, Shader distortion);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsVrSimulatorReady();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ToggleVrMode();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void BeginVrDrawing();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void EndVrDrawing();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void InitAudioDevice();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void CloseAudioDevice();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsAudioDeviceReady();
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMasterVolume(float volume);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Wave LoadWave(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Wave LoadWaveEx(IntPtr data, int sampleCount, int sampleRate, int sampleSize, int channels);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Sound LoadSound(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Sound LoadSoundFromWave(Wave wave);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateSound(Sound sound, IntPtr data, int samplesCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadWave(Wave wave);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadSound(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportWave(Wave wave, IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportWaveAsCode(Wave wave, IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PlaySound(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PauseSound(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ResumeSound(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void StopSound(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsSoundPlaying(Sound sound);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetSoundVolume(Sound sound, float volume);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetSoundPitch(Sound sound, float pitch);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void WaveFormat(IntPtr wave, int sampleRate, int sampleSize, int channels);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Wave WaveCopy(Wave wave);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void WaveCrop(IntPtr wave, int initSample, int finalSample);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetWaveData(Wave wave);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Music LoadMusicStream(IntPtr fileName);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PlayMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void StopMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PauseMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ResumeMusicStream(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsMusicPlaying(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMusicVolume(Music music, float volume);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMusicPitch(Music music, float pitch);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetMusicLoopCount(Music music, int count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetMusicTimeLength(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float GetMusicTimePlayed(Music music);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern AudioStream InitAudioStream(uint sampleRate, uint sampleSize, uint channels);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UpdateAudioStream(AudioStream stream, IntPtr data, int samplesCount);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void CloseAudioStream(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsAudioBufferProcessed(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PlayAudioStream(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void PauseAudioStream(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ResumeAudioStream(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsAudioStreamPlaying(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void StopAudioStream(AudioStream stream);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetAudioStreamVolume(AudioStream stream, float volume);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetAudioStreamPitch(AudioStream stream, float pitch);
}
}

View File

@ -1,253 +0,0 @@
/*******************************************************************************************
*
* raylib easings (header only file)
*
* Useful easing functions for values animation
*
* This header uses:
* #define EASINGS_STATIC_INLINE // Inlines all functions code, so it runs faster.
* // This requires lots of memory on system.
* How to use:
* The four inputs t,b,c,d are defined as follows:
* t = current time (in any unit measure, but same unit as duration)
* b = starting value to interpolate
* c = the total change in value of b that needs to occur
* d = total time it should take to complete (duration)
*
* Example:
*
* int currentTime = 0;
* int duration = 100;
* float startPositionX = 0.0f;
* float finalPositionX = 30.0f;
* float currentPositionX = startPositionX;
*
* while (currentPositionX < finalPositionX)
* {
* currentPositionX = EaseSineIn(currentTime, startPositionX, finalPositionX - startPositionX, duration);
* currentTime++;
* }
*
* A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/)
*
* Robert Penner License
* ---------------------------------------------------------------------------------
* Open source under the BSD License.
*
* Copyright (c) 2001 Robert Penner. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the author nor the names of contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ---------------------------------------------------------------------------------
*
* Copyright (c) 2015 Ramon Santamaria
*
* This software is provided "as-is", without any express or implied warranty. In no event
* will the authors be held liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you
* wrote the original software. If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
* as being the original software.
*
* 3. This notice may not be removed or altered from any source distribution.
*
**********************************************************************************************/
#ifndef EASINGS_H
#define EASINGS_H
#define EASINGS_STATIC_INLINE // NOTE: By default, compile functions as static inline
#if defined(EASINGS_STATIC_INLINE)
#define EASEDEF static inline
#else
#define EASEDEF extern
#endif
#include <math.h> // Required for: sin(), cos(), sqrt(), pow()
#ifdef __cplusplus
extern "C" { // Prevents name mangling of functions
#endif
// Linear Easing functions
EASEDEF float EaseLinearNone(float t, float b, float c, float d) { return (c*t/d + b); }
EASEDEF float EaseLinearIn(float t, float b, float c, float d) { return (c*t/d + b); }
EASEDEF float EaseLinearOut(float t, float b, float c, float d) { return (c*t/d + b); }
EASEDEF float EaseLinearInOut(float t,float b, float c, float d) { return (c*t/d + b); }
// Sine Easing functions
EASEDEF float EaseSineIn(float t, float b, float c, float d) { return (-c*cos(t/d*(PI/2)) + c + b); }
EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sin(t/d*(PI/2)) + b); }
EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2*(cos(PI*t/d) - 1) + b); }
// Circular Easing functions
EASEDEF float EaseCircIn(float t, float b, float c, float d) { return (-c*(sqrt(1 - (t/=d)*t) - 1) + b); }
EASEDEF float EaseCircOut(float t, float b, float c, float d) { return (c*sqrt(1 - (t=t/d-1)*t) + b); }
EASEDEF float EaseCircInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (-c/2*(sqrt(1 - t*t) - 1) + b);
return (c/2*(sqrt(1 - t*(t-=2)) + 1) + b);
}
// Cubic Easing functions
EASEDEF float EaseCubicIn(float t, float b, float c, float d) { return (c*(t/=d)*t*t + b); }
EASEDEF float EaseCubicOut(float t, float b, float c, float d) { return (c*((t=t/d-1)*t*t + 1) + b); }
EASEDEF float EaseCubicInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (c/2*t*t*t + b);
return (c/2*((t-=2)*t*t + 2) + b);
}
// Quadratic Easing functions
EASEDEF float EaseQuadIn(float t, float b, float c, float d) { return (c*(t/=d)*t + b); }
EASEDEF float EaseQuadOut(float t, float b, float c, float d) { return (-c*(t/=d)*(t-2) + b); }
EASEDEF float EaseQuadInOut(float t, float b, float c, float d)
{
if ((t/=d/2) < 1) return (((c/2)*(t*t)) + b);
return (-c/2*(((t-2)*(--t)) - 1) + b);
}
// Exponential Easing functions
EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0) ? b : (c*pow(2, 10*(t/d - 1)) + b); }
EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-pow(2, -10*t/d) + 1) + b); }
EASEDEF float EaseExpoInOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if (t == d) return (b + c);
if ((t/=d/2) < 1) return (c/2*pow(2, 10*(t - 1)) + b);
return (c/2*(-pow(2, -10*--t) + 2) + b);
}
// Back Easing functions
EASEDEF float EaseBackIn(float t, float b, float c, float d)
{
float s = 1.70158f;
float postFix = t/=d;
return (c*(postFix)*t*((s + 1)*t - s) + b);
}
EASEDEF float EaseBackOut(float t, float b, float c, float d)
{
float s = 1.70158f;
return (c*((t=t/d-1)*t*((s + 1)*t + s) + 1) + b);
}
EASEDEF float EaseBackInOut(float t, float b, float c, float d)
{
float s = 1.70158f;
if ((t/=d/2) < 1) return (c/2*(t*t*(((s*=(1.525f)) + 1)*t - s)) + b);
float postFix = t-=2;
return (c/2*((postFix)*t*(((s*=(1.525f)) + 1)*t + s) + 2) + b);
}
// Bounce Easing functions
EASEDEF float EaseBounceOut(float t, float b, float c, float d)
{
if ((t/=d) < (1/2.75f))
{
return (c*(7.5625f*t*t) + b);
}
else if (t < (2/2.75f))
{
float postFix = t-=(1.5f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.75f) + b);
}
else if (t < (2.5/2.75))
{
float postFix = t-=(2.25f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.9375f) + b);
}
else
{
float postFix = t-=(2.625f/2.75f);
return (c*(7.5625f*(postFix)*t + 0.984375f) + b);
}
}
EASEDEF float EaseBounceIn(float t, float b, float c, float d) { return (c - EaseBounceOut(d-t, 0, c, d) + b); }
EASEDEF float EaseBounceInOut(float t, float b, float c, float d)
{
if (t < d/2) return (EaseBounceIn(t*2, 0, c, d)*0.5f + b);
else return (EaseBounceOut(t*2-d, 0, c, d)*0.5f + c*0.5f + b);
}
// Elastic Easing functions
EASEDEF float EaseElasticIn(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d) == 1) return (b + c);
float p = d*0.3f;
float a = c;
float s = p/4;
float postFix = a*pow(2, 10*(t-=1));
return (-(postFix*sin((t*d-s)*(2*PI)/p )) + b);
}
EASEDEF float EaseElasticOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d) == 1) return (b + c);
float p = d*0.3f;
float a = c;
float s = p/4;
return (a*pow(2,-10*t)*sin((t*d-s)*(2*PI)/p) + c + b);
}
EASEDEF float EaseElasticInOut(float t, float b, float c, float d)
{
if (t == 0) return b;
if ((t/=d/2) == 2) return (b + c);
float p = d*(0.3f*1.5f);
float a = c;
float s = p/4;
if (t < 1)
{
float postFix = a*pow(2, 10*(t-=1));
return -0.5f*(postFix*sin((t*d-s)*(2*PI)/p)) + b;
}
float postFix = a*pow(2, -10*(t-=1));
return (postFix*sin((t*d-s)*(2*PI)/p)*0.5f + c + b);
}
#ifdef __cplusplus
}
#endif
#endif // EASINGS_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
Generator/raylib-cs.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

File diff suppressed because it is too large Load Diff

0
Generator/types.txt Normal file
View File

117
README.md
View File

@ -1,55 +1,62 @@
![Raylib-cs Logo](https://github.com/ChrisDill/Raylib-cs/blob/master/Logo/raylib-cs_256x256.png "Raylib-cs Logo")
# Raylib-cs
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
# Installation
So far, I have only tested on Windows. Tips on making things work smoothly on all platforms is appreciated.
1. Add the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
2. Start coding!
```csharp
using Raylib;
using rl = Raylib.Raylib;
static class Program
{
public static void Main()
{
rl.InitWindow(640, 480, "Hello World");
while (!rl.WindowShouldClose())
{
rl.BeginDrawing();
rl.ClearBackground(Color.WHITE);
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);
rl.EndDrawing();
}
rl.CloseWindow();
}
}
```
# Tech notes
- Enums are passed as `int` to prevent the need for explicit casts.
- Color defines stored inside `Color`.
- Uses `string.Format` in place of `TextFormat`.
# Extras
- Structs have constructors.
- Operator overloading for math types.
# Contributing
If you have any ideas, feel free to open an issue and tell me what you think.
If you'd like to contribute, please fork the repository and make changes as
you'd like. Pull requests are warmly welcome.
If you want to [request features](https://github.com/raysan5/raylib/pulls) or [report bugs](https://github.com/raysan5/raylib/issues) related to the library (in contrast to this binding), please refer to the [author's project repo](https://github.com/raysan5/raylib).
# License
raylib-cs (and raylib) is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.
![Raylib-cs Logo](https://github.com/ChrisDill/Raylib-cs/blob/master/Logo/raylib-cs_256x256.png "Raylib-cs Logo")
# Raylib-cs
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
# Installation
So far, I have only done a few tests on Windows and Linux.
## Package
1. Install the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
2. Start coding!
## Manual
1. Copy or reference the bindings into your project. See Tests for reference.
2. Make sure your project finds the native library that matches your platform and configuration.
3. Start coding!
```csharp
using Raylib;
using rl = Raylib.Raylib;
static class Program
{
public static void Main()
{
rl.InitWindow(640, 480, "Hello World");
while (!rl.WindowShouldClose())
{
rl.BeginDrawing();
rl.ClearBackground(Color.WHITE);
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);
rl.EndDrawing();
}
rl.CloseWindow();
}
}
```
# Tech notes
- Enums are passed as `int` to prevent the need for explicit casts.
- Color defines stored inside `Color`.
- Uses `string.Format` in place of `TextFormat`.
- Structs have constructors.
- Operator overloads for math types.
# Contributing
If you have any ideas, feel free to open an issue and tell me what you think.
If you'd like to contribute, please fork the repository and make changes as
you'd like. Pull requests are warmly welcome.
If you want to [request features](https://github.com/raysan5/raylib/pulls) or [report bugs](https://github.com/raysan5/raylib/issues) related to the library (in contrast to this binding), please refer to the [author's project repo](https://github.com/raysan5/raylib).
# License
raylib-cs (and raylib) is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.

View File

@ -1,85 +1,85 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Examples", "Examples\Examples.shproj", "{36E54E2A-5899-4D4D-9D78-120DB1B4C7B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "Generator\Generator.csproj", "{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCore", "Tests\Test.NetCore\Test.NetCore.csproj", "{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCoreRT", "Tests\Test.NetCoreRT\Test.NetCoreRT.csproj", "{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NetFX", "Tests\Test.NetFX\Test.NetFX.csproj", "{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Raylib", "Bindings\Raylib.shproj", "{F660FF67-D70E-4AE0-9080-D922243E9B6E}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Examples\Examples.projitems*{36e54e2a-5899-4d4d-9d78-120db1b4c7b2}*SharedItemsImports = 13
Bindings\Raylib.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4
Examples\Examples.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4
Bindings\Raylib.projitems*{f660ff67-d70e-4ae0-9080-d922243e9b6e}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x64.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x86.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|Any CPU.Build.0 = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x64.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x64.Build.0 = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x86.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x86.Build.0 = Release|Any CPU
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|Any CPU.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x64.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x64.Build.0 = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x86.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|Any CPU.ActiveCfg = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x64.ActiveCfg = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x64.Build.0 = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x86.ActiveCfg = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x64.ActiveCfg = Debug|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x64.Build.0 = Debug|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x86.ActiveCfg = Debug|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x86.Build.0 = Debug|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|Any CPU.Build.0 = Release|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x64.ActiveCfg = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x64.Build.0 = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x86.ActiveCfg = Release|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x86.Build.0 = Release|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x64.ActiveCfg = Debug|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x64.Build.0 = Debug|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x86.ActiveCfg = Debug|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x86.Build.0 = Debug|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|Any CPU.Build.0 = Release|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x64.ActiveCfg = Release|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x64.Build.0 = Release|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.ActiveCfg = Release|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {78DCF9A2-1328-489A-8B03-F0BFB29EC58F}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Examples", "Examples\Examples.shproj", "{36E54E2A-5899-4D4D-9D78-120DB1B4C7B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "Generator\Generator.csproj", "{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCore", "Tests\Test.NetCore\Test.NetCore.csproj", "{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCoreRT", "Tests\Test.NetCoreRT\Test.NetCoreRT.csproj", "{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NetFX", "Tests\Test.NetFX\Test.NetFX.csproj", "{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Raylib", "Bindings\Raylib.shproj", "{F660FF67-D70E-4AE0-9080-D922243E9B6E}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Examples\Examples.projitems*{36e54e2a-5899-4d4d-9d78-120db1b4c7b2}*SharedItemsImports = 13
Bindings\Raylib.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4
Examples\Examples.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4
Bindings\Raylib.projitems*{f660ff67-d70e-4ae0-9080-d922243e9b6e}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x64.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x86.Build.0 = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|Any CPU.Build.0 = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x64.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x64.Build.0 = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x86.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x86.Build.0 = Release|Any CPU
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|Any CPU.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x64.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x64.Build.0 = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x86.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|Any CPU.ActiveCfg = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x64.ActiveCfg = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x64.Build.0 = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x86.ActiveCfg = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x64.ActiveCfg = Debug|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x64.Build.0 = Debug|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x86.ActiveCfg = Debug|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x86.Build.0 = Debug|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|Any CPU.Build.0 = Release|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x64.ActiveCfg = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x64.Build.0 = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x86.ActiveCfg = Release|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x86.Build.0 = Release|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x64.ActiveCfg = Debug|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x64.Build.0 = Debug|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x86.ActiveCfg = Debug|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x86.Build.0 = Debug|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|Any CPU.Build.0 = Release|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x64.ActiveCfg = Release|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x64.Build.0 = Release|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.ActiveCfg = Release|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {78DCF9A2-1328-489A-8B03-F0BFB29EC58F}
EndGlobalSection
EndGlobal

View File

@ -1,11 +1,11 @@

namespace Test.NetCore
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

namespace Test.NetCore
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

View File

@ -1,34 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<StartupObject>physics_demo</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>false</Optimize>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>true</Prefer32Bit>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
<Target Name="TestTarget" AfterTargets="Build">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<!-- <StartupObject>Test.NetCore.Program</StartupObject> -->
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>false</Optimize>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>true</Prefer32Bit>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
<Target Name="TestTarget" AfterTargets="Build">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
</Project>

View File

@ -1,11 +1,11 @@

namespace Test.NetCoreRT
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

namespace Test.NetCoreRT
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

View File

@ -1,34 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
<Platforms>AnyCPU;x64;x86</Platforms>
<StartupObject>core_basic_window</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-27217-01" />
</ItemGroup>
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
<Target Name="TestTarget" AfterTargets="Build">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
<Platforms>AnyCPU;x64;x86</Platforms>
<StartupObject>core_basic_window</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-27217-01" />
</ItemGroup>
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
<Target Name="TestTarget" AfterTargets="Build">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
</Project>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

View File

@ -1,11 +1,11 @@

namespace Test.NetFX
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

namespace Test.NetFX
{
class Program
{
static void Main(string[] args)
{
Examples.Test.Run(args);
}
}
}

View File

@ -1,36 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Test.NetFX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test.NetFX")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("55d7bb37-3dc7-4a33-b21e-4f549ec988b5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Test.NetFX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test.NetFX")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("55d7bb37-3dc7-4a33-b21e-4f549ec988b5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,99 +1,99 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Raylib;
using rl = Raylib.Raylib;
using Color = Raylib.Color;
namespace Test.NetFX
{
public partial class RayForms : Form
{
private Panel gamePanel;
private bool windowAttached = false;
#region WinAPI Entry Points
[DllImport("user32.dll")]
private static extern IntPtr SetWindowPos(IntPtr handle, IntPtr handleAfter, int x, int y, int cx, int cy, uint flags);
[DllImport("user32.dll")]
private static extern IntPtr SetParent(IntPtr child, IntPtr newParent);
[DllImport("user32.dll")]
private static extern IntPtr ShowWindow(IntPtr handle, int command);
#endregion
public RayForms()
{
Size = new Size(1024, 700);
Text = "Rayforms";
gamePanel = new Panel();
gamePanel.Size = new Size(800, 500);
gamePanel.Location = new Point(50, 50);
Button button = new Button();
button.Text = "Attach window";
button.Size = new Size(150, 20);
button.Location = new Point(
(Size.Width / 2) - (button.Size.Width / 2),
gamePanel.Location.Y + gamePanel.Size.Height + 10
);
button.Click += new EventHandler(ClickedButton);
Controls.Add(button);
Controls.Add(gamePanel);
}
private void ClickedButton(object sender, EventArgs e)
{
if (!windowAttached)
{
// new Thread(Test).Start();
Test();
}
}
private void Test()
{
rl.SetConfigFlags(ConfigFlag.FLAG_WINDOW_UNDECORATED);
rl.InitWindow(800, 480, "Rayforms test");
rl.SetTargetFPS(60);
IntPtr winHandle = rl.GetWindowHandle();
Invoke(new Action(() =>
{
SetWindowPos(winHandle, Handle, 0, 0, 0, 0, 0x0401 /*NOSIZE | SHOWWINDOW */);
SetParent(winHandle, gamePanel.Handle);
ShowWindow(winHandle, 1);
windowAttached = true;
}));
while (!rl.WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
rl.BeginDrawing();
rl.ClearBackground(Color.RAYWHITE);
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, Color.MAROON);
rl.DrawText(rl.GetFrameTime().ToString(), 100, 10, 15, Color.MAROON);
rl.DrawFPS(10, 10);
rl.EndDrawing();
//----------------------------------------------------------------------------------
}
rl.CloseWindow();
}
public static void Run()
{
Application.Run(new RayForms());
}
}
}
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Raylib;
using rl = Raylib.Raylib;
using Color = Raylib.Color;
namespace Test.NetFX
{
public partial class RayForms : Form
{
private Panel gamePanel;
private bool windowAttached = false;
#region WinAPI Entry Points
[DllImport("user32.dll")]
private static extern IntPtr SetWindowPos(IntPtr handle, IntPtr handleAfter, int x, int y, int cx, int cy, uint flags);
[DllImport("user32.dll")]
private static extern IntPtr SetParent(IntPtr child, IntPtr newParent);
[DllImport("user32.dll")]
private static extern IntPtr ShowWindow(IntPtr handle, int command);
#endregion
public RayForms()
{
Size = new Size(1024, 700);
Text = "Rayforms";
gamePanel = new Panel();
gamePanel.Size = new Size(800, 500);
gamePanel.Location = new Point(50, 50);
Button button = new Button();
button.Text = "Attach window";
button.Size = new Size(150, 20);
button.Location = new Point(
(Size.Width / 2) - (button.Size.Width / 2),
gamePanel.Location.Y + gamePanel.Size.Height + 10
);
button.Click += new EventHandler(ClickedButton);
Controls.Add(button);
Controls.Add(gamePanel);
}
private void ClickedButton(object sender, EventArgs e)
{
if (!windowAttached)
{
// new Thread(Test).Start();
Test();
}
}
private void Test()
{
rl.SetConfigFlags(ConfigFlag.FLAG_WINDOW_UNDECORATED);
rl.InitWindow(800, 480, "Rayforms test");
rl.SetTargetFPS(60);
IntPtr winHandle = rl.GetWindowHandle();
Invoke(new Action(() =>
{
SetWindowPos(winHandle, Handle, 0, 0, 0, 0, 0x0401 /*NOSIZE | SHOWWINDOW */);
SetParent(winHandle, gamePanel.Handle);
ShowWindow(winHandle, 1);
windowAttached = true;
}));
while (!rl.WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
rl.BeginDrawing();
rl.ClearBackground(Color.RAYWHITE);
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, Color.MAROON);
rl.DrawText(rl.GetFrameTime().ToString(), 100, 10, 15, Color.MAROON);
rl.DrawFPS(10, 10);
rl.EndDrawing();
//----------------------------------------------------------------------------------
}
rl.CloseWindow();
}
public static void Run()
{
Application.Run(new RayForms());
}
}
}

View File

@ -1,126 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Test.NetFX</RootNamespace>
<AssemblyName>Test.NetFX</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Test.NetFX.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RayForm.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Memory">
<Version>4.5.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="raylib-cs.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Test.NetFX</RootNamespace>
<AssemblyName>Test.NetFX</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Test.NetFX.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RayForm.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Memory">
<Version>4.5.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Content Include="raylib-cs.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="..\..\Examples\Examples.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy Condition=" '$(Platform)' == 'x86' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'AnyCPU' " SourceFiles="..\..\Bindings\native\x86\raylib.dll" DestinationFolder="$(TargetDir)" />
<Copy Condition=" '$(Platform)' == 'x64' " SourceFiles="..\..\Bindings\native\x64\raylib.dll" DestinationFolder="$(TargetDir)" />
</Target>
<Import Project="..\..\Bindings\Raylib.projitems" Label="Shared" />
</Project>