This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The SerialRead callback returns the text read from the Read method | |
/// </summary> | |
public delegate void SerialRead(SerialPort port, string text); | |
/// <summary> | |
/// Read text from the port using a callback when text is ready | |
/// </summary> | |
public void Read(SerialRead readComplete) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Ports | |
{ | |
/// <summary> | |
/// The partity to use when opening a serial port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ReadNext(SerialPort port, string s) | |
{ | |
Console.Write(s); | |
port.Read(ReadNext); | |
} | |
public static void TestRead() | |
{ | |
Console.WriteLine("Testing serial port reads"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// The SerialRead callback returns the text read from the Read method | |
/// </summary> | |
public delegate void SerialRead(SerialPort port, string text); | |
/// <summary> | |
/// Read text from the port using a callback when text is ready | |
/// </summary> | |
public void Read(SerialRead readComplete) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit GPhoto2; | |
{$mode delphi} | |
interface | |
uses | |
Classes, SysUtils; | |
type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(********************************************************) | |
(* *) | |
(* Bare Game Library *) | |
(* http://www.baregame.org *) | |
(* 2.0.0.0 Released under the LGPL license 2017 *) | |
(* *) | |
(********************************************************) | |
{ <include docs/bare.system.txt> } | |
unit Bare.System; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$ifndef fpc} | |
'This library requires the free pascal compiler' | |
{$endif} | |
{$if fpc_fullversion < 30000} | |
'This library requires the free pascal compiler 3.0.0 or greater' | |
{$endif} | |
{$mode delphi} | |
{$macro on} | |
{$packrecords c} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Safer functions | |
public static unsafe void glDeleteBuffers(ref int[] buffers) | |
{ | |
var n = buffers.Length; | |
fixed (int* b = buffers) | |
_glDeleteBuffers(n, b); | |
} | |
public static unsafe int[] glGenBuffers(int n) | |
{ | |
var buffers = new int[n]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Bare.Geometry | |
{ | |
public struct Mat4 | |
{ | |
float m00; | |
float m01; | |
float m02; | |
float m03; | |
float m10; | |
float m11; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Delegates contains the function definitions for OpenGL ES 2.0. | |
/// </summary> | |
public static class Delegates | |
{ | |
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | |
public delegate void glActiveTexture(int texture); | |
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | |
public delegate void glAttachShader(int program, int shader); | |
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] |