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 # User defined
# Created by https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio # Created by https://www.gitignore.io/api/git,linux,csharp,windows,visualstudio
### Csharp ### ### Csharp ###
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
## ##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Binaries .vscode/
![Bb]in/
# Binaries
# User-specific files ![Bb]in/
*.suo
*.user # User-specific files
*.userosscache *.suo
*.sln.docstates *.user
*.exe *.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio) *.exe
*.userprefs
# User-specific files (MonoDevelop/Xamarin Studio)
# Build results *.userprefs
[Bb]in/
[Dd]ebugPublic/ # Build results
[Rr]elease/ [Bb]in/
[Rr]eleases/ [Dd]ebugPublic/
[Bb]uild/ [Rr]elease/
[Dd]ebug [Rr]eleases/
[Oo]bj/ [Bb]uild/
[Ll]og/ [Dd]ebug
[Oo]bj/
# Visual Studio 2015 cache/options directory [Ll]og/
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot # Visual Studio 2015 cache/options directory
#wwwroot/ .vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
# MSTest test Results #wwwroot/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.* # MSTest test Results
[Tt]est[Rr]esult*/
# NUNIT [Bb]uild[Ll]og.*
*.VisualState.xml
TestResult.xml # NUNIT
*.VisualState.xml
# Build Results of an ATL Project TestResult.xml
[Dd]ebugPS/
[Rr]eleasePS/ # Build Results of an ATL Project
dlldata.c [Dd]ebugPS/
[Rr]eleasePS/
# .NET Core dlldata.c
project.lock.json
project.fragment.lock.json # .NET Core
artifacts/ project.lock.json
**/Properties/launchSettings.json project.fragment.lock.json
artifacts/
*_i.c **/Properties/launchSettings.json
*_p.c
*_i.h *_i.c
*.ilk *_p.c
*.meta *_i.h
*.pch *.ilk
# *.pdb *.meta
*.pgc *.pch
*.pgd # *.pdb
*.rsp *.pgc
*.sbr *.pgd
*.tlb *.rsp
*.tli *.sbr
*.tlh *.tlb
*.tmp *.tli
*.tmp_proj *.tlh
*.log *.tmp
*.vspscc *.tmp_proj
*.vssscc *.log
.builds *.vspscc
*.pidb *.vssscc
*.svclog .builds
*.scc *.pidb
*.svclog
# Chutzpah Test files *.scc
_Chutzpah*
# Chutzpah Test files
# Visual C++ cache files _Chutzpah*
ipch/
*.aps # Visual C++ cache files
*.ncb ipch/
*.opendb *.aps
*.opensdf *.ncb
*.sdf *.opendb
*.cachefile *.opensdf
*.VC.db *.sdf
*.VC.VC.opendb *.cachefile
*.VC.db
# Visual Studio profiler *.VC.VC.opendb
*.psess
*.vsp # Visual Studio profiler
*.vspx *.psess
*.sap *.vsp
*.vspx
# TFS 2012 Local Workspace *.sap
$tf/
# TFS 2012 Local Workspace
# Guidance Automation Toolkit $tf/
*.gpState
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in *.gpState
_ReSharper*/
*.[Rr]e[Ss]harper # ReSharper is a .NET coding add-in
*.DotSettings.user _ReSharper*/
*.[Rr]e[Ss]harper
# JustCode is a .NET coding add-in *.DotSettings.user
.JustCode
# JustCode is a .NET coding add-in
# TeamCity is a build add-in .JustCode
_TeamCity*
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool _TeamCity*
*.dotCover
# DotCover is a Code Coverage Tool
# Visual Studio code coverage results *.dotCover
*.coverage
*.coveragexml # Visual Studio code coverage results
*.coverage
# NCrunch *.coveragexml
_NCrunch_*
.*crunch*.local.xml # NCrunch
nCrunchTemp_* _NCrunch_*
.*crunch*.local.xml
# MightyMoose nCrunchTemp_*
*.mm.*
AutoTest.Net/ # MightyMoose
*.mm.*
# Web workbench (sass) AutoTest.Net/
.sass-cache/
# Web workbench (sass)
# Installshield output folder .sass-cache/
[Ee]xpress/
# Installshield output folder
# DocProject is a documentation generator add-in [Ee]xpress/
DocProject/buildhelp/
DocProject/Help/*.HxT # DocProject is a documentation generator add-in
DocProject/Help/*.HxC DocProject/buildhelp/
DocProject/Help/*.hhc DocProject/Help/*.HxT
DocProject/Help/*.hhk DocProject/Help/*.HxC
DocProject/Help/*.hhp DocProject/Help/*.hhc
DocProject/Help/Html2 DocProject/Help/*.hhk
DocProject/Help/html DocProject/Help/*.hhp
DocProject/Help/Html2
# Click-Once directory DocProject/Help/html
publish/
# Click-Once directory
# Publish Web Output publish/
*.[Pp]ublish.xml
*.azurePubxml # Publish Web Output
# TODO: Uncomment the next line to ignore your web deploy settings. *.[Pp]ublish.xml
# By default, sensitive information, such as encrypted password *.azurePubxml
# should be stored in the .pubxml.user file. # TODO: Uncomment the next line to ignore your web deploy settings.
#*.pubxml # By default, sensitive information, such as encrypted password
*.pubxml.user # should be stored in the .pubxml.user file.
*.publishproj #*.pubxml
*.pubxml.user
# Microsoft Azure Web App publish settings. Comment the next line if you want to *.publishproj
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted # Microsoft Azure Web App publish settings. Comment the next line if you want to
PublishScripts/ # checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages PublishScripts/
*.nupkg
# The packages folder can be ignored because of Package Restore # NuGet Packages
**/packages/* *.nupkg
# except build/, which is used as an MSBuild target. # The packages folder can be ignored because of Package Restore
!**/packages/build/ **/packages/*
# Uncomment if necessary however generally it will be regenerated when needed # except build/, which is used as an MSBuild target.
#!**/packages/repositories.config !**/packages/build/
# NuGet v3's project.json files produces more ignorable files # Uncomment if necessary however generally it will be regenerated when needed
*.nuget.props #!**/packages/repositories.config
*.nuget.targets # NuGet v3's project.json files produces more ignorable files
*.nuget.props
# Microsoft Azure Build Output *.nuget.targets
csx/
*.build.csdef # Microsoft Azure Build Output
csx/
# Microsoft Azure Emulator *.build.csdef
ecf/
rcf/ # Microsoft Azure Emulator
ecf/
# Windows Store app package directories and files rcf/
AppPackages/
BundleArtifacts/ # Windows Store app package directories and files
Package.StoreAssociation.xml AppPackages/
_pkginfo.txt BundleArtifacts/
Package.StoreAssociation.xml
# Visual Studio cache files _pkginfo.txt
# files ending in .cache can be ignored
*.[Cc]ache # Visual Studio cache files
# but keep track of directories ending in .cache # files ending in .cache can be ignored
!*.[Cc]ache/ *.[Cc]ache
# but keep track of directories ending in .cache
# Others !*.[Cc]ache/
ClientBin/
~$* # Others
*~ ClientBin/
*.dbmdl ~$*
*.dbproj.schemaview *~
*.jfm *.dbmdl
*.pfx *.dbproj.schemaview
*.publishsettings *.jfm
orleans.codegen.cs *.pfx
*.publishsettings
# Since there are multiple workflows, uncomment next line to ignore bower_components orleans.codegen.cs
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/ # Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects #bower_components/
Generated_Code/
# RIA/Silverlight projects
# Backup & report files from converting an old project file Generated_Code/
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-) # Backup & report files from converting an old project file
_UpgradeReport_Files/ # to a newer Visual Studio version. Backup files are not needed,
Backup*/ # because we have git ;-)
UpgradeLog*.XML _UpgradeReport_Files/
UpgradeLog*.htm Backup*/
UpgradeLog*.XML
# SQL Server files UpgradeLog*.htm
*.mdf
*.ldf # SQL Server files
*.ndf *.mdf
*.ldf
# Business Intelligence projects *.ndf
*.rdl.data
*.bim.layout # Business Intelligence projects
*.bim_*.settings *.rdl.data
*.bim.layout
# Microsoft Fakes *.bim_*.settings
FakesAssemblies/
# Microsoft Fakes
# GhostDoc plugin setting file FakesAssemblies/
*.GhostDoc.xml
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio *.GhostDoc.xml
.ntvs_analysis.dat
node_modules/ # Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Typescript v1 declaration files node_modules/
typings/
# Typescript v1 declaration files
# Visual Studio 6 build log typings/
*.plg
# Visual Studio 6 build log
# Visual Studio 6 workspace options file *.plg
*.opt
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.opt
*.vbw
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio LightSwitch build output *.vbw
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts # Visual Studio LightSwitch build output
**/*.DesktopClient/ModelManifest.xml **/*.HTMLClient/GeneratedArtifacts
**/*.Server/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts
**/*.Server/ModelManifest.xml **/*.DesktopClient/ModelManifest.xml
_Pvt_Extensions **/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
# Paket dependency manager _Pvt_Extensions
.paket/paket.exe
paket-files/ # Paket dependency manager
.paket/paket.exe
# FAKE - F# Make paket-files/
.fake/
# FAKE - F# Make
# JetBrains Rider .fake/
.idea/
*.sln.iml # JetBrains Rider
.idea/
# CodeRush *.sln.iml
.cr/
# CodeRush
# Python Tools for Visual Studio (PTVS) .cr/
__pycache__/
*.pyc # Python Tools for Visual Studio (PTVS)
__pycache__/
# Cake - Uncomment if you are using it *.pyc
# tools/**
# !tools/packages.config # Cake - Uncomment if you are using it
# tools/**
# Telerik's JustMock configuration file # !tools/packages.config
*.jmconfig
# Telerik's JustMock configuration file
# BizTalk build output *.jmconfig
*.btp.cs
*.btm.cs # BizTalk build output
*.odx.cs *.btp.cs
*.xsd.cs *.btm.cs
*.odx.cs
### Git ### *.xsd.cs
*.orig
### Git ###
### Linux ### *.orig
# temporary files which can be created if a process still has a handle open of a deleted file ### Linux ###
.fuse_hidden*
# temporary files which can be created if a process still has a handle open of a deleted file
# KDE directory preferences .fuse_hidden*
.directory
# KDE directory preferences
# Linux trash folder which might appear on any partition or disk .directory
.Trash-*
# Linux trash folder which might appear on any partition or disk
# .nfs files are created when an open file is removed but is still being accessed .Trash-*
.nfs*
# .nfs files are created when an open file is removed but is still being accessed
### Windows ### .nfs*
# Windows thumbnail cache files
Thumbs.db ### Windows ###
ehthumbs.db # Windows thumbnail cache files
ehthumbs_vista.db Thumbs.db
ehthumbs.db
# Folder config file ehthumbs_vista.db
Desktop.ini
# Folder config file
# Recycle Bin used on file shares Desktop.ini
$RECYCLE.BIN/
# Recycle Bin used on file shares
# Windows Installer files $RECYCLE.BIN/
*.cab
*.msi # Windows Installer files
*.msm *.cab
*.msp *.msi
*.msm
# Windows shortcuts *.msp
*.lnk
# Windows shortcuts
### VisualStudio ### *.lnk
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ### VisualStudio ###
## ## Ignore Visual Studio temporary files, build results, and
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ## files generated by popular Visual Studio add-ons.
##
# User-specific files ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files (MonoDevelop/Xamarin Studio) # User-specific files
# Build results # User-specific files (MonoDevelop/Xamarin Studio)
# Visual Studio 2015 cache/options directory # Build results
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/ # Visual Studio 2015 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
# MSTest test Results #wwwroot/
# NUNIT # MSTest test Results
# Build Results of an ATL Project # NUNIT
# .NET Core # Build Results of an ATL Project
# .NET Core
# Chutzpah Test files
# Visual C++ cache files # Chutzpah Test files
# Visual Studio profiler # Visual C++ cache files
# TFS 2012 Local Workspace # Visual Studio profiler
# Guidance Automation Toolkit # TFS 2012 Local Workspace
# ReSharper is a .NET coding add-in # Guidance Automation Toolkit
# JustCode is a .NET coding add-in # ReSharper is a .NET coding add-in
# TeamCity is a build add-in # JustCode is a .NET coding add-in
# DotCover is a Code Coverage Tool # TeamCity is a build add-in
# Visual Studio code coverage results # DotCover is a Code Coverage Tool
# NCrunch # Visual Studio code coverage results
# MightyMoose # NCrunch
# Web workbench (sass) # MightyMoose
# Installshield output folder # Web workbench (sass)
# DocProject is a documentation generator add-in # Installshield output folder
# Click-Once directory # DocProject is a documentation generator add-in
# Publish Web Output # Click-Once directory
# TODO: Uncomment the next line to ignore your web deploy settings.
# By default, sensitive information, such as encrypted password # Publish Web Output
# should be stored in the .pubxml.user file. # TODO: Uncomment the next line to ignore your web deploy settings.
#*.pubxml # By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file.
# Microsoft Azure Web App publish settings. Comment the next line if you want to #*.pubxml
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted # 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
# NuGet Packages # in these scripts will be unencrypted
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target. # NuGet Packages
# Uncomment if necessary however generally it will be regenerated when needed # The packages folder can be ignored because of Package Restore
#!**/packages/repositories.config # except build/, which is used as an MSBuild target.
# NuGet v3's project.json files produces more ignorable files # Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Microsoft Azure Build Output # NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Emulator # Microsoft Azure Build Output
# Windows Store app package directories and files # Microsoft Azure Emulator
# Visual Studio cache files # Windows Store app package directories and files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache # Visual Studio cache files
# files ending in .cache can be ignored
# Others # but keep track of directories ending in .cache
# Since there are multiple workflows, uncomment next line to ignore bower_components # Others
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/ # Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects #bower_components/
# Backup & report files from converting an old project file # RIA/Silverlight projects
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-) # Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# SQL Server files # because we have git ;-)
# Business Intelligence projects # SQL Server files
# Microsoft Fakes # Business Intelligence projects
# GhostDoc plugin setting file # Microsoft Fakes
# Node.js Tools for Visual Studio # GhostDoc plugin setting file
# Typescript v1 declaration files # Node.js Tools for Visual Studio
# Visual Studio 6 build log # Typescript v1 declaration files
# Visual Studio 6 workspace options file # Visual Studio 6 build log
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) # Visual Studio 6 workspace options file
# Visual Studio LightSwitch build output # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Paket dependency manager # Visual Studio LightSwitch build output
# FAKE - F# Make # Paket dependency manager
# JetBrains Rider # FAKE - F# Make
# CodeRush # JetBrains Rider
# Python Tools for Visual Studio (PTVS) # CodeRush
# Cake - Uncomment if you are using it # Python Tools for Visual Studio (PTVS)
# tools/**
# !tools/packages.config # Cake - Uncomment if you are using it
# tools/**
# Telerik's JustMock configuration file # !tools/packages.config
# BizTalk build output # Telerik's JustMock configuration file
### VisualStudio Patch ### # BizTalk build output
# By default, sensitive information, such as encrypted password
# should be stored in the .pubxml.user file. ### 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 # 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 /* Raylib-cs
* Easings.cs - Useful easing functions for values animation * Easings.cs - Useful easing functions for values animation
* Copyright 2019 Chris Dill * Copyright 2019 Chris Dill
* *
* Release under zLib License. * Release under zLib License.
* See LICENSE for details. * See LICENSE for details.
*/ */
using System; using System;
using System.Runtime.InteropServices;
namespace Raylib
namespace Raylib {
{ public static partial class Raylib
public static partial class Raylib {
{ // Linear Easing functions
// Linear Easing functions public static float EaseLinearNone(float t, float b, float c, float d)
public static float EaseLinearNone(float t, float b, float c, float d) {
{ return (c * t / d + b);
return (c * t / d + b); }
}
public static float EaseLinearIn(float t, float b, float c, float d)
public static float EaseLinearIn(float t, float b, float c, float d) {
{ return (c * t / d + b);
return (c * t / d + b); }
}
public static float EaseLinearOut(float t, float b, float c, float d)
public static float EaseLinearOut(float t, float b, float c, float d) {
{ return (c * t / d + b);
return (c * t / d + b); }
}
public static float EaseLinearInOut(float t, float b, float c, float d)
public static float EaseLinearInOut(float t,float b, float c, float d) {
{ return (c * t / d + b);
return (c * t / d + b); }
}
// Sine Easing functions
// Sine Easing functions public static float EaseSineIn(float t, float b, float c, float d)
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);
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)
public static float EaseSineOut(float t, float b, float c, float d) {
{ return (c * (float)Math.Sin(t / d * ((float)Math.PI / 2)) + b);
return (c * (float)Math.Sin(t / d * ((float)Math.PI / 2)) + b); }
}
public static float EaseSineInOut(float t, float b, float c, float d)
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);
return (-c / 2 * ((float)Math.Cos((float)Math.PI * t / d) - 1) + b); }
}
// Circular Easing functions
// Circular Easing functions public static float EaseCircIn(float t, float b, float c, float d)
public static float EaseCircIn(float t, float b, float c, float d) {
{ return (-c * ((float)Math.Sqrt(1 - (t /= d) * t) - 1) + b);
return (-c * ((float)Math.Sqrt(1 - (t /= d) * t) - 1) + b); }
}
public static float EaseCircOut(float t, float b, float c, float d)
public static float EaseCircOut(float t, float b, float c, float d) {
{ return (c * (float)Math.Sqrt(1 - (t = t / d - 1) * t) + b);
return (c * (float)Math.Sqrt(1 - (t = t / d - 1) * t) + b); }
}
public static float EaseCircInOut(float t, float b, float c, float d)
public static float EaseCircInOut(float t, float b, float c, float d) {
{ if ((t /= d / 2) < 1)
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) - 1) + b); }
} return (c / 2 * ((float)Math.Sqrt(1 - t * (t -= 2)) + 1) + b);
return (c / 2 * ((float)Math.Sqrt(1 - t * (t -= 2)) + 1) + b); }
}
// Cubic Easing functions
// Cubic Easing functions public static float EaseCubicIn(float t, float b, float c, float d)
public static float EaseCubicIn(float t, float b, float c, float d) {
{ return (c * (t /= d) * t * t + b);
return (c*(t /= d) * t * t + b); }
}
public static float EaseCubicOut(float t, float b, float c, float d)
public static float EaseCubicOut(float t, float b, float c, float d) {
{ return (c * ((t = t / d - 1) * t * t + 1) + b);
return (c * ((t = t / d - 1) * t * t + 1) + b); }
}
public static float EaseCubicInOut(float t, float b, float c, float d)
public static float EaseCubicInOut(float t, float b, float c, float d) {
{ if ((t /= d / 2) < 1)
if ((t/=d/2) < 1) {
{ return (c / 2 * t * t * t + b);
return (c / 2 * t * t * t + b); }
} return (c / 2 * ((t -= 2) * t * t + 2) + b);
return (c / 2 * ((t -= 2)* t * t + 2) + b); }
}
// Quadratic Easing functions
// Quadratic Easing functions public static float EaseQuadIn(float t, float b, float c, float d)
public static float EaseQuadIn(float t, float b, float c, float d) {
{ return (c * (t /= d) * t + b);
return (c * (t /= d) * t + b); }
}
public static float EaseQuadOut(float t, float b, float c, float d)
public static float EaseQuadOut(float t, float b, float c, float d) {
{ return (-c * (t /= d) * (t - 2) + b);
return (-c * (t /= d) * (t - 2) + b); }
}
public static float EaseQuadInOut(float t, float b, float c, float d)
public static float EaseQuadInOut(float t, float b, float c, float d) {
{ if ((t /= d / 2) < 1)
if ((t /= d / 2) < 1) {
{ return (((c / 2) * (t * t)) + b);
return (((c / 2) * (t * t)) + b); }
} return (-c / 2 * (((t - 2) * (--t)) - 1) + b);
return (-c / 2 * (((t - 2) * (--t)) - 1) + b); }
}
// Exponential Easing functions
// Exponential Easing functions public static float EaseExpoIn(float t, float b, float c, float d)
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);
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)
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);
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)
public static float EaseExpoInOut(float t, float b, float c, float d) {
{ if (t == 0)
if (t == 0) {
{ return b;
return b; }
} if (t == d)
if (t == d) {
{ return (b + c);
return (b + c); }
} if ((t /= d / 2) < 1)
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 - 1)) + b); }
} return (c / 2 * (-(float)Math.Pow(2, -10 * --t) + 2) + b);
return (c / 2 * (-(float)Math.Pow(2, -10 * --t) + 2) + b); }
}
// Back Easing functions
// Back Easing functions public static float EaseBackIn(float t, float b, float c, float d)
public static float EaseBackIn(float t, float b, float c, float d) {
{ float s = 1.70158f;
float s = 1.70158f; float postFix = t /= d;
float postFix = t /= d; return (c * (postFix) * t * ((s + 1) * t - s) + b);
return (c * (postFix) * t *((s + 1) * t - s) + b); }
}
public static float EaseBackOut(float t, float b, float c, float d)
public static float EaseBackOut(float t, float b, float c, float d) {
{ float s = 1.70158f;
float s = 1.70158f; return (c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b);
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)
public static float EaseBackInOut(float t, float b, float c, float d) {
{ float s = 1.70158f;
float s = 1.70158f; if ((t /= d / 2) < 1)
if ((t/=d/2) < 1) {
{ return (c / 2 * (t * t * (((s *= (1.525f)) + 1) * t - s)) + b);
return (c/2*(t*t*(((s*=(1.525f)) + 1)*t - s)) + b); }
}
float postFix = t -= 2;
float postFix = t-=2; return (c / 2 * ((postFix) * t * (((s *= (1.525f)) + 1) * t + s) + 2) + b);
return (c/2*((postFix)*t*(((s*=(1.525f)) + 1)*t + s) + 2) + b); }
}
// Bounce Easing functions
// Bounce Easing functions public static float EaseBounceOut(float t, float b, float c, float d)
public static float EaseBounceOut(float t, float b, float c, float d) {
{ if ((t /= d) < (1 / 2.75f))
if ((t /= d) < (1/2.75f)) {
{ return (c * (7.5625f * t * t) + b);
return (c * (7.5625f * t * t) + b); }
} else if (t < (2 / 2.75f))
else if (t < (2/2.75f)) {
{ float postFix = t -= (1.5f / 2.75f);
float postFix = t -= (1.5f/2.75f); return (c * (7.5625f * (postFix) * t + 0.75f) + b);
return (c * (7.5625f * (postFix) * t + 0.75f) + b); }
} else if (t < (2.5 / 2.75))
else if (t < (2.5/2.75)) {
{ float postFix = t -= (2.25f / 2.75f);
float postFix = t -= (2.25f/2.75f); return (c * (7.5625f * (postFix) * t + 0.9375f) + b);
return (c * (7.5625f * (postFix)*t + 0.9375f) + b); }
} else
else {
{ float postFix = t -= (2.625f / 2.75f);
float postFix = t -= (2.625f / 2.75f); return (c * (7.5625f * (postFix) * t + 0.984375f) + b);
return (c * (7.5625f * (postFix) * t + 0.984375f) + b); }
} }
}
public static float EaseBounceIn(float t, float b, float c, float d)
public static float EaseBounceIn(float t, float b, float c, float d) {
{ return (c - EaseBounceOut(d - t, 0, c, d) + b);
return (c - EaseBounceOut(d - t, 0, c, d) + b); }
}
public static float EaseBounceInOut(float t, float b, float c, float d)
public static float EaseBounceInOut(float t, float b, float c, float d) {
{ if (t < d / 2)
if (t < d / 2) {
{ return (EaseBounceIn(t * 2, 0, c, d) * 0.5f + b);
return (EaseBounceIn(t * 2, 0, c, d) * 0.5f + b); }
} else
else {
{ return (EaseBounceOut(t * 2 - d, 0, c, d) * 0.5f + c * 0.5f + b);
return (EaseBounceOut(t * 2 - d, 0, c, d) * 0.5f + c * 0.5f + b); }
} }
}
// Elastic Easing functions
// Elastic Easing functions public static float EaseElasticIn(float t, float b, float c, float d)
public static float EaseElasticIn(float t, float b, float c, float d) {
{ if (t == 0)
if (t == 0) {
{ return b;
return b; }
} if ((t /= d) == 1)
if ((t /= d) == 1) {
{ return (b + c);
return (b + c); }
}
float p = d * 0.3f;
float p = d * 0.3f; float a = c;
float a = c; float s = p / 4;
float s = p / 4; float postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
float postFix = a * (float)Math.Pow(2, 10 * (t -= 1));
return (-(postFix * (float)Math.Sin((t * d - s) * (2 * (float)Math.PI) / p)) + b);
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)
public static float EaseElasticOut(float t, float b, float c, float d) {
{ if (t == 0)
if (t == 0) {
{ return b;
return b; }
} if ((t /= d) == 1)
if ((t /= d) == 1) {
{ return (b + c);
return (b + c); }
}
float p = d * 0.3f;
float p = d * 0.3f; float a = c;
float a = c; float s = p / 4;
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);
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)
public static float EaseElasticInOut(float t, float b, float c, float d) {
{ if (t == 0)
if (t == 0) {
{ return b;
return b; }
} if ((t /= d / 2) == 2)
if ((t /= d / 2) == 2) {
{ return (b + c);
return (b + c); }
}
float p = d * (0.3f * 1.5f);
float p = d * (0.3f * 1.5f); float a = c;
float a = c; float s = p / 4;
float s = p / 4;
float postFix = 0f;
float postFix = 0f; if (t < 1)
if (t < 1) {
{ postFix = a * (float)Math.Pow(2, 10 * (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;
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));
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);
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 /* Raylib-cs
* Extensions.cs - Extra features * Extensions.cs - Higher level features over bindings. This file is not automatically generated.
* Copyright 2019 Chris Dill * Copyright 2019 Chris Dill
* *
* Release under zLib License. * Release under zLib License.
* See LICENSE for details. * See LICENSE for details.
*/ */
using System; using System;
using System.Runtime.InteropServices; using System.Text;
using System.Numerics;
namespace Raylib
{ namespace Raylib
public struct Tween {
{ // Extensions to the raylib bindings.
public delegate float Callback(float t, float b, float c, float d); // Seperate for easier code generation.
public Callback easer; public partial class Raylib
public float start; {
public float end; // extension providing SubText
public float currentTime; public static string SubText(this string input, int position, int length)
public float duration; {
public bool completed; return input.Substring(position, Math.Min(length, input.Length));
}
public Tween(Callback easer, float start, float end, float duration)
{ // Here (in the public method) we hide some low level details
this.easer = easer; // memory allocation, string manipulations etc.
this.start = start; public static bool CoreGuiTextBox(Rectangle bounds, ref string text, int textSize, bool freeEdit)
this.end = end; {
this.currentTime = 0f; if (null == text)
this.duration = duration; {
this.completed = false; return false; // or throw exception; or assign "" to text
} }
public void Reset() StringBuilder sb = new StringBuilder(text);
{
currentTime = 0f; // If we allow editing we should allocate enough size (Length) within StringBuilder
completed = false; if (textSize > sb.Length)
} {
sb.Length = textSize;
public float Apply(float dt) }
{
currentTime += dt; bool result = GuiTextBox(bounds, sb, sb.Length, freeEdit);
if (currentTime > duration)
{ // Back to string (StringBuilder can have been edited)
currentTime = duration; // You may want to add some logic here; e.g. trim trailing '\0'
completed = true; text = sb.ToString();
}
return easer(currentTime, start, end - start, duration); return result;
} }
}
// Text Box control with multiple lines
public partial struct Color public static bool CoreTextBoxMulti(Rectangle bounds, ref string text, int textSize, bool freeEdit)
{ {
public Color(byte r, byte g, byte b, byte a) if (null == text)
{ {
this.r = r; return false; // or throw exception; or assign "" to text
this.g = g; }
this.b = b;
this.a = a; StringBuilder sb = new StringBuilder(text);
}
// If we allow editing we should allocate enough size (Length) within StringBuilder
public Color(int r, int g, int b, int a) if (textSize > sb.Length)
{ {
this.r = Convert.ToByte(r); sb.Length = textSize;
this.g = Convert.ToByte(g); }
this.b = Convert.ToByte(b);
this.a = Convert.ToByte(a); bool result = GuiTextBoxMulti(bounds, sb, sb.Length, freeEdit);
}
// Back to string (StringBuilder can have been edited)
internal string DebugDisplayString // You may want to add some logic here; e.g. trim trailing '\0'
{ text = sb.ToString();
get
{ return result;
return string.Concat( }
r.ToString(), " ", }
g.ToString(), " ",
b.ToString(), " ", // Small utility for tweening values
a.ToString() public struct Tween
); {
} public delegate float Callback(float t, float b, float c, float d);
} public Callback easer;
public float start;
/// <summary> public float end;
/// Performs linear interpolation of <see cref="Color"/>. public float currentTime;
/// </summary> public float duration;
/// <param name="value1">Source <see cref="Color"/>.</param> public bool completed;
/// <param name="value2">Destination <see cref="Color"/>.</param>
/// <param name="amount">Interpolation factor.</param> public Tween(Callback easer, float start, float end, float duration)
/// <returns>Interpolated <see cref="Color"/>.</returns> {
public static Color Lerp(Color value1, Color value2, float amount) this.easer = easer;
{ this.start = start;
amount = Raylib.Clamp(amount, 0.0f, 1.0f); this.end = end;
return new Color( this.currentTime = 0f;
(int) Raylib.Lerp(value1.r, value2.r, amount), this.duration = duration;
(int) Raylib.Lerp(value1.g, value2.g, amount), this.completed = false;
(int) Raylib.Lerp(value1.b, value2.b, amount), }
(int) Raylib.Lerp(value1.a, value2.a, amount)
); public void Reset()
} {
} currentTime = 0f;
completed = false;
// Utlity for accessing math functions through struct }
public partial struct Vector2
{ public float Apply(float dt)
public float X {get{return x;} set {x = value;}} {
public float Y {get{return y;} set {y = value;}} currentTime += dt;
if (currentTime > duration)
public Vector2(float x, float y) {
{ currentTime = duration;
this.x = x; completed = true;
this.y = y; }
} return easer(currentTime, start, end - start, duration);
}
public Vector2(float value) }
{
this.x = value; public partial struct Color
this.y = value; {
} // Example - Color.RED instead of RED
// Custom raylib color palette for amazing visuals
public override bool Equals(object obj) => (obj is Vector2) && Equals((Vector2)obj); public static Color LIGHTGRAY = new Color(200, 200, 200, 255);
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode(); public static Color GRAY = new Color(130, 130, 130, 255);
public static Color DARKGRAY = new Color(80, 80, 80, 255);
public float Length() => Raylib.Vector2Length(this); public static Color YELLOW = new Color(253, 249, 0, 255);
public float LengthSquared() => (x * x) + (y * y); public static Color GOLD = new Color(255, 203, 0, 255);
public static Color ORANGE = new Color(255, 161, 0, 255);
public override string ToString() public static Color PINK = new Color(255, 109, 194, 255);
{ public static Color RED = new Color(230, 41, 55, 255);
return "Vector2(" + x + " " + y + ")"; 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);
// common values public static Color DARKGREEN = new Color(0, 117, 44, 255);
public static Vector2 Zero { get { return Raylib.Vector2Zero(); } } public static Color SKYBLUE = new Color(102, 191, 255, 255);
public static Vector2 One { get { return Raylib.Vector2One(); } } public static Color BLUE = new Color(0, 121, 241, 255);
public static Vector2 UnitX { get { return new Vector2(1, 0); } } public static Color DARKBLUE = new Color(0, 82, 172, 255);
public static Vector2 UnitY { get { return new Vector2(0, 1); } } public static Color PURPLE = new Color(200, 122, 255, 255);
public static Color VIOLET = new Color(135, 60, 190, 255);
// convienient operators public static Color DARKPURPLE = new Color(112, 31, 126, 255);
public static bool operator ==(Vector2 v1, Vector2 v2) => (v1.x == v2.x && v1.y == v2.y); public static Color BEIGE = new Color(211, 176, 131, 255);
public static bool operator !=(Vector2 v1, Vector2 v2) => !(v1 == v2); public static Color BROWN = new Color(127, 106, 79, 255);
public static bool operator >(Vector2 v1, Vector2 v2) => v1.x > v2.x && v1.y > v2.y; public static Color DARKBROWN = new Color(76, 63, 47, 255);
public static bool operator <(Vector2 v1, Vector2 v2) => v1.x < v2.x && v1.y < v2.y; public static Color WHITE = new Color(255, 255, 255, 255);
public static Vector2 operator +(Vector2 v1, Vector2 v2) => Raylib.Vector2Add(v1, v2); public static Color BLACK = new Color(0, 0, 0, 255);
public static Vector2 operator -(Vector2 v1, Vector2 v2) => Raylib.Vector2Subtract(v1, v2); public static Color BLANK = new Color(0, 0, 0, 0);
public static Vector2 operator *(Vector2 v1, Vector2 v2) => Raylib.Vector2Multiplyv(v1, v2); public static Color MAGENTA = new Color(255, 0, 255, 255);
public static Vector2 operator *(Vector2 v, float scale) => Raylib.Vector2Scale(v, scale); public static Color RAYWHITE = new Color(245, 245, 245, 255);
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 Color(byte r, byte g, byte b, byte a)
public static Vector2 operator /(Vector2 v1, float div) => Raylib.Vector2Divide(v1, div); {
public static Vector2 operator -(Vector2 v1) => Raylib.Vector2Negate(v1); this.r = r;
this.g = g;
public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount) this.b = b;
{ this.a = a;
return new Vector2( }
Raylib.Lerp(value1.X, value2.X, amount),
Raylib.Lerp(value1.Y, value2.Y, amount) public Color(int r, int g, int b, int a)
); {
} this.r = Convert.ToByte(r);
this.g = Convert.ToByte(g);
public static float Length(Vector2 v) this.b = Convert.ToByte(b);
{ this.a = Convert.ToByte(a);
return Raylib.Vector2Length(v); }
}
internal string DebugDisplayString
public static float Dot(Vector2 v1, Vector2 v2) {
{ get
return Raylib.Vector2DotProduct(v1, v2); {
} return string.Concat(
r.ToString(), " ",
public static void Dot(ref Vector2 v1, ref Vector2 v2, out float result) g.ToString(), " ",
{ b.ToString(), " ",
result = Raylib.Vector2DotProduct(v1, v2); a.ToString()
} );
}
public static float DotProduct(Vector2 v1, Vector2 v2) }
{
return Raylib.Vector2DotProduct(v1, v2); // Performs linear interpolation of <see cref="Color"/>.
} public static Color Lerp(Color value1, Color value2, float amount)
{
public static float Distance(Vector2 v1, Vector2 v2) amount = Raylib.Clamp(amount, 0.0f, 1.0f);
{ return new Color(
return Raylib.Vector2Distance(v1, v2); (int)Raylib.Lerp(value1.r, value2.r, amount),
} (int)Raylib.Lerp(value1.g, value2.g, amount),
(int)Raylib.Lerp(value1.b, value2.b, amount),
public static float DistanceSquared(Vector2 v1, Vector2 v2) (int)Raylib.Lerp(value1.a, value2.a, amount)
{ );
float a = v1.X - v2.X, b = v1.Y - v2.Y; }
return (a * a) + (b * b); }
}
public partial struct Rectangle
public static float Angle(Vector2 v1, Vector2 v2) {
{ public Rectangle(float x, float y, float width, float height)
return Raylib.Vector2Angle(v1, v2); {
} this.x = x;
this.y = y;
public static Vector2 Scale(Vector2 v, float scale) this.width = width;
{ this.height = height;
return Raylib.Vector2Scale(v, scale); }
} }
public static Vector2 Negate(Vector2 v) public partial struct BoundingBox
{ {
return Raylib.Vector2Negate(v); public BoundingBox(Vector3 min, Vector3 max)
} {
this.min = min;
public static Vector2 Divide(Vector2 v, float div) this.max = max;
{ }
return Raylib.Vector2Divide(v, div); }
}
public partial struct Camera3D
public static void Normalize(ref Vector2 v) {
{ public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy = 90, CameraType type = CameraType.CAMERA_PERSPECTIVE)
v = Raylib.Vector2Normalize(v); {
} this.position = position;
this.target = target;
public static Vector2 Normalize(Vector2 v) this.up = up;
{ this.fovy = fovy;
return Raylib.Vector2Normalize(v); this.type = type;
} }
}
// Creates a new <see cref="Vector2"/> that contains a maximal values from the two vectors.
public static Vector2 Max(Vector2 v1, Vector2 v2) public partial struct Ray
{ {
return new Vector2( public Ray(Vector3 position, Vector3 direction)
v1.X > v2.X ? v1.X : v2.X, {
v1.Y > v2.Y ? v1.Y : v2.Y this.position = position;
); this.direction = direction;
} }
}
// Creates a new <see cref="Vector2"/> that contains a minimal values from the two vectors.
public static Vector2 Min(Vector2 v1, Vector2 v2) public partial struct RayHitInfo
{ {
return new Vector2( public RayHitInfo(bool hit, float distance, Vector3 position, Vector3 normal)
v1.X < v2.X ? v1.X : v2.X, {
v1.Y < v2.Y ? v1.Y : v2.Y this.hit = hit;
); this.distance = distance;
} this.position = position;
this.normal = normal;
// Clamps the specified value within a range. }
public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) }
{
return new Vector2( // Utlity for accessing math functions through struct
Raylib.Clamp(value1.X, min.X, max.X), public partial struct Vector2
Raylib.Clamp(value1.Y, min.Y, max.Y) {
); public Vector2(float x, float y)
} {
} this.x = x;
this.y = y;
}
// Vector3 type
public partial struct Vector3 public Vector2(float value)
{ {
// captial option for xna/fna/monogame compatability this.x = value;
public float X { get => x; set => x = value; } this.y = value;
public float Y { get => y; set => y = value; } }
public float Z { get => z; set => z = value; }
public override bool Equals(object obj) => (obj is Vector2) && Equals((Vector2)obj);
public Vector3(float x, float y, float z) public override int GetHashCode() => x.GetHashCode() + y.GetHashCode();
{
this.x = x; public float Length() => Raylib.Vector2Length(this);
this.y = y; public float LengthSquared() => (x * x) + (y * y);
this.z = z;
} public override string ToString()
{
public Vector3(float value) return "Vector2(" + x + " " + y + ")";
{ }
this.x = value;
this.y = value; // common values
this.z = value; public static Vector2 Zero { get { return Raylib.Vector2Zero(); } }
}
public static Vector2 One { get { return Raylib.Vector2One(); } }
// extensions
public override bool Equals(object obj) => (obj is Vector3) && Equals((Vector3)obj); public static Vector2 UnitX { get { return new Vector2(1, 0); } }
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode();
public static Vector2 UnitY { get { return new Vector2(0, 1); } }
public override string ToString()
{ // convienient operators
return "Vector3(" + x + " " + y + " " + z + ")"; public static bool operator ==(Vector2 v1, Vector2 v2) => (v1.x == v2.x && v1.y == v2.y);
}
public static bool operator !=(Vector2 v1, Vector2 v2)
// common values {
public static Vector3 Zero { get { return Raylib.Vector3Zero(); } } return !(v1 == v2);
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 bool operator >(Vector2 v1, Vector2 v2)
public static Vector3 UnitZ { get { return new Vector3(0, 0, 1); } } {
return v1.x > v2.x && v1.y > v2.y;
// 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 <(Vector2 v1, Vector2 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; return v1.x < v2.x && v1.y < v2.y;
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 Vector2 operator +(Vector2 v1, Vector2 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); return Raylib.Vector2Add(v1, v2);
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 Vector2 operator -(Vector2 v1, Vector2 v2)
{
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount) return Raylib.Vector2Subtract(v1, v2);
{ }
return new Vector3(
Raylib.Lerp(value1.X, value2.X, amount), public static Vector2 operator *(Vector2 v1, Vector2 v2)
Raylib.Lerp(value1.Y, value2.Y, amount), {
Raylib.Lerp(value1.Z, value2.Z, amount) return Raylib.Vector2Multiplyv(v1, v2);
); }
}
} public static Vector2 operator *(Vector2 v, float scale)
{
// Vector4 type return Raylib.Vector2Scale(v, scale);
public partial struct Vector4 }
{
public Vector4(float x, float y, float z, float w) public static Vector2 operator *(float scale, Vector2 v)
{ {
this.x = x; return Raylib.Vector2Scale(v, scale);
this.y = y; }
this.z = z;
this.w = w; public static Vector2 operator /(Vector2 v1, Vector2 v2)
} {
return Raylib.Vector2DivideV(v1, v2);
public Vector4(float value) }
{
this.x = value; public static Vector2 operator /(Vector2 v1, float div)
this.y = value; {
this.z = value; return Raylib.Vector2Divide(v1, div);
this.w = value; }
}
public static Vector2 operator -(Vector2 v1)
public override bool Equals(object obj) => (obj is Vector4) && Equals((Vector4)obj); {
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode() + w.GetHashCode(); return Raylib.Vector2Negate(v1);
}
public override string ToString()
{ public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
return "Vector4(" + x + " " + y + " " + z + " " + w + ")"; {
} return new Vector2(
Raylib.Lerp(value1.x, value2.x, amount),
// convienient operators Raylib.Lerp(value1.y, value2.y, amount)
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; 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;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib namespace Raylib
{ {
#region Raylib-cs Enums #region Raylib-cs Enums
public enum PhysicsShapeType public enum PhysicsShapeType
{ {
PHYSICS_CIRCLE, PHYSICS_CIRCLE,
PHYSICS_POLYGON PHYSICS_POLYGON
} }
#endregion #endregion
#region Raylib-cs Types #region Raylib-cs Types
// Mat2 type (used for polygon shape rotation matrix) // Mat2 type (used for polygon shape rotation matrix)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Mat2 public struct Mat2
{ {
public float m00; public float m00;
public float m01; public float m01;
public float m10; public float m10;
public float m11; public float m11;
} }
// @TODO Custom array marshall issue https://github.com/ChrisDill/Raylib-cs/issues/9 // @TODO Custom array marshall issue https://github.com/ChrisDill/Raylib-cs/issues/9
// hack same as raylib.cs _MaterialMap_e_FixedBuffer // hack same as raylib.cs _MaterialMap_e_FixedBuffer
// no easy way to marshall arrays of custom types. no idea why?!?! // no easy way to marshall arrays of custom types. no idea why?!?!
// Span<T> seems to need ref struct. // Span<T> seems to need ref struct.
public unsafe struct _Polygon_e_FixedBuffer public unsafe struct _Polygon_e_FixedBuffer
{ {
public Vector2 v0; public Vector2 v0;
public Vector2 v1; public Vector2 v1;
public Vector2 v2; public Vector2 v2;
public Vector2 v3; public Vector2 v3;
public Vector2 v4; public Vector2 v4;
public Vector2 v5; public Vector2 v5;
public Vector2 v6; public Vector2 v6;
public Vector2 v7; public Vector2 v7;
public Vector2 v8; public Vector2 v8;
public Vector2 v9; public Vector2 v9;
public Vector2 v10; public Vector2 v10;
public Vector2 v11; public Vector2 v11;
public Vector2 v12; public Vector2 v12;
public Vector2 v13; public Vector2 v13;
public Vector2 v14; public Vector2 v14;
public Vector2 v15; public Vector2 v15;
public Vector2 v16; public Vector2 v16;
public Vector2 v17; public Vector2 v17;
public Vector2 v18; public Vector2 v18;
public Vector2 v19; public Vector2 v19;
public Vector2 v20; public Vector2 v20;
public Vector2 v21; public Vector2 v21;
public Vector2 v22; public Vector2 v22;
public Vector2 v23; public Vector2 v23;
public Vector2 v24; public Vector2 v24;
public Vector2 this[int index] public Vector2 this[int index]
{ {
get get
{ {
fixed (Vector2* e = &v0) fixed (Vector2* e = &v0)
return e[index]; return e[index];
} }
} }
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PolygonData public struct PolygonData
{ {
public uint vertexCount; // Current used vertex and normals count public uint vertexCount; // Current used vertex and normals count
public _Polygon_e_FixedBuffer positions; // Polygon vertex positions vectors public _Polygon_e_FixedBuffer positions; // Polygon vertex positions vectors
public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors public _Polygon_e_FixedBuffer normals; // Polygon vertex normals vectors
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsShape public struct PhysicsShape
{ {
public PhysicsShapeType type; // Physics shape type (circle or polygon) public PhysicsShapeType type; // Physics shape type (circle or polygon)
public IntPtr body; // Shape physics body reference public IntPtr body; // Shape physics body reference
public float radius; // Circle shape radius (used for circle shapes) public float radius; // Circle shape radius (used for circle shapes)
public Mat2 transform; // Vertices transform matrix 2x2 public Mat2 transform; // Vertices transform matrix 2x2
public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes) public PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes)
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct PhysicsBodyData public partial struct PhysicsBodyData
{ {
public uint id; public uint id;
[MarshalAs(UnmanagedType.Bool)] [MarshalAs(UnmanagedType.Bool)]
public bool enabled; public bool enabled;
public Vector2 position; public Vector2 position;
public Vector2 velocity; public Vector2 velocity;
public Vector2 force; public Vector2 force;
public float angularVelocity; public float angularVelocity;
public float torque; public float torque;
public float orient; public float orient;
public float inertia; public float inertia;
public float inverseInertia; public float inverseInertia;
public float mass; public float mass;
public float inverseMass; public float inverseMass;
public float staticFriction; public float staticFriction;
public float dynamicFriction; public float dynamicFriction;
public float restitution; public float restitution;
[MarshalAs(UnmanagedType.Bool)] [MarshalAs(UnmanagedType.Bool)]
public bool useGravity; public bool useGravity;
[MarshalAs(UnmanagedType.Bool)] [MarshalAs(UnmanagedType.Bool)]
public bool isGrounded; public bool isGrounded;
[MarshalAs(UnmanagedType.Bool)] [MarshalAs(UnmanagedType.Bool)]
public bool freezeOrient; public bool freezeOrient;
public PhysicsShape shape; public PhysicsShape shape;
} }
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct PhysicsManifoldData public struct PhysicsManifoldData
{ {
public uint id; // Reference unique identifier public uint id; // Reference unique identifier
public IntPtr bodyA; // Manifold first physics body reference public IntPtr bodyA; // Manifold first physics body reference
public IntPtr bodyB; // Manifold second physics body reference public IntPtr bodyB; // Manifold second physics body reference
public float penetration; // Depth of penetration from collision public float penetration; // Depth of penetration from collision
public Vector2 normal; // Normal direction vector from 'a' to 'b' public Vector2 normal; // Normal direction vector from 'a' to 'b'
public Vector2 contactsA; // Points of contact during collision public Vector2 contactsA; // Points of contact during collision
public Vector2 contactsB; // Points of contact during collision public Vector2 contactsB; // Points of contact during collision
public uint contactsCount; // Current collision number of contacts public uint contactsCount; // Current collision number of contacts
public float restitution; // Mixed restitution during collision public float restitution; // Mixed restitution during collision
public float dynamicFriction; // Mixed dynamic friction during collision public float dynamicFriction; // Mixed dynamic friction during collision
public float staticFriction; // Mixed static friction during collision public float staticFriction; // Mixed static friction during collision
} }
#endregion #endregion
public static partial class Raylib public static partial class Raylib
{ {
#region Raylib-cs Variables #region Raylib-cs Variables
public const int PHYSAC_MAX_BODIES = 64; public const int PHYSAC_MAX_BODIES = 64;
public const int PHYSAC_MAX_MANIFOLDS = 4096; public const int PHYSAC_MAX_MANIFOLDS = 4096;
public const int PHYSAC_MAX_VERTICES = 24; public const int PHYSAC_MAX_VERTICES = 24;
public const int PHYSAC_CIRCLE_VERTICES = 24; public const int PHYSAC_CIRCLE_VERTICES = 24;
public const float PHYSAC_DESIRED_DELTATIME = 1.0f / 60.0f; public const float PHYSAC_DESIRED_DELTATIME = 1.0f / 60.0f;
public const float PHYSAC_MAX_TIMESTEP = 0.02f; public const float PHYSAC_MAX_TIMESTEP = 0.02f;
public const int PHYSAC_COLLISION_ITERATIONS = 100; public const int PHYSAC_COLLISION_ITERATIONS = 100;
public const float PHYSAC_PENETRATION_ALLOWANCE = 0.05f; public const float PHYSAC_PENETRATION_ALLOWANCE = 0.05f;
public const float PHYSAC_PENETRATION_CORRECTION = 0.4f; public const float PHYSAC_PENETRATION_CORRECTION = 0.4f;
public const float PHYSAC_PI = 3.14159265358979323846f; public const float PHYSAC_PI = 3.14159265358979323846f;
public const float PHYSAC_DEG2RAD = (PHYSAC_PI / 180.0f); public const float PHYSAC_DEG2RAD = (PHYSAC_PI / 180.0f);
#endregion #endregion
#region Raylib-cs Functions #region Raylib-cs Functions
// Initializes physics values, pointers and creates physics loop thread // Initializes physics values, pointers and creates physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void InitPhysics(); public static extern void InitPhysics();
// Run physics step, to be used if PHYSICS_NO_THREADS is set in your main loop // Run physics step, to be used if PHYSICS_NO_THREADS is set in your main loop
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void RunPhysicsStep(); public static extern void RunPhysicsStep();
// Returns true if physics thread is currently enabled // Returns true if physics thread is currently enabled
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsPhysicsEnabled(); public static extern bool IsPhysicsEnabled();
// Sets physics global gravity force // Sets physics global gravity force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsGravity(float x, float y); public static extern void SetPhysicsGravity(float x, float y);
// Creates a new circle physics body with generic parameters // Creates a new circle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyCircle")] [DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyCircle")]
private static extern IntPtr CreatePhysicsBodyCircleImport(Vector2 pos, float radius, float density); private static extern IntPtr CreatePhysicsBodyCircleImport(Vector2 pos, float radius, float density);
public static PhysicsBodyData CreatePhysicsBodyCircle(Vector2 pos, float radius, float density) public static PhysicsBodyData CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
{ {
var body = CreatePhysicsBodyCircleImport(pos, radius, density); var body = CreatePhysicsBodyCircleImport(pos, radius, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData)); var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data; return data;
} }
// Creates a new rectangle physics body with generic parameters // Creates a new rectangle physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyRectangle")] [DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyRectangle")]
private static extern IntPtr CreatePhysicsBodyRectangleImport(Vector2 pos, float width, float height, float density); 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) public static PhysicsBodyData CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
{ {
var body = CreatePhysicsBodyRectangleImport(pos, width, height, density); var body = CreatePhysicsBodyRectangleImport(pos, width, height, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData)); var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data; return data;
} }
// Creates a new polygon physics body with generic parameters // Creates a new polygon physics body with generic parameters
[DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyPolygon")] [DllImport(nativeLibName, EntryPoint = "CreatePhysicsBodyPolygon")]
private static extern IntPtr CreatePhysicsBodyPolygonImport(Vector2 pos, float radius, int sides, float density); 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) public static PhysicsBodyData CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
{ {
var body = CreatePhysicsBodyPolygonImport(pos, radius, sides, density); var body = CreatePhysicsBodyPolygonImport(pos, radius, sides, density);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData)); var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data; return data;
} }
// Adds a force to a physics body // Adds a force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddForce(PhysicsBodyData body, Vector2 force); public static extern void PhysicsAddForce(PhysicsBodyData body, Vector2 force);
// Adds an angular force to a physics body // Adds an angular force to a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsAddTorque(PhysicsBodyData body, float amount); public static extern void PhysicsAddTorque(PhysicsBodyData body, float amount);
// Shatters a polygon shape physics body to little physics bodies with explosion force // Shatters a polygon shape physics body to little physics bodies with explosion force
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void PhysicsShatter(PhysicsBodyData body, Vector2 position, float force); public static extern void PhysicsShatter(PhysicsBodyData body, Vector2 position, float force);
// Returns the current amount of created physics bodies // Returns the current amount of created physics bodies
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsBodiesCount(); public static extern int GetPhysicsBodiesCount();
// Returns a physics body of the bodies pool at a specific index // Returns a physics body of the bodies pool at a specific index
[DllImport(nativeLibName, EntryPoint = "GetPhysicsBody")] [DllImport(nativeLibName, EntryPoint = "GetPhysicsBody")]
public static extern IntPtr GetPhysicsBodyImport(int index); public static extern IntPtr GetPhysicsBodyImport(int index);
public static PhysicsBodyData GetPhysicsBody(int index) public static PhysicsBodyData GetPhysicsBody(int index)
{ {
var body = GetPhysicsBodyImport(index); var body = GetPhysicsBodyImport(index);
var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData)); var data = (PhysicsBodyData)Marshal.PtrToStructure(body, typeof(PhysicsBodyData));
return data; return data;
} }
// Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON) // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeType(int index); public static extern int GetPhysicsShapeType(int index);
// Returns the amount of vertices of a physics body shape // Returns the amount of vertices of a physics body shape
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern int GetPhysicsShapeVerticesCount(int index); public static extern int GetPhysicsShapeVerticesCount(int index);
// Returns transformed position of a body shape (body position + vertex transformed position) // Returns transformed position of a body shape (body position + vertex transformed position)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetPhysicsShapeVertex(PhysicsBodyData body, int vertex); public static extern Vector2 GetPhysicsShapeVertex(PhysicsBodyData body, int vertex);
// Sets physics body shape transform based on radians parameter // Sets physics body shape transform based on radians parameter
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void SetPhysicsBodyRotation(PhysicsBodyData body, float radians); public static extern void SetPhysicsBodyRotation(PhysicsBodyData body, float radians);
// Unitializes and destroy a physics body // Unitializes and destroy a physics body
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void DestroyPhysicsBody(PhysicsBodyData body); public static extern void DestroyPhysicsBody(PhysicsBodyData body);
// Destroys created physics bodies and manifolds and resets global values // Destroys created physics bodies and manifolds and resets global values
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ResetPhysics(); public static extern void ResetPhysics();
// Unitializes physics pointers and closes physics loop thread // Unitializes physics pointers and closes physics loop thread
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void ClosePhysics(); public static extern void ClosePhysics();
#endregion #endregion
} }
} }

View File

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

View File

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

View File

@ -1,405 +1,405 @@
/* Raylib-cs /* Raylib-cs
* Raymath.cs - Core bindings to raymth * Raymath.cs - Core bindings to raymth
* Copyright 2019 Chris Dill * Copyright 2019 Chris Dill
* *
* Release under zLib License. * Release under zLib License.
* See LICENSE for details. * See LICENSE for details.
*/ */
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib namespace Raylib
{ {
// Vector2 type // Vector2 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector2 public partial struct Vector2
{ {
public float x; public float x;
public float y; public float y;
} }
// Vector3 type // Vector3 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector3 public partial struct Vector3
{ {
public float x; public float x;
public float y; public float y;
public float z; public float z;
} }
// Vector4 type // Vector4 type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public partial struct Vector4 public partial struct Vector4
{ {
public float x; public float x;
public float y; public float y;
public float z; public float z;
public float w; public float w;
} }
// Matrix type (OpenGL style 4x4 - right handed, column major) // Matrix type (OpenGL style 4x4 - right handed, column major)
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Matrix public struct Matrix
{ {
public float m0, m4, m8, m12; public float m0, m4, m8, m12;
public float m1, m5, m9, m13; public float m1, m5, m9, m13;
public float m2, m6, m10, m14; public float m2, m6, m10, m14;
public float m3, m7, m11, m15; public float m3, m7, m11, m15;
public override string ToString() 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})"; return $"Matrix({m0}, {m4}, {m8}, {m12}\n {m1}, {m5}, {m9}, {m13}\n {m2}, {m6}, {m10}, {m14}\n {m3}, {m7}, {m11}, {m15})";
} }
} }
// Quaternion type // Quaternion type
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Quaternion public struct Quaternion
{ {
public float x; public float x;
public float y; public float y;
public float z; public float z;
public float w; public float w;
public override string ToString() public override string ToString()
{ {
return "Quaternion(" + x + " " + y + " " + z + " " + w + ")"; return "Quaternion(" + x + " " + y + " " + z + " " + w + ")";
} }
} }
public static partial class Raylib public static partial class Raylib
{ {
// Clamp float value // Clamp float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Clamp(float value, float min, float max); public static extern float Clamp(float value, float min, float max);
/// <summary> /// <summary>
/// Linearly interpolates between two values. /// Linearly interpolates between two values.
/// </summary> /// </summary>
/// <param name="value1">Source value.</param> /// <param name="value1">Source value.</param>
/// <param name="value2">Source value.</param> /// <param name="value2">Source value.</param>
/// <param name="amount"> /// <param name="amount">
/// Value between 0 and 1 indicating the weight of value2. /// Value between 0 and 1 indicating the weight of value2.
/// </param> /// </param>
/// <returns>Interpolated value.</returns> /// <returns>Interpolated value.</returns>
/// <remarks> /// <remarks>
/// This method performs the linear interpolation based on the following formula. /// This method performs the linear interpolation based on the following formula.
/// <c>value1 + (value2 - value1) * amount</c> /// <c>value1 + (value2 - value1) * amount</c>
/// Passing amount a value of 0 will cause value1 to be returned, a value of 1 will /// Passing amount a value of 0 will cause value1 to be returned, a value of 1 will
/// cause value2 to be returned. /// cause value2 to be returned.
/// </remarks> /// </remarks>
public static float Lerp(float value1, float value2, float amount) public static float Lerp(float value1, float value2, float amount)
{ {
return value1 + (value2 - value1) * amount; return value1 + (value2 - value1) * amount;
} }
// Vector with components value 0.0f // Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Zero(); public static extern Vector2 Vector2Zero();
// Vector with components value 1.0f // Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2One(); public static extern Vector2 Vector2One();
// Add two vectors (v1 + v2) // Add two vectors (v1 + v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
// Subtract two vectors (v1 - v2) // Subtract two vectors (v1 - v2)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
// Calculate vector length // Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Length(Vector2 v); public static extern float Vector2Length(Vector2 v);
// Calculate two vectors dot product // Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2); public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
// Calculate distance between two vectors // Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Distance(Vector2 v1, Vector2 v2); public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
// Calculate angle from two vectors in X-axis // Calculate angle from two vectors in X-axis
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Angle(Vector2 v1, Vector2 v2); public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
// Scale vector (multiply by value) // Scale vector (multiply by value)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Scale(Vector2 v, float scale); public static extern Vector2 Vector2Scale(Vector2 v, float scale);
// Multiply vector by a vector // Multiply vector by a vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Multiplyv(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Multiplyv(Vector2 v1, Vector2 v2);
// Negate vector // Negate vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Negate(Vector2 v); public static extern Vector2 Vector2Negate(Vector2 v);
// Divide vector by a float value // Divide vector by a float value
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Divide(Vector2 v, float div); public static extern Vector2 Vector2Divide(Vector2 v, float div);
// Divide vector by a vector // Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2DivideV(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2DivideV(Vector2 v1, Vector2 v2);
// Normalize provided vector // Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Normalize(Vector2 v); public static extern Vector2 Vector2Normalize(Vector2 v);
// Vector with components value 0.0f // Vector with components value 0.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Zero(); public static extern Vector3 Vector3Zero();
// Vector with components value 1.0f // Vector with components value 1.0f
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3One(); public static extern Vector3 Vector3One();
// Add two vectors // Add two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
// Substract two vectors // Substract two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
// Multiply vector by scalar // Multiply vector by scalar
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Multiply(Vector3 v, float scalar); public static extern Vector3 Vector3Multiply(Vector3 v, float scalar);
// Multiply vector by vector // Multiply vector by vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2);
// Calculate two vectors cross product // Calculate two vectors cross product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
// Calculate one vector perpendicular vector // Calculate one vector perpendicular vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Perpendicular(Vector3 v); public static extern Vector3 Vector3Perpendicular(Vector3 v);
// Calculate vector length // Calculate vector length
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Length(Vector3 v); public static extern float Vector3Length(Vector3 v);
// Calculate two vectors dot product // Calculate two vectors dot product
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2); public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
// Calculate distance between two vectors // Calculate distance between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Distance(Vector3 v1, Vector3 v2); public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
// Scale provided vector // Scale provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Scale(Vector3 v, float scale); public static extern Vector3 Vector3Scale(Vector3 v, float scale);
// Negate provided vector (invert direction) // Negate provided vector (invert direction)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Negate(Vector3 v); public static extern Vector3 Vector3Negate(Vector3 v);
// Divide vector by a float value // Divide vector by a float value
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Divide(Vector3 v, float div); public static extern Vector3 Vector3Divide(Vector3 v, float div);
// Divide vector by a vector // Divide vector by a vector
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3DivideV(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3DivideV(Vector3 v1, Vector3 v2);
// Normalize provided vector // Normalize provided vector
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Normalize(Vector3 v); public static extern Vector3 Vector3Normalize(Vector3 v);
// Orthonormalize provided vectors // Orthonormalize provided vectors
// Makes vectors normalized and orthogonal to each other // Makes vectors normalized and orthogonal to each other
// Gram-Schmidt function implementation // Gram-Schmidt function implementation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void Vector3OrthoNormalize(out Vector3 v1, out Vector3 v2); public static extern void Vector3OrthoNormalize(out Vector3 v1, out Vector3 v2);
// Transforms a Vector3 by a given Matrix // Transforms a Vector3 by a given Matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat); public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat);
// Transform a vector by quaternion rotation // Transform a vector by quaternion rotation
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q); public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
// Calculate linear interpolation between two vectors // Calculate linear interpolation between two vectors
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount); public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
// Calculate reflected vector to normal // Calculate reflected vector to normal
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal); public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
// Return min value for each pair of components // Return min value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
// Return max value for each pair of components // Return max value for each pair of components
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2); 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) // 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 // NOTE: Assumes P is on the plane of the triangle
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c); public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
// Returns Vector3 as float array // Returns Vector3 as float array
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] Vector3ToFloatV(Vector3 v); public static extern float[] Vector3ToFloatV(Vector3 v);
// Compute matrix determinant // Compute matrix determinant
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixDeterminant(Matrix mat); public static extern float MatrixDeterminant(Matrix mat);
// Returns the trace of the matrix (sum of the values along the diagonal) // Returns the trace of the matrix (sum of the values along the diagonal)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixTrace(Matrix mat); public static extern float MatrixTrace(Matrix mat);
// Transposes provided matrix // Transposes provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranspose(Matrix mat); public static extern Matrix MatrixTranspose(Matrix mat);
// Invert provided matrix // Invert provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixInvert(Matrix mat); public static extern Matrix MatrixInvert(Matrix mat);
// Normalize provided matrix // Normalize provided matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixNormalize(Matrix mat); public static extern Matrix MatrixNormalize(Matrix mat);
// Returns identity matrix // Returns identity matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixIdentity(); public static extern Matrix MatrixIdentity();
// Add two matrices // Add two matrices
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixAdd(Matrix left, Matrix right); public static extern Matrix MatrixAdd(Matrix left, Matrix right);
// Substract two matrices (left - right) // Substract two matrices (left - right)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixSubstract(Matrix left, Matrix right); public static extern Matrix MatrixSubstract(Matrix left, Matrix right);
// Create rotation matrix from axis and angle // Create rotation matrix from axis and angle
// NOTE: Angle should be provided in radians // NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixTranslate(float x, float y, float z); public static extern Matrix MatrixTranslate(float x, float y, float z);
// Returns x-rotation matrix (angle in radians) // Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotate(Vector3 axis, float angle); public static extern Matrix MatrixRotate(Vector3 axis, float angle);
// Returns x-rotation matrix (angle in radians) // Returns x-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateX(float angle); public static extern Matrix MatrixRotateX(float angle);
// Returns y-rotation matrix (angle in radians) // Returns y-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateY(float angle); public static extern Matrix MatrixRotateY(float angle);
// Returns z-rotation matrix (angle in radians) // Returns z-rotation matrix (angle in radians)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixRotateZ(float angle); public static extern Matrix MatrixRotateZ(float angle);
// Returns scaling matrix // Returns scaling matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixScale(float x, float y, float z); public static extern Matrix MatrixScale(float x, float y, float z);
// Returns two matrix multiplication // Returns two matrix multiplication
// NOTE: When multiplying matrices... the order matters! // NOTE: When multiplying matrices... the order matters!
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixMultiply(Matrix left, Matrix right); public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
// Returns perspective projection matrix // Returns perspective projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far); public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
// Returns perspective projection matrix // Returns perspective projection matrix
// NOTE: Angle should be provided in radians // NOTE: Angle should be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far); public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
// Returns orthographic projection matrix // Returns orthographic projection matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far); public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
// Returns camera look-at matrix (view matrix) // Returns camera look-at matrix (view matrix)
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up); public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
// Returns float array of matrix data // Returns float array of matrix data
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float[] MatrixToFloatV(Matrix mat); public static extern float[] MatrixToFloatV(Matrix mat);
// Returns identity quaternion // Returns identity quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionIdentity(); public static extern Quaternion QuaternionIdentity();
// Computes the length of a quaternion // Computes the length of a quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern float QuaternionLength(Quaternion q); public static extern float QuaternionLength(Quaternion q);
// Normalize provided quaternion // Normalize provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNormalize(Quaternion q); public static extern Quaternion QuaternionNormalize(Quaternion q);
// Invert provided quaternion // Invert provided quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionInvert(Quaternion q); public static extern Quaternion QuaternionInvert(Quaternion q);
// Calculate two quaternion multiplication // Calculate two quaternion multiplication
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2); public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
// Calculate linear interpolation between two quaternions // Calculate linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
// Calculate slerp-optimized interpolation between two quaternions // Calculate slerp-optimized interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
// Calculates spherical linear interpolation between two quaternions // Calculates spherical linear interpolation between two quaternions
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
// Calculate quaternion based on the rotation from one vector to another // Calculate quaternion based on the rotation from one vector to another
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to); public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
// Returns a quaternion for a given rotation matrix // Returns a quaternion for a given rotation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromMatrix(Matrix mat); public static extern Quaternion QuaternionFromMatrix(Matrix mat);
// Returns a matrix for a given quaternion // Returns a matrix for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix QuaternionToMatrix(Quaternion q); public static extern Matrix QuaternionToMatrix(Quaternion q);
// Returns rotation quaternion for an angle and axis // Returns rotation quaternion for an angle and axis
// NOTE: angle must be provided in radians // NOTE: angle must be provided in radians
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle); public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
// Returns the rotation angle and axis for a given quaternion // Returns the rotation angle and axis for a given quaternion
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern void QuaternionToAxisAngle(Quaternion q, out Vector3 outAxis, float[] outAngle); public static extern void QuaternionToAxisAngle(Quaternion q, out Vector3 outAxis, float[] outAngle);
// Returns he quaternion equivalent to Euler angles // Returns he quaternion equivalent to Euler angles
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromEuler(float roll, float pitch, float yaw); public static extern Quaternion QuaternionFromEuler(float roll, float pitch, float yaw);
// Return the Euler angles equivalent to quaternion (roll, pitch, yaw) // Return the Euler angles equivalent to quaternion (roll, pitch, yaw)
// NOTE: Angles are returned in a Vector3 struct in degrees // NOTE: Angles are returned in a Vector3 struct in degrees
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 QuaternionToEuler(Quaternion q); public static extern Vector3 QuaternionToEuler(Quaternion q);
// Transform a quaternion given a transformation matrix // Transform a quaternion given a transformation matrix
[DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName,CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat); 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>(); var TypeMap = new Dictionary<string, string>();
typesfile = typesfile.Where(x => x != "").ToArray(); typesfile = typesfile.Where(x => x != "").ToArray();
Console.WriteLine("Enter the path to raylib.");
var raylibPath = Console.ReadLine() + "/src/";
var sources = new KeyValuePair<string, string>[] { var sources = new KeyValuePair<string, string>[] {
new KeyValuePair<string, string>( "raylib.h","RLAPI"), new KeyValuePair<string, string>("raylib.h","RLAPI"),
// new KeyValuePair<string, string>("physac.h", "PHYSACDEF"), new KeyValuePair<string, string>("raymath.h", "RMDEF"),
// new KeyValuePair<string, string>( "easings.h","EASEDEF"), new KeyValuePair<string, string>("physac.h", "PHYSACDEF"),
// new KeyValuePair<string, string>( "raygui.h","RAYGUIDEF") 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 sourcefilename = sourceAndExportTag.Key;
var types = new HashSet<string>();
var enums = new HashSet<string>();
var Funcs = new List<Function>();
var sourcefilename = sourcefilenameandexporttag.Key;
var FileName = new CultureInfo("en-us", false).TextInfo.ToTitleCase(sourcefilename.Replace(".h", "")); var FileName = new CultureInfo("en-us", false).TextInfo.ToTitleCase(sourcefilename.Replace(".h", ""));
var ExportTag = sourcefilenameandexporttag.Value; var ExportTag = sourceAndExportTag.Value;
var sourcefile = File.ReadAllLines(sourcefilename); var sourcefile = File.ReadAllLines(raylibPath + sourcefilename);
var syntax = GetSyntax(sourcefile, ExportTag, TypeMap, typesfile); var syntax = GetSyntax(sourcefile, ExportTag, TypeMap, typesfile);
GenerateBinding(syntax, FileName); GenerateBinding(syntax, FileName);
} }
return;
} }
// Takes the source from a raylib module and stores the syntax data // Takes the source from a raylib module and stores the syntax data
@ -708,6 +706,7 @@ namespace Generator
new[]{ new[]{
Token(SyntaxKind.PublicKeyword), Token(SyntaxKind.PublicKeyword),
Token(SyntaxKind.ConstKeyword)})); Token(SyntaxKind.ConstKeyword)}));
RaylibClass = RaylibClass.AddMembers(LibraryNameField); RaylibClass = RaylibClass.AddMembers(LibraryNameField);
foreach (var Func in Funcs) foreach (var Func in Funcs)
{ {
@ -784,6 +783,14 @@ namespace Generator
Console.WriteLine("Finished generating bindings for file "); Console.WriteLine("Finished generating bindings for file ");
Console.ReadLine(); 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 Logo](https://github.com/ChrisDill/Raylib-cs/blob/master/Logo/raylib-cs_256x256.png "Raylib-cs Logo")
# Raylib-cs # Raylib-cs
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com) C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
# Installation # Installation
So far, I have only tested on Windows. Tips on making things work smoothly on all platforms is appreciated. So far, I have only done a few tests on Windows and Linux.
1. Add the [nuget package](https://www.nuget.org/packages/Raylib-cs/) ## Package
2. Start coding! 1. Install the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
```csharp 2. Start coding!
using Raylib;
using rl = Raylib.Raylib; ## Manual
1. Copy or reference the bindings into your project. See Tests for reference.
static class Program
{ 2. Make sure your project finds the native library that matches your platform and configuration.
public static void Main()
{ 3. Start coding!
rl.InitWindow(640, 480, "Hello World");
```csharp
while (!rl.WindowShouldClose()) using Raylib;
{ using rl = Raylib.Raylib;
rl.BeginDrawing();
static class Program
rl.ClearBackground(Color.WHITE); {
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK); public static void Main()
{
rl.EndDrawing(); rl.InitWindow(640, 480, "Hello World");
}
while (!rl.WindowShouldClose())
rl.CloseWindow(); {
} rl.BeginDrawing();
}
``` rl.ClearBackground(Color.WHITE);
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);
# Tech notes
- Enums are passed as `int` to prevent the need for explicit casts. rl.EndDrawing();
- Color defines stored inside `Color`. }
- Uses `string.Format` in place of `TextFormat`.
rl.CloseWindow();
# Extras }
- Structs have constructors. }
- Operator overloading for math types. ```
# Contributing # Tech notes
If you have any ideas, feel free to open an issue and tell me what you think. - Enums are passed as `int` to prevent the need for explicit casts.
If you'd like to contribute, please fork the repository and make changes as - Color defines stored inside `Color`.
you'd like. Pull requests are warmly welcome. - Uses `string.Format` in place of `TextFormat`.
- Structs have constructors.
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). - Operator overloads for math types.
# License # Contributing
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. 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 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 15
VisualStudioVersion = 15.0.27703.2035 VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Examples", "Examples\Examples.shproj", "{36E54E2A-5899-4D4D-9D78-120DB1B4C7B2}" Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Examples", "Examples\Examples.shproj", "{36E54E2A-5899-4D4D-9D78-120DB1B4C7B2}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "Generator\Generator.csproj", "{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Generator", "Generator\Generator.csproj", "{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCore", "Tests\Test.NetCore\Test.NetCore.csproj", "{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCore", "Tests\Test.NetCore\Test.NetCore.csproj", "{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCoreRT", "Tests\Test.NetCoreRT\Test.NetCoreRT.csproj", "{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.NetCoreRT", "Tests\Test.NetCoreRT\Test.NetCoreRT.csproj", "{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NetFX", "Tests\Test.NetFX\Test.NetFX.csproj", "{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NetFX", "Tests\Test.NetFX\Test.NetFX.csproj", "{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}"
EndProject EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Raylib", "Bindings\Raylib.shproj", "{F660FF67-D70E-4AE0-9080-D922243E9B6E}" Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Raylib", "Bindings\Raylib.shproj", "{F660FF67-D70E-4AE0-9080-D922243E9B6E}"
EndProject EndProject
Global Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution GlobalSection(SharedMSBuildProjectFiles) = preSolution
Examples\Examples.projitems*{36e54e2a-5899-4d4d-9d78-120db1b4c7b2}*SharedItemsImports = 13 Examples\Examples.projitems*{36e54e2a-5899-4d4d-9d78-120db1b4c7b2}*SharedItemsImports = 13
Bindings\Raylib.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4 Bindings\Raylib.projitems*{55d7bb37-3dc7-4a33-b21e-4f549ec988b5}*SharedItemsImports = 4
Examples\Examples.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 Bindings\Raylib.projitems*{f660ff67-d70e-4ae0-9080-d922243e9b6e}*SharedItemsImports = 13
EndGlobalSection EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64 Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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|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.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Debug|x86.Build.0 = 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.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x64.Build.0 = 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.ActiveCfg = Release|Any CPU
{5B690E7B-6D8C-4AA8-92AE-A3BF0750B573}.Release|x86.Build.0 = 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|Any CPU.ActiveCfg = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x64.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|x64.Build.0 = Debug|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Debug|x86.ActiveCfg = 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|Any CPU.ActiveCfg = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x64.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|x64.Build.0 = Release|x64
{523DEE6A-20CD-47AB-94A6-8D3C3CF9ADAD}.Release|x86.ActiveCfg = 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.ActiveCfg = Debug|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Debug|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Debug|x86.Build.0 = 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.ActiveCfg = Release|Any CPU
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|Any CPU.Build.0 = 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.ActiveCfg = Release|x64
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x64.Build.0 = 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.ActiveCfg = Release|x86
{B0CA8E8E-499A-4BF2-9A2E-4A8BCED92101}.Release|x86.Build.0 = 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.ActiveCfg = Debug|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Debug|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Debug|x86.Build.0 = 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.ActiveCfg = Release|Any CPU
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|Any CPU.Build.0 = 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.ActiveCfg = Release|x64
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x64.Build.0 = 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.ActiveCfg = Release|x86
{55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.Build.0 = Release|x86 {55D7BB37-3DC7-4A33-B21E-4F549EC988B5}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {78DCF9A2-1328-489A-8B03-F0BFB29EC58F} SolutionGuid = {78DCF9A2-1328-489A-8B03-F0BFB29EC58F}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -1,11 +1,11 @@
 
namespace Test.NetCore namespace Test.NetCore
{ {
class Program class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Examples.Test.Run(args); Examples.Test.Run(args);
} }
} }
} }

View File

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

View File

@ -1,11 +1,11 @@
 
namespace Test.NetCoreRT namespace Test.NetCoreRT
{ {
class Program class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Examples.Test.Run(args); Examples.Test.Run(args);
} }
} }
} }

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
 
namespace Test.NetFX namespace Test.NetFX
{ {
class Program class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Examples.Test.Run(args); Examples.Test.Run(args);
} }
} }
} }

View File

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

View File

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

View File

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