Alot of binding improvements!
- Improved bindings and added initial ones for Easings, Physac, Raygui and Raymath(Not yet fully tested). - Renamed ExamplesApplication to Bindings to make it more clear. - Examples separated from bindings. - Improve readme to reflect changes.
112
Bindings/Easings.cs
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
#region Raylib-cs Enums
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Types
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public static partial class rl
|
||||
{
|
||||
#region Raylib-cs Variables
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Functions
|
||||
|
||||
// Linear Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseLinearNone(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseLinearIn(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseLinearOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseLinearInOut(float t, float b, float c, float d);
|
||||
|
||||
// Sine Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseSineIn(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseSineOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseSineInOut(float t, float b, float c, float d);
|
||||
|
||||
// Circular Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCircIn(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCircOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCircInOut(float t, float b, float c, float d);
|
||||
|
||||
// Cubic Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCubicIn(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCubicOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseCubicInOut(float t, float b, float c, float d);
|
||||
|
||||
// Quadratic Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseQuadIn(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseQuadOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseQuadInOut(float t, float b, float c, float d);
|
||||
|
||||
|
||||
// Exponential Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseExpoIn(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseExpoOut(float t, float b, float c, float d);
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseExpoInOut(float t, float b, float c, float d);
|
||||
|
||||
|
||||
// Back Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBackIn(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBackOut(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBackInOut(float t, float b, float c, float d);
|
||||
|
||||
|
||||
// Bounce Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBounceOut(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBounceIn(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseBounceInOut(float t, float b, float c, float d);
|
||||
|
||||
|
||||
// Elastic Easing functions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseElasticIn(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseElasticOut(float t, float b, float c, float d);
|
||||
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float EaseElasticInOut(float t, float b, float c, float d);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
11
Bindings/Program.cs
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
namespace Bindings
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Examples.core_basic_window();
|
||||
}
|
||||
}
|
||||
}
|
361
Bindings/Raygui.cs
Normal file
@ -0,0 +1,361 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
#region Raylib-cs Enums
|
||||
|
||||
// Gui properties enumeration
|
||||
enum GuiProperty
|
||||
{
|
||||
//--------------------------------------------
|
||||
// NOTE: This first set of properties is for general style,
|
||||
// following control-specific properties overwritte those styles
|
||||
DEFAULT_BACKGROUND_COLOR = 0,
|
||||
DEFAULT_LINES_COLOR,
|
||||
DEFAULT_TEXT_FONT,
|
||||
DEFAULT_TEXT_SIZE,
|
||||
DEFAULT_BORDER_WIDTH,
|
||||
DEFAULT_BORDER_COLOR_NORMAL,
|
||||
DEFAULT_BASE_COLOR_NORMAL,
|
||||
DEFAULT_TEXT_COLOR_NORMAL,
|
||||
DEFAULT_BORDER_COLOR_FOCUSED,
|
||||
DEFAULT_BASE_COLOR_FOCUSED,
|
||||
DEFAULT_TEXT_COLOR_FOCUSED,
|
||||
DEFAULT_BORDER_COLOR_PRESSED,
|
||||
DEFAULT_BASE_COLOR_PRESSED,
|
||||
DEFAULT_TEXT_COLOR_PRESSED,
|
||||
DEFAULT_BORDER_COLOR_DISABLED,
|
||||
DEFAULT_BASE_COLOR_DISABLED,
|
||||
DEFAULT_TEXT_COLOR_DISABLED,
|
||||
//--------------------------------------------
|
||||
// Label
|
||||
LABEL_TEXT_COLOR_NORMAL,
|
||||
LABEL_TEXT_COLOR_FOCUSED,
|
||||
LABEL_TEXT_COLOR_PRESSED,
|
||||
LABEL_TEXT_COLOR_DISABLED,
|
||||
// Button
|
||||
BUTTON_BORDER_WIDTH,
|
||||
BUTTON_BORDER_COLOR_NORMAL,
|
||||
BUTTON_BASE_COLOR_NORMAL,
|
||||
BUTTON_TEXT_COLOR_NORMAL,
|
||||
BUTTON_BORDER_COLOR_FOCUSED,
|
||||
BUTTON_BASE_COLOR_FOCUSED,
|
||||
BUTTON_TEXT_COLOR_FOCUSED,
|
||||
BUTTON_BORDER_COLOR_PRESSED,
|
||||
BUTTON_BASE_COLOR_PRESSED,
|
||||
BUTTON_TEXT_COLOR_PRESSED,
|
||||
BUTTON_BORDER_COLOR_DISABLED,
|
||||
BUTTON_BASE_COLOR_DISABLED,
|
||||
BUTTON_TEXT_COLOR_DISABLED,
|
||||
// Toggle
|
||||
TOGGLE_BORDER_WIDTH,
|
||||
TOGGLE_BORDER_COLOR_NORMAL,
|
||||
TOGGLE_BASE_COLOR_NORMAL,
|
||||
TOGGLE_TEXT_COLOR_NORMAL,
|
||||
TOGGLE_BORDER_COLOR_FOCUSED,
|
||||
TOGGLE_BASE_COLOR_FOCUSED,
|
||||
TOGGLE_TEXT_COLOR_FOCUSED,
|
||||
TOGGLE_BORDER_COLOR_PRESSED,
|
||||
TOGGLE_BASE_COLOR_PRESSED,
|
||||
TOGGLE_TEXT_COLOR_PRESSED,
|
||||
TOGGLE_BORDER_COLOR_DISABLED,
|
||||
TOGGLE_BASE_COLOR_DISABLED,
|
||||
TOGGLE_TEXT_COLOR_DISABLED,
|
||||
TOGGLEGROUP_PADDING,
|
||||
// Slider
|
||||
SLIDER_BORDER_WIDTH,
|
||||
SLIDER_SLIDER_WIDTH,
|
||||
SLIDER_BORDER_COLOR_NORMAL,
|
||||
SLIDER_BASE_COLOR_NORMAL,
|
||||
SLIDER_BORDER_COLOR_FOCUSED,
|
||||
SLIDER_BASE_COLOR_FOCUSED,
|
||||
SLIDER_BORDER_COLOR_PRESSED,
|
||||
SLIDER_BASE_COLOR_PRESSED,
|
||||
SLIDER_BORDER_COLOR_DISABLED,
|
||||
SLIDER_BASE_COLOR_DISABLED,
|
||||
// SliderBar
|
||||
SLIDERBAR_INNER_PADDING,
|
||||
SLIDERBAR_BORDER_WIDTH,
|
||||
SLIDERBAR_BORDER_COLOR_NORMAL,
|
||||
SLIDERBAR_BASE_COLOR_NORMAL,
|
||||
SLIDERBAR_BORDER_COLOR_FOCUSED,
|
||||
SLIDERBAR_BASE_COLOR_FOCUSED,
|
||||
SLIDERBAR_BORDER_COLOR_PRESSED,
|
||||
SLIDERBAR_BASE_COLOR_PRESSED,
|
||||
SLIDERBAR_BORDER_COLOR_DISABLED,
|
||||
SLIDERBAR_BASE_COLOR_DISABLED,
|
||||
// ProgressBar
|
||||
PROGRESSBAR_INNER_PADDING,
|
||||
PROGRESSBAR_BORDER_WIDTH,
|
||||
PROGRESSBAR_BORDER_COLOR_NORMAL,
|
||||
PROGRESSBAR_BASE_COLOR_NORMAL,
|
||||
PROGRESSBAR_BORDER_COLOR_FOCUSED,
|
||||
PROGRESSBAR_BASE_COLOR_FOCUSED,
|
||||
PROGRESSBAR_BORDER_COLOR_PRESSED,
|
||||
PROGRESSBAR_BASE_COLOR_PRESSED,
|
||||
PROGRESSBAR_BORDER_COLOR_DISABLED,
|
||||
PROGRESSBAR_BASE_COLOR_DISABLED,
|
||||
// ValueBox
|
||||
VALUEBOX_BUTTON_PADDING,
|
||||
VALUEBOX_BUTTONS_WIDTH,
|
||||
VALUEBOX_BORDER_COLOR_NORMAL,
|
||||
VALUEBOX_BASE_COLOR_NORMAL,
|
||||
VALUEBOX_TEXT_COLOR_NORMAL,
|
||||
VALUEBOX_BORDER_COLOR_FOCUSED,
|
||||
VALUEBOX_BASE_COLOR_FOCUSED,
|
||||
VALUEBOX_TEXT_COLOR_FOCUSED,
|
||||
VALUEBOX_BORDER_COLOR_PRESSED,
|
||||
VALUEBOX_BASE_COLOR_PRESSED,
|
||||
VALUEBOX_TEXT_COLOR_PRESSED,
|
||||
VALUEBOX_BORDER_COLOR_DISABLED,
|
||||
VALUEBOX_BASE_COLOR_DISABLED,
|
||||
VALUEBOX_TEXT_COLOR_DISABLED,
|
||||
// ComboBox
|
||||
COMBOBOX_BORDER_WIDTH,
|
||||
COMBOBOX_BUTTON_PADDING,
|
||||
COMBOBOX_SELECTOR_WIDTH,
|
||||
COMBOBOX_BORDER_COLOR_NORMAL,
|
||||
COMBOBOX_BASE_COLOR_NORMAL,
|
||||
COMBOBOX_TEXT_COLOR_NORMAL,
|
||||
COMBOBOX_BORDER_COLOR_FOCUSED,
|
||||
COMBOBOX_BASE_COLOR_FOCUSED,
|
||||
COMBOBOX_TEXT_COLOR_FOCUSED,
|
||||
COMBOBOX_BORDER_COLOR_PRESSED,
|
||||
COMBOBOX_BASE_COLOR_PRESSED,
|
||||
COMBOBOX_TEXT_COLOR_PRESSED,
|
||||
COMBOBOX_BORDER_COLOR_DISABLED,
|
||||
COMBOBOX_BASE_COLOR_DISABLED,
|
||||
COMBOBOX_TEXT_COLOR_DISABLED,
|
||||
// CheckBox
|
||||
CHECKBOX_BORDER_WIDTH,
|
||||
CHECKBOX_INNER_PADDING,
|
||||
CHECKBOX_BORDER_COLOR_NORMAL,
|
||||
CHECKBOX_BASE_COLOR_NORMAL,
|
||||
CHECKBOX_BORDER_COLOR_FOCUSED,
|
||||
CHECKBOX_BASE_COLOR_FOCUSED,
|
||||
CHECKBOX_BORDER_COLOR_PRESSED,
|
||||
CHECKBOX_BASE_COLOR_PRESSED,
|
||||
CHECKBOX_BORDER_COLOR_DISABLED,
|
||||
CHECKBOX_BASE_COLOR_DISABLED,
|
||||
// TextBox
|
||||
TEXTBOX_BORDER_WIDTH,
|
||||
TEXTBOX_BORDER_COLOR_NORMAL,
|
||||
TEXTBOX_BASE_COLOR_NORMAL,
|
||||
TEXTBOX_TEXT_COLOR_NORMAL,
|
||||
TEXTBOX_BORDER_COLOR_FOCUSED,
|
||||
TEXTBOX_BASE_COLOR_FOCUSED,
|
||||
TEXTBOX_TEXT_COLOR_FOCUSED,
|
||||
TEXTBOX_BORDER_COLOR_PRESSED,
|
||||
TEXTBOX_BASE_COLOR_PRESSED,
|
||||
TEXTBOX_TEXT_COLOR_PRESSED,
|
||||
TEXTBOX_BORDER_COLOR_DISABLED,
|
||||
TEXTBOX_BASE_COLOR_DISABLED,
|
||||
TEXTBOX_TEXT_COLOR_DISABLED,
|
||||
// ColorPicker
|
||||
COLORPICKER_BARS_THICK,
|
||||
COLORPICKER_BARS_PADDING,
|
||||
COLORPICKER_BORDER_COLOR_NORMAL,
|
||||
COLORPICKER_BASE_COLOR_NORMAL,
|
||||
COLORPICKER_BORDER_COLOR_FOCUSED,
|
||||
COLORPICKER_BASE_COLOR_FOCUSED,
|
||||
COLORPICKER_BORDER_COLOR_PRESSED,
|
||||
COLORPICKER_BASE_COLOR_PRESSED,
|
||||
COLORPICKER_BORDER_COLOR_DISABLED,
|
||||
COLORPICKER_BASE_COLOR_DISABLED,
|
||||
// ListView
|
||||
LISTVIEW_ELEMENTS_HEIGHT,
|
||||
LISTVIEW_ELEMENTS_PADDING,
|
||||
LISTVIEW_BAR_WIDTH,
|
||||
LISTVIEW_BORDER_COLOR_NORMAL,
|
||||
LISTVIEW_BASE_COLOR_NORMAL,
|
||||
LISTVIEW_TEXT_COLOR_NORMAL,
|
||||
LISTVIEW_BORDER_COLOR_FOCUSED,
|
||||
LISTVIEW_BASE_COLOR_FOCUSED,
|
||||
LISTVIEW_TEXT_COLOR_FOCUSED,
|
||||
LISTVIEW_BORDER_COLOR_PRESSED,
|
||||
LISTVIEW_BASE_COLOR_PRESSED,
|
||||
LISTVIEW_TEXT_COLOR_PRESSED,
|
||||
LISTVIEW_BORDER_COLOR_DISABLED,
|
||||
LISTVIEW_BASE_COLOR_DISABLED,
|
||||
LISTVIEW_TEXT_COLOR_DISABLED
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Types
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public static partial class rl
|
||||
{
|
||||
#region Raylib-cs Variables
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Functions
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module Functions Declaration
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Global gui modification functions
|
||||
// Enable gui controls (global state)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiEnable();
|
||||
|
||||
// Disable gui controls (global state)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiDisable();
|
||||
|
||||
// Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiFade(float alpha);
|
||||
|
||||
|
||||
// Style set/get functions
|
||||
// Set one style property
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiSetStyleProperty(int guiProperty, int value);
|
||||
|
||||
// Get one style property
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiGetStyleProperty(int guiProperty);
|
||||
|
||||
|
||||
// Container/separator controls, useful for controls organization
|
||||
// Window Box control, shows a window that can be closed
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiWindowBox(Rectangle bounds, string text);
|
||||
|
||||
// Group Box control with title name
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiGroupBox(Rectangle bounds, string text);
|
||||
|
||||
// Line separator control
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiLine(Rectangle bounds, int thick);
|
||||
|
||||
// Panel control, useful to group controls
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiPanel(Rectangle bounds);
|
||||
|
||||
// Scroll Panel control
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Vector2 GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 viewScroll);
|
||||
|
||||
|
||||
|
||||
// Basic controls set
|
||||
// Label control, shows text
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiLabel(Rectangle bounds, string text);
|
||||
|
||||
// Button control, returns true when clicked
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiButton(Rectangle bounds, string text);
|
||||
|
||||
// Label button control, show true when clicked
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiLabelButton(Rectangle bounds, string text);
|
||||
|
||||
// Image button control, returns true when clicked
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiImageButton(Rectangle bounds, Texture2D texture);
|
||||
|
||||
// Image button extended control, returns true when clicked
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiImageButtonEx(Rectangle bounds, Texture2D texture, Rectangle texSource, string text);
|
||||
|
||||
// Toggle Button control, returns true when active
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiToggleButton(Rectangle bounds, string text, bool toggle);
|
||||
|
||||
// Toggle Group control, returns toggled button index
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiToggleGroup(Rectangle bounds, string text, int count, int active);
|
||||
|
||||
// Check Box control, returns true when active
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiCheckBox(Rectangle bounds, bool isChecked);
|
||||
|
||||
// Check Box control with text, returns true when active
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiCheckBoxEx(Rectangle bounds, bool isChecked, string text);
|
||||
|
||||
// Combo Box control, returns selected item index
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiComboBox(Rectangle bounds, string text, int count, int active);
|
||||
|
||||
// Dropdown Box control, returns selected item
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiDropdownBox(Rectangle bounds, string[] text, int count, int active);
|
||||
|
||||
// Spinner control, returns selected value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiSpinner(Rectangle bounds, int value, int maxValue, int btnWidth);
|
||||
|
||||
// Value Box control, updates input text with numbers
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiValueBox(Rectangle bounds, int value, int maxValue);
|
||||
|
||||
// Text Box control, updates input text
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiTextBox(Rectangle bounds, char text, int textSize, bool freeEdit);
|
||||
|
||||
// Text Box control with multiple lines
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiTextBoxMulti(Rectangle bounds, string text, int textSize, bool editMode);
|
||||
|
||||
// Slider control, returns selected value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue);
|
||||
|
||||
// Slider control, returns selected value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiSliderEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
|
||||
|
||||
// Slider Bar control, returns selected value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue);
|
||||
|
||||
// Slider Bar control, returns selected value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiSliderBarEx(Rectangle bounds, float value, float minValue, float maxValue, string text, bool showValue);
|
||||
|
||||
// Progress Bar control, shows current progress value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiProgressBar(Rectangle bounds, float value, float minValue, float maxValue);
|
||||
|
||||
// Progress Bar control, shows current progress value
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float GuiProgressBarEx(Rectangle bounds, float value, float minValue, float maxValue, bool showValue);
|
||||
|
||||
// Status Bar control, shows info text
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiStatusBar(Rectangle bounds, string text, int offsetX);
|
||||
|
||||
// Dummy control for placeholders
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void GuiDummyRec(Rectangle bounds, string text);
|
||||
|
||||
|
||||
// Advance controls set
|
||||
// List View control, returns selected list element index
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern int GuiListView(Rectangle bounds, string text, int count, int active);
|
||||
|
||||
// Color Picker control
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Color GuiColorPicker(Rectangle bounds, Color color);
|
||||
|
||||
// Message Box control, displays a message
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern bool GuiMessageBox(Rectangle bounds, string windowTitle, string message);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -407,7 +407,7 @@ namespace Raylib
|
||||
public int offsetX; // Character offset X when drawing
|
||||
public int offsetY; // Character offset Y when drawing
|
||||
public int advanceX; // Character advance position X
|
||||
public byte[] data; // Character pixel data (grayscale)
|
||||
public unsafe void* data;// Character pixel data (grayscale)
|
||||
}
|
||||
|
||||
// Font type, includes texture and charSet array data
|
||||
@ -417,7 +417,7 @@ namespace Raylib
|
||||
public Texture2D texture; // Font texture
|
||||
public int baseSize; // Base size (default chars height)
|
||||
public int charsCount; // Number of characters
|
||||
public CharInfo[] chars; // Characters info data
|
||||
public unsafe CharInfo* chars; // Characters info data
|
||||
}
|
||||
|
||||
// Camera type, defines a camera position/orientation in 3d space
|
@ -27,6 +27,11 @@ namespace Raylib
|
||||
return x.GetHashCode() + y.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "Vector2(" + x + " " + y + ")";
|
||||
}
|
||||
|
||||
// utility for c functions Vector2Zero -> Zero etc
|
||||
[DllImport(rl.nativeLibName, EntryPoint = "Vector2Zero")]
|
||||
public static extern Vector2 Zero();
|
||||
@ -137,9 +142,12 @@ namespace Raylib
|
||||
public static extern Vector3 Normalize(Vector3 v);
|
||||
|
||||
// operators
|
||||
[DllImport(rl.nativeLibName, EntryPoint = "Vector3Scale")]
|
||||
[DllImport(rl.nativeLibName, EntryPoint = "Vector3MultiplyV")]
|
||||
public static extern Vector3 operator *(Vector3 v1, Vector3 v3);
|
||||
|
||||
[DllImport(rl.nativeLibName, EntryPoint = "Vector3Multiply")]
|
||||
public static extern Vector3 operator *(Vector3 v1, float scale);
|
||||
|
||||
[DllImport(rl.nativeLibName, EntryPoint = "Vector3Divide")]
|
||||
public static extern Vector3 operator /(Vector3 v1, Vector3 v3);
|
||||
|
||||
@ -348,111 +356,154 @@ namespace Raylib
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float[] Vector3ToFloatV(Vector3 v);
|
||||
|
||||
|
||||
// Compute matrix determinant
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float MatrixDeterminant(Matrix mat);
|
||||
|
||||
// Returns the trace of the matrix (sum of the values along the diagonal)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float MatrixTrace(Matrix mat);
|
||||
|
||||
// Transposes provided matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixTranspose(Matrix mat);
|
||||
|
||||
// Invert provided matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixInvert(Matrix mat);
|
||||
|
||||
// Normalize provided matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixNormalize(Matrix mat);
|
||||
|
||||
// Returns identity matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixIdentity();
|
||||
|
||||
// Add two matrices
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixAdd(Matrix left, Matrix right);
|
||||
|
||||
// Substract two matrices (left - right)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixSubstract(Matrix left, Matrix right);
|
||||
|
||||
// Create rotation matrix from axis and angle
|
||||
// NOTE: Angle should be provided in radians
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixTranslate(float x, float y, float z);
|
||||
|
||||
// Returns x-rotation matrix (angle in radians)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixRotate(Vector3 axis, float angle);
|
||||
|
||||
// Returns x-rotation matrix (angle in radians)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixRotateX(float angle);
|
||||
|
||||
// Returns y-rotation matrix (angle in radians)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixRotateY(float angle);
|
||||
|
||||
// Returns z-rotation matrix (angle in radians)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixRotateZ(float angle);
|
||||
|
||||
// Returns scaling matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixScale(float x, float y, float z);
|
||||
|
||||
// Returns two matrix multiplication
|
||||
// NOTE: When multiplying matrices... the order matters!
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
|
||||
|
||||
// Returns perspective projection matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
|
||||
|
||||
// Returns perspective projection matrix
|
||||
// NOTE: Angle should be provided in radians
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
|
||||
|
||||
// Returns orthographic projection matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
|
||||
|
||||
// Returns camera look-at matrix (view matrix)
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
|
||||
|
||||
// Returns float array of matrix data
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float[] MatrixToFloatV(Matrix mat);
|
||||
|
||||
|
||||
// Returns identity quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionIdentity();
|
||||
|
||||
// Computes the length of a quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern float QuaternionLength(Quaternion q);
|
||||
|
||||
// Normalize provided quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionNormalize(Quaternion q);
|
||||
|
||||
// Invert provided quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionInvert(Quaternion q);
|
||||
|
||||
// Calculate two quaternion multiplication
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
|
||||
|
||||
// Calculate linear interpolation between two quaternions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
|
||||
|
||||
// Calculate slerp-optimized interpolation between two quaternions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
|
||||
|
||||
// Calculates spherical linear interpolation between two quaternions
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
|
||||
|
||||
// Calculate quaternion based on the rotation from one vector to another
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
|
||||
|
||||
// Returns a quaternion for a given rotation matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionFromMatrix(Matrix mat);
|
||||
|
||||
// Returns a matrix for a given quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Matrix QuaternionToMatrix(Quaternion q);
|
||||
|
||||
// Returns rotation quaternion for an angle and axis
|
||||
// NOTE: angle must be provided in radians
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
|
||||
|
||||
// Returns the rotation angle and axis for a given quaternion
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern void QuaternionToAxisAngle(Quaternion q, out Vector3 outAxis, float[] outAngle);
|
||||
|
||||
// Returns he quaternion equivalent to Euler angles
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionFromEuler(float roll, float pitch, float yaw);
|
||||
|
||||
// Return the Euler angles equivalent to quaternion (roll, pitch, yaw)
|
||||
// NOTE: Angles are returned in a Vector3 struct in degrees
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Vector3 QuaternionToEuler(Quaternion q);
|
||||
|
||||
// Transform a quaternion given a transformation matrix
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat);
|
||||
|
BIN
Bindings/bin/Debug/ExampleApplication.exe
Normal file
1
Bindings/core_basic_window.cs
Normal file
@ -0,0 +1 @@
|
||||
|
@ -1,27 +0,0 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
#region Raylib-cs Enums
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Types
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public static partial class rl
|
||||
{
|
||||
#region Raylib-cs Variables
|
||||
|
||||
#endregion
|
||||
|
||||
#region Raylib-cs Functions
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 47 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 16 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 21 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 17 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 25 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 8.3 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 24 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 10 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 14 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 37 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 10 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 15 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 16 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 173 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 311 KiB |
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 384 KiB |
Before Width: | Height: | Size: 381 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 22 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 403 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 33 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 317 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 136 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 260 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 32 KiB |
@ -1,8 +0,0 @@
|
||||
|
||||
using Raylib;
|
||||
using static Raylib.rl;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
|
||||
*
|
Before Width: | Height: | Size: 417 KiB |
Before Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 372 KiB |
Before Width: | Height: | Size: 335 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 23 KiB |