content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using PaimonBot.Extensions.Data;
using PaimonBot.Extensions.DataModels;
using PaimonBot.Services;
using PaimonBot.Services.CurrencyHelper;
using PaimonBot.Services.HelpFormatter;
using Serilog;
using System;
using System.Text;
using System.Threading.Tasks;
namespace PaimonBot.Commands
{
[Group("currency")]
[Description("A set of commands to manipulate your current curency amount! Please make sure to create " +
"an account before using any of the commands.")]
[Cooldown(1, 3, CooldownBucketType.Channel)]
[Category(CategoryName.Account)]
public class CurrencyCommands : BaseCommandModule
{
[GroupCommand]
[Description("Default command to return back your current currency amount. Please ensure you've created an account.")]
[Cooldown(1,3, CooldownBucketType.Channel)]
public async Task CurrencyCall(CommandContext ctx)
{
var traveler = SharedData.PaimonDB.GetTravelerBy("DiscordID", ctx.User.Id);
if (traveler != null)
{
// If the traveler does not have realm currency information.
if (traveler.RealmCurrency == int.MinValue && traveler.CurrencyUpdated == null) // Traveler does not have Realm Information, meaning a strictly resin user
{
await PaimonServices.SendEmbedToChannelAsync(ctx.Channel, "Account Error",
$"It seems that your account does not have any Realm Currency Information. Please make sure you have an account created using `{SharedData.prefixes[0]}acc create`. Use the command as well to overwrite your data."
, TimeSpan.FromSeconds(6), ResponseType.Warning);
Log.Warning("[MISSING] User {Id}'s Realm Information was called, but did not exist. in {Channel}", ctx.User.Id, ctx.Channel);
return;
}
var embed = CurrencyEmbed(traveler, ctx.User);
var msgBuilder = new DiscordMessageBuilder().AddEmbed(embed);
await ctx.Channel.SendMessageAsync(msgBuilder).ConfigureAwait(false);
}
else
await PaimonServices.SendRespondAsync(ctx, $"It seems that you're not in the database, please create an account using `{SharedData.prefixes[0]}acc create`. " +
$"This command group will not function without an account. {Emojis.CryEmote}", TimeSpan.FromSeconds(5)).ConfigureAwait(false);
}
[Command("set")]
[Description("Sets your realm currency amount into the database. If you do not have an account, this command will not work. Please do p~acc create to create one.")]
[Cooldown(1, 3, CooldownBucketType.Channel)]
public async Task CurrencySet(CommandContext ctx, int amount)
{
var traveler = SharedData.PaimonDB.GetTravelerBy("DiscordID", ctx.User.Id);
if (traveler != null)
{
if (traveler.RealmCurrency == int.MinValue && traveler.CurrencyUpdated == null) // Traveler does not have Realm Information, meaning a strictly resin user
{
await PaimonServices.SendEmbedToChannelAsync(ctx.Channel, "Account Error",
$"It seems that your account does not have any Realm Currency Information. Please make sure you have an account created using `{SharedData.prefixes[0]}acc create`. Use the command as well to overwrite your data."
, TimeSpan.FromSeconds(6), ResponseType.Warning);
Log.Warning("User {Id}'s Realm Information was called, but did not exist. in {Channel}", ctx.User.Id, ctx.Channel);
return;
}
var realmTrustRank = traveler.RealmTrustRank;
var currencyCap = realmTrustRank.GetTrustRankCurrencyCap();
var adeptalEnergyLvl = CurrencyServices.ParseAdeptalFromInt(traveler.AdeptalEnergy);
// Amount > Cap, make it equal to Cap
if (amount > currencyCap)
amount = currencyCap;
else if (amount < 0)
amount = 0;
if (SharedData.currencyTimer.Exists(timer => timer.DiscordId == ctx.User.Id))
{
var timer = SharedData.currencyTimer.Find(timer => timer.DiscordId == ctx.User.Id);
timer.StopAndDispose();
SharedData.currencyTimer.Remove(timer);
Log.Information($"Previous Currency timer for User {ctx.User.Id} has been removed.");
}
var updateTraveler = traveler;
updateTraveler.RealmCurrency = amount;
updateTraveler.CurrencyUpdated = DateTime.UtcNow;
// Starting a new CurrencyTimer
var aTimer = new RealmCurrencyTimer(ctx.User.Id, realmTrustRank, adeptalEnergyLvl);
aTimer.Start();
SharedData.PaimonDB.ReplaceTraveler(updateTraveler);
SharedData.currencyTimer.Add(aTimer);
aTimer.CurrencyCapped += PaimonServices.ATimer_CurrencyCapped;
Log.Information($"Currency Timer has been started for {aTimer.DiscordId}!");
await ctx.RespondAsync($"You now have **{updateTraveler.RealmCurrency}** realm currency {Emojis.AdeptalEmote}. Please use `{SharedData.prefixes[0]}currency` to check your current realm currency. {Emojis.HappyEmote}").ConfigureAwait(false);
}
else
await PaimonServices.SendRespondAsync(ctx, $"It seems that you're not in the database, please create an account using `{SharedData.prefixes[0]}acc create`. " +
$"This command group will not function without an account. {Emojis.CryEmote}", TimeSpan.FromSeconds(5)).ConfigureAwait(false);
}
[Command("reset")]
[Description("Instantly resets your current realm currency amount to 0. If you do not have an account, this command will not work. Please use p~acc create to create one.")]
[Cooldown(1, 3, CooldownBucketType.User)]
public async Task ResinReset(CommandContext ctx)
{
await CurrencySet(ctx, 0);
}
private DiscordEmbedBuilder CurrencyEmbed(Traveler traveler, DiscordUser user)
{
var currentRC = traveler.RealmCurrency;
var cap = traveler.RealmTrustRank.GetTrustRankCurrencyCap();
var updatedOffset = (DateTimeOffset)traveler.CurrencyUpdated.ToUniversalTime();
var adeptalEnergy = CurrencyServices.ParseAdeptalFromInt(traveler.AdeptalEnergy);
StringBuilder sb = new StringBuilder();
sb.AppendLine($"Current Realm Trust Rank: **{traveler.RealmTrustRank}**");
sb.AppendLine($"Current Adeptal Energy amount and level: {Formatter.Bold(traveler.AdeptalEnergy.ToString())} {Emojis.AdeptalEmote} ({adeptalEnergy})");
sb.AppendLine($"You currently have {Formatter.Bold(currentRC.ToString())}/{cap} realm currency {Emojis.CurrencyEmote}");
sb.AppendLine($"You last updated your currency <t:{updatedOffset.ToUnixTimeSeconds()}:R>");
DiscordEmbedBuilder embed = new DiscordEmbedBuilder()
.WithTitle($"{user.Username}#{user.Discriminator}'s Realm Currency Information")
.WithColor(SharedData.defaultColour)
.WithThumbnail(user.AvatarUrl)
.WithFooter($"User {SharedData.prefixes[0]}currency set [amount] to set a new currency amount")
.WithDescription(sb.ToString())
.WithTimestamp(DateTime.Now);
return embed;
}
}
} | 59.150376 | 255 | 0.640651 | [
"MIT"
] | ybmirz/PaimonBot | PaimonBot/Commands/AccountCommands/CurrencyCommands.cs | 7,867 | C# |
using AbashonWeb.Domain;
using AbashonWeb.Persistence;
using AbashonWeb.Service.Contract;
using AbashonWeb.Service.Contract.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AbashonWeb.Infrastructure.Implementation.Repositories
{
public class Repository<TEntity> : IRepository<TEntity> where TEntity : BaseEntity
{
protected readonly ApplicationDbContext _dbContext;
protected DbSet<TEntity> _dbSet;
public Repository(ApplicationDbContext dbContext)
{
_dbContext = dbContext;
_dbSet = _dbContext.Set<TEntity>();
}
public virtual async Task AddAsync(TEntity entity)
{
await _dbSet.AddAsync(entity);
}
public virtual async Task RemoveAsync(int id)
{
var entityToDelete = await _dbSet.FindAsync(id);
Remove(entityToDelete);
}
public virtual void Remove(TEntity entityToDelete)
{
if (_dbContext.Entry(entityToDelete).State == EntityState.Detached)
{
_dbSet.Attach(entityToDelete);
}
_dbSet.Remove(entityToDelete);
}
public virtual void Edit(TEntity entityToUpdate)
{
_dbSet.Attach(entityToUpdate);
_dbContext.Entry(entityToUpdate).State = EntityState.Modified;
}
public virtual async Task<IList<TEntity>> GetAllAsync()
{
IQueryable<TEntity> query = _dbSet;
var list = await query.ToListAsync();
return list;
}
public virtual async Task<TEntity> GetByIdAsync(int id)
{
var enitity = await _dbSet.FindAsync(id);
return enitity;
}
}
}
| 30.432836 | 94 | 0.577244 | [
"Apache-2.0"
] | sa-abhi/abashon-app | AbashonWeb/AbashonWeb/AbashonWeb.Infrastructure/Implementation/Repositories/Repository.cs | 2,041 | C# |
namespace Examples.Interfaces
{
interface IShape : IDrawable, IPrintable
{
int GetNumberOfSides();
}
} | 17.571429 | 44 | 0.650407 | [
"MIT"
] | luigiberrettini/c-sharp-basics | Interfaces/IShape.cs | 125 | C# |
using System.Windows.Input;
using GalleyFramework.Infrastructure;
using GalleyFramework.ViewModels;
using GalleyFramework.Helpers.Flow;
using GalleyFramework.Sample.Locales;
using Xamarin.Forms;
using GalleyFramework.Extensions;
namespace GalleyFramework.Sample.ViewModels
{
public class StartViewModel : GalleyBaseViewModel
{
public StartViewModel() : base(GalleyCreateType.ViewFirstAppearing)
{
}
public ICommand GoToSecondViewCommand => GetCommand(async () =>
{
await Galley.Navigation.Push<AnotherViewModel>(animName: "push");
});
}
}
| 25.625 | 77 | 0.720325 | [
"Apache-2.0"
] | AndreiMisiukevich/GalleyFramework | GalleyFramework.Sample/GalleyFramework.Sample/ViewModels/StartViewModel.cs | 617 | C# |
using System.Threading.Tasks;
namespace Storm.Formification.WebWithDb.Forms
{
public interface IFormDataStore<TForm> where TForm : class, new()
{
Task<FormDataStoreResult> Save(string documentId, string secretId, TForm formData);
Task<TForm?> Retrieve(string documentId, string secretId);
}
}
| 30.272727 | 92 | 0.705706 | [
"MIT"
] | stormid/storm-formification | samples/Storm.Formification.WebWithDb/Forms/IFormDataStore.cs | 335 | C# |
using System;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using AutoMapper;
namespace Sentinel.Api.Shipping.Controllers
{
[ApiVersion("1.0", Deprecated = true)]
[Route("api/Product")]
//[Route("api/v{version:apiVersion}/Product")]
[ApiController]
public class ProductV1Controller : ControllerBase
{
ILogger<ProductV1Controller> logger;
private IMapper mapper;
public ProductV1Controller(ILogger<ProductV1Controller> logger, IMapper mapper)
{
this.logger = logger;
this.mapper = mapper;
}
[HttpGet]
public IActionResult Get()
{
try
{
// var repos = repo.GetAll().Select(mapper.Map<ProductInfo,ProductInfoDtoV1>);
return Ok();
}
catch (Exception ex)
{
logger.LogError("Failed to execute GET " + ex.Message);
return BadRequest();
}
}
[HttpPost]
public IActionResult Post([FromBody] object model)
{
if (!this.ModelState.IsValid)
{
return BadRequest("Invalid format");
}
try
{
// var result = mapper.Map<ProductInfo>(model);
// repo.Add(result);
// repo.SaveChanges();
return Created("", null);
}
catch (Exception ex)
{
logger.LogError("Failed to execute POST " + ex.Message);
return BadRequest();
}
}
[HttpPut]
public IActionResult Put([FromBody] object model)
{
if (!this.ModelState.IsValid)
{
return BadRequest("Invalid format");
}
try
{
// var result = mapper.Map<ProductInfo>(model);
// repo.Update(result);
// repo.SaveChanges();
return Ok();
}
catch (Exception ex)
{
logger.LogError("Failed to execute PUT " + ex.Message);
return BadRequest();
}
}
[HttpDelete]
public IActionResult Delete(int id)
{
try
{
return Ok();
}
catch (Exception ex)
{
logger.LogError("Failed to execute DELETE " + ex.Message);
return BadRequest();
}
}
}
}
| 26.355769 | 94 | 0.492156 | [
"MIT"
] | mmercan/sentinel | Sentinel.Api.Shipping/Controllers/Apis/ProductV1.cs | 2,741 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace SecurityHeadersGuide.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
| 25.65625 | 88 | 0.685749 | [
"MIT"
] | Jac21/CSharpMenagerie | DotNetCore/SecurityHeadersGuide/SecurityHeadersGuide/Pages/Error.cshtml.cs | 821 | C# |
using System;
using System.Collections.Generic;
using AutoMapper;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Red.Domain.Commands;
using Red.Domain.Core.Bus;
using Red.Domain.Core.Notifications;
using Red.Domain.Interfaces;
using Red.Service.ViewModels;
namespace Red.Service.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class UsuarioController : BaseApiController
{
private readonly IMapper _mapper;
private readonly IUsuarioRepository _usuarioRepository;
private readonly IMediatorHandler _bus;
public UsuarioController(
IMapper mapper,
IUsuarioRepository usuarioRepository,
IMediatorHandler bus,
INotificationHandler<DomainNotification> notifications,
IMediatorHandler mediator) : base(notifications, mediator)
{
_mapper = mapper;
_usuarioRepository = usuarioRepository;
_bus = bus;
}
[HttpGet]
[Route("listar")]
public IActionResult Get()
{
var lista = _mapper.Map<IEnumerable<UsuarioViewModel>>(_usuarioRepository.GetAll());
return Response(lista);
}
[HttpGet]
[Route("usuario/{id:guid}")]
public IActionResult Get(Guid id)
{
var usuarioViewModel = _mapper.Map<UsuarioViewModel>(_usuarioRepository.GetById(id));
return Response(usuarioViewModel);
}
[HttpPost]
[Route("usuario")]
public IActionResult Post([FromBody]UsuarioViewModel usuarioViewModel)
{
if (!ModelState.IsValid)
{
NotifyModelStateErrors();
return Response(usuarioViewModel);
}
var registerCommand = _mapper.Map<RegisterNewUsuarioCommand>(usuarioViewModel);
_bus.SendCommand(registerCommand);
return Response(usuarioViewModel);
}
[HttpPut]
[Route("usuario")]
public IActionResult Put([FromBody]UsuarioViewModel usuarioViewModel)
{
if (!ModelState.IsValid)
{
NotifyModelStateErrors();
return Response(usuarioViewModel);
}
var updateCommand = _mapper.Map<UpdateUsuarioCommand>(usuarioViewModel);
_bus.SendCommand(updateCommand);
return Response(usuarioViewModel);
}
[HttpDelete]
[Route("usuario")]
public IActionResult Delete(Guid id)
{
var removeCommand = new RemoveUsuarioCommand(id);
_bus.SendCommand(removeCommand);
return Response();
}
}
}
| 27.979381 | 97 | 0.610538 | [
"MIT"
] | aislanmiranda/.NetFull-CQRS-EF | Red.Service/Controllers/UsuarioController.cs | 2,716 | C# |
namespace Infusion
{
public struct MessageId
{
public MessageId(int value) => Value = value;
public int Value { get; }
public static explicit operator MessageId(int value) => new MessageId(value);
public static explicit operator int(MessageId id) => id.Value;
public static bool operator ==(MessageId id1, MessageId id2) => id1.Equals(id2);
public static bool operator !=(MessageId id1, MessageId id2) => !id1.Equals(id2);
public override bool Equals(object obj)
{
if (obj is MessageId)
{
var id = (MessageId) obj;
return Equals(id);
}
return false;
}
public bool Equals(MessageId other) => Value == other.Value;
public override int GetHashCode() => Value.GetHashCode();
public override string ToString() => $"0x{Value:X8}";
}
} | 28.060606 | 89 | 0.578834 | [
"MIT"
] | 3HMonkey/Infusion | Infusion/MessageId.cs | 928 | C# |
using System;
using System.Threading;
using System.Threading.Tasks;
using Api;
using Microsoft.Extensions.Logging;
using XenaExchange.Client.Messages;
using XenaExchange.Client.Messages.Constants;
using XenaExchange.Client.Ws.Interfaces;
namespace XenaExchange.Client.Examples.Ws
{
public class MarketDataWsExample
{
private readonly IMarketDataWsClient _wsClient;
private readonly ILogger _logger;
public MarketDataWsExample(IMarketDataWsClient wsClient, ILogger<MarketDataWsExample> logger)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_wsClient = wsClient ?? throw new ArgumentNullException(nameof(logger));
}
public async Task StartAsync(CancellationToken cancellationToken)
{
await TestMarketDataAsync().ConfigureAwait(false);
}
public async Task StopAsync(CancellationToken cancellationToken)
{
await _wsClient.CloseAsync().ConfigureAwait(false);
}
private async Task TestMarketDataAsync()
{
_wsClient.OnDisconnect.Subscribe(async info =>
{
// Don't reconnect here in a loop
// OnDisconnect will fire on each WsClient.ConnectAsync() failure
var reconnectInterval = TimeSpan.FromSeconds(5);
try
{
await Task.Delay(reconnectInterval).ConfigureAwait(false);
await info.WsClient.ConnectAsync().ConfigureAwait(false);
_logger.LogInformation("Reconnected");
// Reubscribe on all streams after reconnect
await SubscribeDOMAsync().ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.LogError(ex, $"Reconnect attempt failed, trying again after {reconnectInterval.ToString()}");
}
});
await _wsClient.ConnectAsync().ConfigureAwait(false);
// Subscribe on candles stream.
// Async handler, throttling specified.
// await SubscribeCandlesAsync().ConfigureAwait(false);
// Subscribe on DOM:aggregated stream.
// Sync handler, default throttling = 0 ms (every single update is sent).
await SubscribeDOMAsync().ConfigureAwait(false);
// Subscibe on trades
// await SubscribeTradesAsync().ConfigureAwait(false);
// Subscribe on market-watch
// var streamId = await SubscribeMarketWatchAsync().ConfigureAwait(false);
// Unsubscribe from market-watch stream
// await Task.Delay(5000).ConfigureAwait(false);
// await _wsClient.Unsubscribe(streamId).ConfigureAwait(false);
// _logger.LogInformation($"Unsubscribed from {streamId}");
}
private async Task SubscribeCandlesAsync()
{
var symbol = "BTC/USDT";
var timeframe = CandlesTimeframe.Timeframe1m;
await _wsClient.SubscribeCandlesAsync(symbol, timeframe, async (client, message) =>
{
switch (message)
{
case MarketDataRequestReject reject:
_logger.LogWarning($"Market data candles request for {symbol}:{timeframe} was rejected: {reject.RejectText}");
break;
case MarketDataRefresh refresh:
var updateType = refresh.IsSnapshot() ? "snapshot" : "update";
_logger.LogInformation($"Received candles {updateType}: {refresh}");
break;
default:
_logger.LogWarning($"Message of type {message.GetType().Name} not supported for candles stream");
break;
}
await Task.Delay(10).ConfigureAwait(false); // Any async action.
}, throttlingMs: ThrottlingMs.Candles.Throttling1s).ConfigureAwait(false);
}
private async Task SubscribeDOMAsync()
{
var symbol = "BTC/USDT";
await _wsClient.SubscribeDOMAggregatedAsync(symbol, (client, message) =>
{
switch (message)
{
case MarketDataRequestReject reject:
_logger.LogWarning($"Market data DOM request for {symbol} was rejected: {reject.RejectText}");
break;
case MarketDataRefresh refresh:
var updateType = refresh.IsSnapshot() ? "snapshot" : "update";
_logger.LogInformation($"Received DOM {updateType}: {refresh}");
break;
default:
_logger.LogWarning($"Message of type {message.GetType().Name} not supported for DOM stream");
break;
}
return Task.CompletedTask;
}, throttlingMs: ThrottlingMs.DOM.Throttling5s, aggregation: DOMAggregation.Aggregation5, depth: MDMarketDepth.Depth10).ConfigureAwait(false);
}
private async Task SubscribeTradesAsync()
{
var symbol = "XBTUSD";
await _wsClient.SubscribeTradeReportsAsync(symbol, (client, message) =>
{
switch (message)
{
case MarketDataRequestReject reject:
_logger.LogWarning($"Market data trades request for {symbol} was rejected: {reject.RejectText}");
break;
case MarketDataRefresh refresh:
var updateType = refresh.IsSnapshot() ? "snapshot" : "update";
_logger.LogInformation($"Received trades {updateType}: {refresh}");
break;
default:
_logger.LogWarning($"Message of type {message.GetType().Name} not supported for DOM stream");
break;
}
return Task.CompletedTask;
}).ConfigureAwait(false);
}
private async Task<string> SubscribeMarketWatchAsync()
{
return await _wsClient.SubscribeMarketWatchAsync((client, message) =>
{
switch (message)
{
case MarketDataRequestReject reject:
_logger.LogWarning($"Market data market-watch request was rejected: {reject.RejectText}");
break;
case MarketDataRefresh refresh:
// MarketDataRefresh for market-watch stream is always a snapshot
_logger.LogInformation($"Received market-watch snapshot: {refresh}");
break;
default:
_logger.LogWarning($"Message of type {message.GetType().Name} not supported for market-watch stream");
break;
}
return Task.CompletedTask;
}).ConfigureAwait(false);
}
}
} | 43.932927 | 154 | 0.558223 | [
"MIT"
] | xenaex/client-dotnet | examples/XenaExchange.Client.Examples/Ws/MarketDataWsExample.cs | 7,205 | C# |
using JT808.Gateway.MsgIdHandler;
using JT808.Gateway.SimpleQueueNotification.Hubs;
using JT808.Protocol.Extensions;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
namespace JT808.Gateway.SimpleQueueNotification.Impl
{
public class JT808MsgIdHandlerImpl : IJT808MsgIdHandler
{
private readonly ILogger<JT808MsgIdHandlerImpl> logger;
private readonly IHubContext<JT808MsgHub> _hubContext;
public JT808MsgIdHandlerImpl(
ILoggerFactory loggerFactory,
IHubContext<JT808MsgHub> hubContext
)
{
this._hubContext = hubContext;
logger = loggerFactory.CreateLogger<JT808MsgIdHandlerImpl>();
}
public void Processor((string TerminalNo, byte[] Data) parameter)
{
try
{
if (logger.IsEnabled(LogLevel.Trace))
{
logger.LogTrace($"{parameter.TerminalNo}-{parameter.Data.ToHexString()}");
}
_hubContext.Clients.All.SendAsync("ReceiveMessage", parameter.TerminalNo, parameter.Data.ToHexString());
}
catch (Exception ex)
{
logger.LogError(ex, "");
}
}
}
}
| 30.977778 | 119 | 0.631994 | [
"MIT"
] | Seamless2014/JT808Gateway | simples/JT808.Gateway.SimpleQueueNotification/Impl/JT808MsgIdHandlerImpl.cs | 1,396 | C# |
using KSerialization;
using UnityEngine;
[SerializationConfig(MemberSerialization.OptIn)]
public class Polymerizer : StateMachineComponent<Polymerizer.StatesInstance>
{
public class StatesInstance : GameStateMachine<States, StatesInstance, Polymerizer, object>.GameInstance
{
public StatesInstance(Polymerizer smi)
: base(smi)
{
}
}
public class States : GameStateMachine<States, StatesInstance, Polymerizer>
{
public State off;
public State on;
public State converting;
public override void InitializeStates(out BaseState default_state)
{
default_state = off;
root.EventTransition(GameHashes.OperationalChanged, off, (StatesInstance smi) => !smi.master.operational.IsOperational);
off.EventTransition(GameHashes.OperationalChanged, on, (StatesInstance smi) => smi.master.operational.IsOperational);
on.EventTransition(GameHashes.OnStorageChange, converting, (StatesInstance smi) => smi.master.converter.CanConvertAtAll());
converting.Enter("Ready", delegate(StatesInstance smi)
{
smi.master.operational.SetActive(value: true);
}).EventHandler(GameHashes.OnStorageChange, delegate(StatesInstance smi)
{
smi.master.TryEmit();
}).EventTransition(GameHashes.OnStorageChange, on, (StatesInstance smi) => !smi.master.converter.CanConvertAtAll())
.Exit("Ready", delegate(StatesInstance smi)
{
smi.master.operational.SetActive(value: false);
});
}
}
[SerializeField]
public float maxMass = 2.5f;
[SerializeField]
public float emitMass = 1f;
[SerializeField]
public Tag emitTag;
[SerializeField]
public Vector3 emitOffset = Vector3.zero;
[SerializeField]
public SimHashes exhaustElement = SimHashes.Vacuum;
[MyCmpAdd]
private Storage storage;
[MyCmpReq]
private Operational operational;
[MyCmpGet]
private ConduitConsumer consumer;
[MyCmpGet]
private ElementConverter converter;
private MeterController plasticMeter;
private MeterController oilMeter;
private static readonly EventSystem.IntraObjectHandler<Polymerizer> OnStorageChangedDelegate = new EventSystem.IntraObjectHandler<Polymerizer>(delegate(Polymerizer component, object data)
{
component.OnStorageChanged(data);
});
protected override void OnSpawn()
{
KBatchedAnimController component = GetComponent<KBatchedAnimController>();
plasticMeter = new MeterController((KAnimControllerBase)component, "meter_target", "meter", Meter.Offset.Infront, Grid.SceneLayer.NoLayer, new Vector3(0f, 0f, 0f), (string[])null);
oilMeter = new MeterController((KAnimControllerBase)component, "meter2_target", "meter2", Meter.Offset.Infront, Grid.SceneLayer.NoLayer, new Vector3(0f, 0f, 0f), (string[])null);
component.SetSymbolVisiblity("meter_target", is_visible: true);
float positionPercent = 0f;
PrimaryElement primaryElement = storage.FindPrimaryElement(SimHashes.Petroleum);
if (primaryElement != null)
{
positionPercent = Mathf.Clamp01(primaryElement.Mass / consumer.capacityKG);
}
oilMeter.SetPositionPercent(positionPercent);
base.smi.StartSM();
Subscribe(-1697596308, OnStorageChangedDelegate);
}
private void TryEmit()
{
GameObject gameObject = storage.FindFirst(emitTag);
if (gameObject != null)
{
PrimaryElement component = gameObject.GetComponent<PrimaryElement>();
UpdatePercentDone(component);
TryEmit(component);
}
}
private void TryEmit(PrimaryElement primary_elem)
{
if (primary_elem.Mass >= emitMass)
{
plasticMeter.SetPositionPercent(0f);
GameObject obj = storage.Drop(primary_elem.gameObject);
Rotatable component = GetComponent<Rotatable>();
Vector3 vector = component.transform.GetPosition() + component.GetRotatedOffset(emitOffset);
int i = Grid.PosToCell(vector);
if (Grid.Solid[i])
{
vector += component.GetRotatedOffset(Vector3.left);
}
obj.transform.SetPosition(vector);
PrimaryElement primaryElement = storage.FindPrimaryElement(exhaustElement);
if (primaryElement != null)
{
SimMessages.AddRemoveSubstance(Grid.PosToCell(vector), primaryElement.ElementID, null, primaryElement.Mass, primaryElement.Temperature, primaryElement.DiseaseIdx, primaryElement.DiseaseCount);
primaryElement.Mass = 0f;
primaryElement.ModifyDiseaseCount(int.MinValue, "Polymerizer.Exhaust");
}
}
}
private void UpdatePercentDone(PrimaryElement primary_elem)
{
float positionPercent = Mathf.Clamp01(primary_elem.Mass / emitMass);
plasticMeter.SetPositionPercent(positionPercent);
}
private void OnStorageChanged(object data)
{
GameObject gameObject = (GameObject)data;
if (!(gameObject == null))
{
PrimaryElement component = gameObject.GetComponent<PrimaryElement>();
if (component.ElementID == SimHashes.Petroleum)
{
float positionPercent = Mathf.Clamp01(component.Mass / consumer.capacityKG);
oilMeter.SetPositionPercent(positionPercent);
}
}
}
}
| 32.218543 | 196 | 0.765468 | [
"MIT"
] | undancer/oni-data | Managed/main/Polymerizer.cs | 4,865 | C# |
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("140-speedrun-timer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("140-speedrun-timer")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("262ab257-86e9-49fb-9e38-5b8b9d9a5a21")]
// 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.*")]
| 37.771429 | 84 | 0.749622 | [
"Unlicense"
] | Dalet/140-speedrun-timer | 140-speedrun-timer/Properties/AssemblyInfo.cs | 1,325 | C# |
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
namespace Test
{
enum OpT {INC, MOVE, PRINT, LOOP};
struct Op {
public OpT op;
public int v;
public Op[] loop;
public Op(OpT _op, int _v) { op = _op; v = _v; loop = null; }
public Op(OpT _op, Op[] _l) { op = _op; loop = _l; v = 0; }
}
public class Tape
{
int pos;
int[] tape;
public Tape()
{
pos = 0;
tape = new int[1];
}
public int Get() { return tape[pos]; }
public void Inc(int x) { tape[pos] += x; }
public void Move(int x) { pos += x; while (pos >= tape.Length) Array.Resize(ref tape, tape.Length*2); }
}
class Program
{
string code;
int pos;
Op[] ops;
Program(string text)
{
code = text;
pos = 0;
ops = parse();
}
private Op[] parse() {
List<Op> res = new List<Op>();
while (pos < code.Length) {
char c = code[pos];
pos++;
switch (c) {
case '+': res.Add(new Op(OpT.INC, 1)); break;
case '-': res.Add(new Op(OpT.INC, -1)); break;
case '>': res.Add(new Op(OpT.MOVE, 1)); break;
case '<': res.Add(new Op(OpT.MOVE, -1)); break;
case '.': res.Add(new Op(OpT.PRINT, 0)); break;
case '[': res.Add(new Op(OpT.LOOP, parse())); break;
case ']': return res.ToArray();
}
}
return res.ToArray();
}
public void run() {
_run(ops, new Tape());
}
private void _run(Op[] program, Tape tape) {
foreach (Op op in program) {
switch (op.op) {
case OpT.INC: tape.Inc(op.v); break;
case OpT.MOVE: tape.Move(op.v); break;
case OpT.LOOP: while (tape.Get() > 0) _run(op.loop, tape); break;
case OpT.PRINT: Console.Write((char)tape.Get()); break;
}
}
}
private static void Notify(string msg) {
try {
using (var s = new System.Net.Sockets.TcpClient("localhost", 9001)) {
var data = System.Text.Encoding.UTF8.GetBytes(msg);
s.Client.Send(data);
}
} catch {
// standalone usage
}
}
static void Main(string[] args)
{
string text = File.ReadAllText(args[0]);
var runtime = Type.GetType("Mono.Runtime") != null ? "Mono" : ".NET Core";
Notify($"C# {runtime}\t{Process.GetCurrentProcess().Id}");
var stopWatch = new Stopwatch();
var p = new Program(text);
p.run();
stopWatch.Stop();
Console.Error.WriteLine("time: " + stopWatch.ElapsedMilliseconds / 1e3 + "s");
Notify("stop");
}
}
}
| 28.531532 | 111 | 0.44869 | [
"MIT"
] | truthiswill/benchmarks | brainfuck/bf.cs | 3,167 | C# |
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace NetFabric.Hyperlinq
{
[StructLayout(LayoutKind.Auto)]
public ref struct WhereAtReadOnlyRefEnumerator<TSource, TPredicate>
where TPredicate : struct, IFunctionIn<TSource, int, bool>
{
readonly ReadOnlySpan<TSource> source;
TPredicate predicate;
int index;
internal WhereAtReadOnlyRefEnumerator(ReadOnlySpan<TSource> source, TPredicate predicate)
{
this.source = source;
this.predicate = predicate;
index = -1;
}
public readonly ref readonly TSource Current
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref source[index];
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool MoveNext()
{
var span = source;
while (++index < span.Length)
{
if (predicate.Invoke(in span[index], index))
return true;
}
return false;
}
}
} | 28.35 | 97 | 0.592593 | [
"MIT"
] | ualehosaini/NetFabric.Hyperlinq | NetFabric.Hyperlinq/Filtering/WhereAtRef/WhereAtReadOnlyRefEnumerator.cs | 1,136 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System.Collections.Generic;
using Aliyun.Acs.Core;
namespace Aliyun.Acs.Vpc.Model.V20160428
{
public class CreateIPv6TranslatorAclListResponse : AcsResponse
{
private string requestId;
private string aclId;
public string RequestId
{
get
{
return requestId;
}
set
{
requestId = value;
}
}
public string AclId
{
get
{
return aclId;
}
set
{
aclId = value;
}
}
}
}
| 22.561404 | 64 | 0.688958 | [
"Apache-2.0"
] | AxiosCros/aliyun-openapi-net-sdk | aliyun-net-sdk-vpc/Vpc/Model/V20160428/CreateIPv6TranslatorAclListResponse.cs | 1,286 | C# |
// Copyright © 2017-2020 Chromely Projects. All rights reserved.
// Use of this source code is governed by MIT license that can be found in the LICENSE file.
namespace Chromely.Core.Host
{
public enum WindowState
{
Normal,
Minimize,
Maximize,
Fullscreen
}
}
| 21.714286 | 92 | 0.654605 | [
"MIT",
"BSD-3-Clause"
] | GerHobbelt/Chromely | src/Chromely.Core/Host/WindowState.cs | 307 | C# |
using System;
using Swift.Interop;
namespace SwiftUI
{
[SwiftImport (SwiftUILib.Path)]
public class EmptyView : View
{
protected override unsafe void InitNativeData (void* handle)
{
}
}
}
| 14.214286 | 62 | 0.723618 | [
"MIT"
] | CartBlanche/Xamarin.SwiftUI | src/SwiftUI/SwiftUI/Views/EmptyView.cs | 199 | C# |
using System;
using System.Collections.Generic;
using Content.Shared.ActionBlocker;
using Content.Shared.Hands.Components;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Content.Shared.Interaction;
namespace Content.Shared.Verbs
{
[Serializable, NetSerializable]
public class RequestServerVerbsEvent : EntityEventArgs
{
public readonly EntityUid EntityUid;
public readonly VerbType Type;
/// <summary>
/// If the target item is inside of some storage (e.g., backpack), this is the entity that owns that item
/// slot. Needed for validating that the user can access the target item.
/// </summary>
public readonly EntityUid? SlotOwner;
public RequestServerVerbsEvent(EntityUid entityUid, VerbType type, EntityUid? slotOwner = null)
{
EntityUid = entityUid;
Type = type;
SlotOwner = slotOwner;
}
}
[Serializable, NetSerializable]
public class VerbsResponseEvent : EntityEventArgs
{
public readonly Dictionary<VerbType, List<Verb>>? Verbs;
public readonly EntityUid Entity;
public VerbsResponseEvent(EntityUid entity, Dictionary<VerbType, SortedSet<Verb>>? verbs)
{
Entity = entity;
if (verbs == null)
return;
// Apparently SortedSet is not serlializable. Cast to List<Verb>.
Verbs = new();
foreach (var entry in verbs)
{
Verbs.Add(entry.Key, new List<Verb>(entry.Value));
}
}
}
[Serializable, NetSerializable]
public class ExecuteVerbEvent : EntityEventArgs
{
public readonly EntityUid Target;
public readonly Verb RequestedVerb;
/// <summary>
/// The type of verb to try execute. Avoids having to get a list of all verbs on the receiving end.
/// </summary>
public readonly VerbType Type;
public ExecuteVerbEvent(EntityUid target, Verb requestedVerb, VerbType type)
{
Target = target;
RequestedVerb = requestedVerb;
Type = type;
}
}
/// <summary>
/// Request primary interaction verbs. This includes both use-in-hand and interacting with external entities.
/// </summary>
/// <remarks>
/// These verbs those that involve using the hands or the currently held item on some entity. These verbs usually
/// correspond to interactions that can be triggered by left-clicking or using 'Z', and often depend on the
/// currently held item. These verbs are collectively shown first in the context menu.
/// </remarks>
public class GetInteractionVerbsEvent : GetVerbsEvent
{
public GetInteractionVerbsEvent(IEntity user, IEntity target, IEntity? @using, SharedHandsComponent? hands,
bool canInteract, bool canAccess) : base(user, target, @using, hands, canInteract, canAccess) { }
}
/// <summary>
/// Request activation verbs.
/// </summary>
/// <remarks>
/// These are verbs that activate an item in the world but are independent of the currently held items. For
/// example, opening a door or a GUI. These verbs should correspond to interactions that can be triggered by
/// using 'E', though many of those can also be triggered by left-mouse or 'Z' if there is no other interaction.
/// These verbs are collectively shown second in the context menu.
/// </remarks>
public class GetActivationVerbsEvent : GetVerbsEvent
{
public GetActivationVerbsEvent(IEntity user, IEntity target, IEntity? @using, SharedHandsComponent? hands,
bool canInteract, bool canAccess) : base(user, target, @using, hands, canInteract, canAccess) { }
}
/// <summary>
/// Request alternative-interaction verbs.
/// </summary>
/// <remarks>
/// When interacting with an entity via alt + left-click/E/Z the highest priority alt-interact verb is executed.
/// These verbs are collectively shown second-to-last in the context menu.
/// </remarks>
public class GetAlternativeVerbsEvent : GetVerbsEvent
{
public GetAlternativeVerbsEvent(IEntity user, IEntity target, IEntity? @using, SharedHandsComponent? hands,
bool canInteract, bool canAccess) : base(user, target, @using, hands, canInteract, canAccess) { }
}
/// <summary>
/// Request Miscellaneous verbs.
/// </summary>
/// <remarks>
/// Includes (nearly) global interactions like "examine", "pull", or "debug". These verbs are collectively shown
/// last in the context menu.
/// </remarks>
public class GetOtherVerbsEvent : GetVerbsEvent
{
public GetOtherVerbsEvent(IEntity user, IEntity target, IEntity? @using, SharedHandsComponent? hands,
bool canInteract, bool canAccess) : base(user, target, @using, hands, canInteract, canAccess) { }
}
/// <summary>
/// Directed event that requests verbs from any systems/components on a target entity.
/// </summary>
public class GetVerbsEvent : EntityEventArgs
{
/// <summary>
/// Event output. Set of verbs that can be executed.
/// </summary>
public readonly SortedSet<Verb> Verbs = new();
/// <summary>
/// Can the user physically access the target?
/// </summary>
/// <remarks>
/// This is a combination of <see cref="ContainerHelpers.IsInSameOrParentContainer"/> and
/// <see cref="SharedInteractionSystem.InRangeUnobstructed"/>.
/// </remarks>
public readonly bool CanAccess = false;
/// <summary>
/// The entity being targeted for the verb.
/// </summary>
public readonly IEntity Target;
/// <summary>
/// The entity that will be "performing" the verb.
/// </summary>
public readonly IEntity User;
/// <summary>
/// Can the user physically interact?
/// </summary>
/// <remarks>
/// This is a just a cached <see cref="ActionBlockerSystem.CanInteract"/> result. Given that many verbs need
/// to check this, it prevents it from having to be repeatedly called by each individual system that might
/// contribute a verb.
/// </remarks>
public readonly bool CanInteract;
/// <summary>
/// The User's hand component.
/// </summary>
/// <remarks>
/// This may be null if the user has no hands.
/// </remarks>
public readonly SharedHandsComponent? Hands;
/// <summary>
/// The entity currently being held by the active hand.
/// </summary>
/// <remarks>
/// This is only ever not null when <see cref="ActionBlockerSystem.CanUse(EntityUid)"/> is true and the user
/// has hands.
/// </remarks>
public readonly IEntity? Using;
// for eventual removal of IEntity.
public EntityUid UserUid => User.Uid;
public EntityUid TargetUid => Target.Uid;
public EntityUid? UsingUid => Using?.Uid;
public GetVerbsEvent(IEntity user, IEntity target, IEntity? @using, SharedHandsComponent? hands, bool canInteract, bool canAccess)
{
User = user;
Target = target;
Using = @using;
Hands = hands;
CanAccess = canAccess;
CanInteract = canInteract;
}
}
}
| 38.054455 | 138 | 0.619618 | [
"MIT"
] | Filatelele/space-station-14 | Content.Shared/Verbs/VerbEvents.cs | 7,687 | C# |
using System;
using System.Collections.Generic;
using UnityEngine;
using VRTK;
public class EntityMainPlayer : EntityDynamicActor
{
[SerializeField]
private float moveSpeed = 0.1f;
private WeaponType wType = WeaponType.none;
public WeaponType WType
{
get
{
return this.wType;
}
set
{
if (this.wType != value)
{
if (rightWeapon != null)
rightWeapon.onDispose();
if (leftWeapon != null)
leftWeapon.onDispose();
this.wType = value;
onChangeWeapon();
}
}
}
private BaseWeapon rightWeapon = null;
private BaseWeapon leftWeapon = null;
private Transform leftHand;
public Transform LeftHand
{
get
{
if (leftHand == null)
{
leftHand = this.CacheTrans.Find("Controller (left)");
}
return leftHand;
}
}
private Transform rightHand;
public Transform RightHand
{
get
{
if (rightHand == null)
{
rightHand = this.CacheTrans.Find("Controller (right)");
}
return rightHand;
}
}
private Transform eye;
public Transform Eye
{
get
{
if (eye == null)
{
eye = this.CacheTrans.Find("Camera (eye)");
}
return eye;
}
}
private VRTK_ControllerEvents rightEvents;
public VRTK_ControllerEvents RightEvents
{
get
{
if (rightEvents == null)
{
rightEvents = GameObject.Find("right").GetComponent<VRTK_ControllerEvents>();
}
return rightEvents;
}
}
public override void onAwake()
{
//this.EType = EntityType.player;
//this.UID = 19941001;
//this.HP = 100;
//this.OrgHP = 100;
//EntityMgr.Instance.addEntity(this);
}
public override void onStart()
{
base.onStart();
this.CacheObj.layer = 11;
RightEvents.TriggerPressed += onFire;
RightEvents.TouchpadOnPress += onPlayerMove;
RightEvents.ButtonTwoPressed += onOpenWeaponSysUI;
this.WType = WeaponType.gun;
}
private void onOpenWeaponSysUI(object sender, ControllerInteractionEventArgs args)
{
Message msg = new Message(MsgCmd.Open_WeaponSystem_UI, this);
msg["Pos"] = getCanvasPos();
msg["Rot"] = getCanvasRot();
msg.Send();
}
public Vector3 getCanvasPos()
{
Vector3 pos = this.Eye.position + this.Eye.forward * 12;
return new Vector3(pos.x, 4f, pos.z);
}
public Quaternion getCanvasRot()
{
Quaternion rot = this.Eye.rotation;
rot.x = 0;
rot.z = 0;
return rot;
}
private void OnEnable()
{
MessageCenter.Instance.addListener(MsgCmd.On_Change_Weapon, onChangeWeaponMsg);
MessageCenter.Instance.addListener(MsgCmd.On_Change_Value, onChangeValue);
}
private void OnDisable()
{
MessageCenter.Instance.removeListener(MsgCmd.On_Change_Weapon, onChangeWeaponMsg);
MessageCenter.Instance.removeListener(MsgCmd.On_Change_Value, onChangeValue);
}
private void onChangeWeaponMsg(Message msg)
{
WeaponType type = (WeaponType)msg["type"];
this.WType = type;
}
public sealed override void onUpdate()
{
base.onUpdate();
if (Input.GetKeyDown(KeyCode.B))
{
this.WType = WeaponType.bow;
}
if (Input.GetKeyDown(KeyCode.N))
{
this.WType = WeaponType.gun;
}
}
//切换武器
private void onChangeWeapon()
{
WeaponFactory.Instance.createWeapon(this.WType, this);
}
//普通武器射击
private void onFire(object sender, ControllerInteractionEventArgs args)
{
if (rightWeapon.isCanUse())
{
if (rightWeapon != null)
rightWeapon.onFire();
if (leftWeapon != null)
{
RightEvents.TriggerReleased += bowOnFire;
RightEvents.TriggerOnPress += onPress;
leftWeapon.onFire();
}
}
}
//弓箭射击
private void bowOnFire(object sender, ControllerInteractionEventArgs args)
{
if (rightWeapon != null)
rightWeapon.bowOnFire();
if (leftWeapon != null)
{
RightEvents.TriggerReleased -= bowOnFire;
RightEvents.TriggerOnPress -= onPress;
leftWeapon.bowOnFire();
}
}
//弓箭拉弓
private void onPress(object sender, ControllerInteractionEventArgs args)
{
if (this.leftWeapon != null)
{
Vector3 rightVec = RightHand.InverseTransformPoint(LeftHand.position);
leftWeapon.bowOnPull(rightVec.z);
}
}
//弓箭放弃射击
public void bowGiveUP()
{
if (leftWeapon != null)
{
WeaponBow bow = leftWeapon as WeaponBow;
if (bow != null)
{
bow.onGiveUP();
}
}
if (rightWeapon != null)
{
WeaponArrow arrow = rightWeapon as WeaponArrow;
if (arrow != null)
{
arrow.onGiveUP();
}
}
}
public void setRightWeapon(BaseWeapon bw)
{
rightWeapon = bw;
}
public void setLeftWeapon(BaseWeapon bw)
{
leftWeapon = bw;
}
//触摸TouchPad 主角移动
Quaternion rot = Quaternion.identity;
Vector3 dir = Vector3.zero;
private void onPlayerMove(object sender, ControllerInteractionEventArgs args)
{
dir = Eye.forward * args.touchpadAxis.y;
rot = this.CacheTrans.rotation;
rot = Quaternion.Euler(0, args.touchpadAxis.x, 0) * rot;
this.CacheTrans.rotation = Quaternion.Lerp(this.CacheTrans.rotation, rot, 0.25f);// rot;
CC.Move(dir * moveSpeed);
}
public override void onDispose()
{
base.onDispose();
RightEvents.TriggerPressed -= onFire;
}
public override void onCreate(EntityInfo data)
{
base.onCreate(data);
sendHPMsg();
}
public override void onDamage(float damage)
{
this.HP -= damage;
sendHPMsg();
UIMgr.Instance.onDamageColor();
}
private void sendHPMsg()
{
Message msg = new Message(MsgCmd.On_HP_Change_Value, this);
msg["HP"] = this.HP;
msg["OrgHP"] = this.OrgHP;
msg.Send();
if (this.HP <= 0)
{
Message msgdie = new Message(MsgCmd.Die_Main_Player, this);
msgdie.Send();
}
}
}
| 25.161172 | 96 | 0.546222 | [
"Apache-2.0"
] | Tritend/ZombieWar | Assets/Scripts/Entity/Entitys/EntityMainPlayer.cs | 6,931 | C# |
using System;
using System.Configuration;
using System.IO;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Web.Script.Serialization;
namespace Fpm.MainUI.Helpers
{
public static class ExceptionLogger
{
public static void LogException(Exception exception, string url)
{
var jsonException = GetExpectionString(exception, url);
try
{
var path = ApplicationConfiguration.CoreWsUrlForLogging + "log/exception";
var logger = WebRequest.Create(path) as HttpWebRequest;
logger.ContentType = "application/json";
logger.Method = "POST";
var bytes = ConvertJsonToByteArray(jsonException);
logger.ContentLength = bytes.Length;
using (var postStream = logger.GetRequestStream())
{
postStream.Write(bytes, 0, bytes.Length);
postStream.Close();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private static string GetExpectionString(Exception exception, string url)
{
string jsonException = new JavaScriptSerializer().Serialize(new
{
application = ConfigurationManager.AppSettings["ApplicationName"],
username = UserDetails.CurrentUser().Name,
message = exception.Message,
stackTrace = exception.StackTrace,
type = exception.GetType().FullName,
url = ((object) url ?? DBNull.Value),
environment = "",
server = Environment.MachineName
});
return jsonException;
}
static byte[] ConvertJsonToByteArray(string json)
{
var serializer = new DataContractJsonSerializer(typeof(string));
var ms = new MemoryStream();
serializer.WriteObject(ms, json);
ms.Position = 0;
new StreamReader(ms);
return ms.ToArray();
}
}
} | 34.174603 | 90 | 0.558755 | [
"MIT"
] | PublicHealthEngland/fingertips-open | FingertipsProfileManager/MainUI/Helpers/ExceptionLogger.cs | 2,155 | C# |
#pragma checksum "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\Error.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1f02565c188bc0cf60de1bc120acef71a3608055"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(GymWebsite.Pages.Pages_Error), @"mvc.1.0.razor-page", @"/Pages/Error.cshtml")]
namespace GymWebsite.Pages
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\_ViewImports.cshtml"
using GymWebsite;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"1f02565c188bc0cf60de1bc120acef71a3608055", @"/Pages/Error.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"0e63e046d8d396bf97f2770cffc033393c996836", @"/Pages/_ViewImports.cshtml")]
public class Pages_Error : global::Microsoft.AspNetCore.Mvc.RazorPages.Page
{
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
#nullable restore
#line 3 "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\Error.cshtml"
ViewData["Title"] = "Error";
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n<h1 class=\"text-danger\">Error.</h1>\r\n<h2 class=\"text-danger\">An error occurred while processing your request.</h2>\r\n\r\n");
#nullable restore
#line 10 "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\Error.cshtml"
if (Model.ShowRequestId)
{
#line default
#line hidden
#nullable disable
WriteLiteral(" <p>\r\n <strong>Request ID:</strong> <code>");
#nullable restore
#line 13 "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\Error.cshtml"
Write(Model.RequestId);
#line default
#line hidden
#nullable disable
WriteLiteral("</code>\r\n </p>\r\n");
#nullable restore
#line 15 "C:\Users\Willi\OneDrive\Desktop\Code Repository\GymWebsiteApp\GymWebsite\GymWebsite\Pages\Error.cshtml"
}
#line default
#line hidden
#nullable disable
WriteLiteral(@"
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
");
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<ErrorModel> Html { get; private set; }
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<ErrorModel> ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<ErrorModel>)PageContext?.ViewData;
public ErrorModel Model => ViewData.Model;
}
}
#pragma warning restore 1591
| 48.758242 | 205 | 0.751859 | [
"Unlicense"
] | shoreshanked/GymWebsiteApp | GymWebsite/GymWebsite/obj/Debug/net5.0/Razor/Pages/Error.cshtml.g.cs | 4,437 | C# |
//------------------------------------------------------------
// Game Framework v3.x
// Copyright © 2013-2018 Jiang Yin. All rights reserved.
// Homepage: http://gameframework.cn/
// Feedback: mailto:jiangyin@gameframework.cn
//------------------------------------------------------------
using GameFramework;
using UnityEngine;
namespace UnityGameFramework.Runtime
{
/// <summary>
/// 日志辅助器。
/// </summary>
public class DefaultLogHelper : Log.ILogHelper
{
/// <summary>
/// 记录日志。
/// </summary>
/// <param name="level">日志等级。</param>
/// <param name="message">日志内容。</param>
public void Log(LogLevel level, object message)
{
switch (level)
{
case LogLevel.Debug:
Debug.Log(string.Format("<color=#888888>{0}</color>", message.ToString()));
break;
case LogLevel.Info:
Debug.Log(message.ToString());
break;
case LogLevel.Warning:
Debug.LogWarning(message.ToString());
break;
case LogLevel.Error:
Debug.LogError(message.ToString());
break;
default:
throw new GameFrameworkException(message.ToString());
}
}
}
}
| 30.977778 | 95 | 0.458393 | [
"MIT"
] | Data-XiaoYu/UnityWorld | FlappyBird/Assets/GameFramework/Scripts/Runtime/Utility/DefaultLogHelper.cs | 1,439 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.EC2.Model
{
/// <summary>
/// This is the response object from the EnableVgwRoutePropagation operation.
/// </summary>
public partial class EnableVgwRoutePropagationResponse : AmazonWebServiceResponse
{
}
} | 30.189189 | 101 | 0.7359 | [
"Apache-2.0"
] | Bio2hazard/aws-sdk-net | sdk/src/Services/EC2/Generated/Model/EnableVgwRoutePropagationResponse.cs | 1,117 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Entities;
using Geocode.DataAccess;
namespace Geocode.Service
{
public class GetGeocodesFromXML : IGeocodeService
{
StructureMap.Container container =
new StructureMap.Container(c =>
{
c.AddRegistry<GeocodeDataAccessRegistry>();
});
public List<GeoCode> GetGeocodes(string location)
{
var gnda = container.GetInstance<IDataAccess>();
//GeoNamesDataAccess gnda = new GeoNamesDataAccess();
string xmlRaw = gnda.GetGeoCodeList(location);
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlRaw);
XmlNodeList xmlNodes = doc.DocumentElement.SelectNodes("/geonames/geoname");
List<GeoCode> GeocodeList = new List<GeoCode>();
List<Task> taskList = new List<Task>();
foreach (XmlNode node in xmlNodes)
{
var task = Task.Factory.StartNew(() =>
{
GeoCode gcTemp = new GeoCode();
gcTemp.Lat = node.SelectSingleNode("lat").InnerText;
gcTemp.Lon = node.SelectSingleNode("lng").InnerText;
gcTemp.ToponymName = node.SelectSingleNode("toponymName").InnerText;
GeocodeList.Add(gcTemp);
});
taskList.Add(task);
}
Task.WaitAll(taskList.ToArray());
return GeocodeList; ;
}
}
}
| 25.515625 | 88 | 0.568279 | [
"MIT"
] | javipedrajo/uneat-net | 01_sistemas_distribuidos/GeocodeSolutionModificada2018/Geocode.Service/GetGeocodesFromXML.cs | 1,635 | C# |
using Newtonsoft.Json;
using Oxide.Ext.Discord.Entities.Emojis;
using Oxide.Ext.Discord.Interfaces;
namespace Oxide.Ext.Discord.Entities.Messages
{
/// <summary>
/// Represents a <a href="https://discord.com/developers/docs/resources/channel#reaction-object">Reaction Structure</a>
/// </summary>
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class MessageReaction
{
/// <summary>
/// Times this emoji has been used to react
/// </summary>
[JsonProperty("count")]
public int Count { get; set; }
/// <summary>
/// Whether the current user reacted using this emoji
/// </summary>
[JsonProperty("me")]
public bool Me { get; set; }
/// <summary>
/// Emoji information
/// <see cref="Emoji"/>
/// </summary>
[JsonProperty("emoji")]
public DiscordEmoji Emoji { get; set; }
}
}
| 28.909091 | 123 | 0.595388 | [
"MIT"
] | Kirollos/Oxide.Ext.Discord | Oxide.Ext.Discord/Entities/Messages/MessageReaction.cs | 956 | C# |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Author: Nuno Fachada
* */
using UnityEngine;
// Agents with this component move between random waypoints
public class RandomWaypointsBehaviour : MonoBehaviour
{
// Maximum speed
[SerializeField] private float maxSpeed = 8f;
// Plane walls
private PlaneWalls planeWalls;
// Current waypoint
private Vector3 waypoint;
// Get reference to plane walls
private void Awake()
{
planeWalls = GameObject.Find("Plane").GetComponent<PlaneWalls>();
}
// Start is called before the first frame update
private void Start()
{
waypoint = transform.position;
}
// Move between random waypoints
private void Update()
{
// Determine a new random waypoint?
if ((waypoint - transform.position).magnitude < 0.1f * maxSpeed)
{
// Determine plane limits
Vector4 planeLimits = planeWalls.Limits;
// Determine a new random waypoint
waypoint = new Vector3(
Random.Range(planeLimits.y, planeLimits.x),
transform.position.y,
Random.Range(planeLimits.w, planeLimits.z));
}
// Get velocity from the vector form of the orientation
Vector3 linear = (waypoint - transform.position).normalized
* maxSpeed * Time.deltaTime;
// Apply steering
transform.Translate(linear, Space.World);
}
// Draw waypoint
private void OnDrawGizmos()
{
Gizmos.color = Color.blue;
Gizmos.DrawWireSphere(waypoint, 0.2f);
}
}
| 27.796875 | 73 | 0.627881 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | fakenmc/AIUnityExamples | SimpleFSMs/Assets/Scripts/RandomWaypointsBehaviour.cs | 1,781 | C# |
#region Copyright (c) 2006-2014 nHydrate.org, All Rights Reserved
// -------------------------------------------------------------------------- *
// NHYDRATE.ORG *
// Copyright (c) 2006-2014 All Rights reserved *
// *
// *
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), *
// to deal in the Software without restriction, including without limitation *
// the rights to use, copy, modify, merge, publish, distribute, sublicense, *
// and/or sell copies of the Software, and to permit persons to whom the *
// Software is furnished to do so, subject to the following conditions: *
// *
// The above copyright notice and this permission notice shall be included *
// in all copies or substantial portions of the Software. *
// *
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY *
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, *
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE *
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
// -------------------------------------------------------------------------- *
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nHydrate.Dsl;
namespace nHydrate.DslPackage
{
public static class Extensions
{
public static Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement GetEntity(this Microsoft.VisualStudio.Modeling.Diagrams.Diagram diagram, string entityName)
{
foreach (var item in diagram.NestedChildShapes)
{
if (item.ModelElement is Entity)
{
var e = item.ModelElement as Entity;
if (e.Name == entityName)
return item;
}
}
return null;
}
public static bool IsDerivedFrom(this nHydrate.Dsl.Entity entity, Entity parent)
{
var p = entity.ParentInheritedEntity;
while (p != null)
{
if (p == parent) return true;
p = p.ParentInheritedEntity;
}
return false;
}
public static string GetCorePropertiesHash(this IEnumerable<nHydrate.DataImport.Field> list)
{
var sortedList = new SortedDictionary<string, nHydrate.DataImport.Field>();
foreach (var c in list.OrderBy(x => x.Name))
{
sortedList.Add(c.Name + "-" + c.ID, c);
}
var hash = string.Empty;
foreach (var key in sortedList.Keys)
{
var c = sortedList[key];
hash += c.CorePropertiesHash;
}
return hash;
}
public static string GetCorePropertiesHash(this EntityHasEntities relation)
{
try
{
var prehash =
relation.SourceEntity.Name.ToLower() + "|" +
relation.TargetEntity.Name.ToLower() + " | ";
//var columnList = relation.FieldMapList().OrderBy(x => x.GetTargetField(relation).Name.ToLower()).ToList();
var columnList = relation.FieldMapList().Where(x => x.GetTargetField(relation) != null && x.GetSourceField(relation) != null).ToList();
columnList = columnList.OrderBy(x => x.GetTargetField(relation).Name.ToLower()).ToList();
prehash += string.Join("-|-", columnList.Select(x => x.GetTargetField(relation).Name.ToLower())) + "~";
prehash += string.Join("-|-", columnList.Select(x => x.GetSourceField(relation).Name.ToLower())) + "~";
return prehash;
}
catch (Exception ex)
{
throw;
}
}
public static bool Contains(this IEnumerable<nHydrate.DataImport.StoredProc> list, string name)
{
return list.Count(x => x.Name.ToLower() == name.ToLower()) > 0;
}
public static bool Contains(this IEnumerable<nHydrate.DataImport.Function> list, string name)
{
return list.Count(x => x.Name.ToLower() == name.ToLower()) > 0;
}
public static nHydrate.DataImport.StoredProc GetItem(this IEnumerable<nHydrate.DataImport.StoredProc> list, string name)
{
return list.FirstOrDefault(x => x.Name.ToLower() == name.ToLower());
}
public static nHydrate.DataImport.Function GetItem(this IEnumerable<nHydrate.DataImport.Function> list, string name)
{
return list.FirstOrDefault(x => x.Name.ToLower() == name.ToLower());
}
public static List<T> ToList<T>(this System.Collections.IList l)
{
var retval = new List<T>();
foreach (T o in l)
{
retval.Add(o);
}
return retval;
}
/// <summary>
/// Get all nodes recursively
/// </summary>
public static List<System.Windows.Forms.TreeNode> GetAllNodes(this System.Windows.Forms.TreeNodeCollection l)
{
var retval = new List<System.Windows.Forms.TreeNode>();
foreach (System.Windows.Forms.TreeNode o in l)
{
retval.Add(o);
retval.AddRange(GetAllNodes(o.Nodes));
}
return retval;
}
public static void CleanUp(this nHydrate.DataImport.Database database)
{
foreach (var item in database.EntityList)
{
foreach (var field in item.FieldList)
{
//Length
var dt = (DataTypeConstants)Enum.Parse(typeof(DataTypeConstants), field.DataType.ToString());
var l = dt.GetPredefinedSize();
if (l != -1) field.Length = l;
//Scale
l = dt.GetPredefinedScale();
if (l != -1) field.Scale = l;
}
}
}
public static void SetupIdMap(this nHydrate.DataImport.Database database, nHydrate.DataImport.Database master)
{
//Entities
foreach (var item in database.EntityList)
{
var o = master.EntityList.FirstOrDefault(x => x.Name == item.Name);
if (o != null)
{
item.ID = o.ID;
foreach (var f in item.FieldList)
{
var f2 = o.FieldList.FirstOrDefault(x => x.Name == f.Name);
if (f2 != null) f.ID = f2.ID;
}
}
}
//Stored Procs
foreach (var item in database.StoredProcList)
{
var o = master.StoredProcList.FirstOrDefault(x => x.Name == item.Name);
if (o != null) item.ID = o.ID;
}
//Views
foreach (var item in database.ViewList)
{
var o = master.ViewList.FirstOrDefault(x => x.Name == item.Name);
if (o != null) item.ID = o.ID;
}
//Functions
foreach (var item in database.FunctionList)
{
var o = master.FunctionList.FirstOrDefault(x => x.Name == item.Name);
if (o != null) item.ID = o.ID;
}
}
#region GetChangedText
public static string GetChangedText(this nHydrate.DataImport.Field item, nHydrate.DataImport.Field target)
{
var retval = string.Empty;
if (item.Collate != target.Collate)
retval += "Collate: " + item.Collate + "->" + target.Collate + "\r\n";
if (item.DataType != target.DataType)
retval += "DataType: " + item.DataType + "->" + target.DataType + "\r\n";
if (item.DefaultValue != target.DefaultValue)
retval += "DefaultValue: " + item.DefaultValue + "->" + target.DefaultValue + "\r\n";
if (item.Identity != target.Identity)
retval += "Identity: " + item.Identity + "->" + target.Identity + "\r\n";
if (item.IsBrowsable != target.IsBrowsable)
retval += "IsBrowsable: " + item.IsBrowsable + "->" + target.IsBrowsable + "\r\n";
if (item.IsIndexed != target.IsIndexed)
retval += "IsIndexed: " + item.IsIndexed + "->" + target.IsIndexed + "\r\n";
if (item.IsReadOnly != target.IsReadOnly)
retval += "IsReadOnly: " + item.IsReadOnly + "->" + target.IsReadOnly + "\r\n";
if (item.Length != target.Length)
retval += "Length: " + item.Length + "->" + target.Length + "\r\n";
if (item.Nullable != target.Nullable)
retval += "Nullable: " + item.Nullable + "->" + target.Nullable + "\r\n";
if (item.PrimaryKey != target.PrimaryKey)
retval += "PrimaryKey: " + item.PrimaryKey + "->" + target.PrimaryKey + "\r\n";
if (item.Scale != target.Scale)
retval += "Scale: " + item.Scale + "->" + target.Scale + "\r\n";
if (item.Name != target.Name)
retval += "Name: " + item.Name + "->" + target.Name + "\r\n";
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.Parameter item, nHydrate.DataImport.Parameter target)
{
var retval = string.Empty;
if (item.Collate != target.Collate)
retval += "Collate: " + item.Collate + "->" + target.Collate + "\r\n";
if (item.DataType != target.DataType)
retval += "DataType: " + item.DataType + "->" + target.DataType + "\r\n";
if (item.DefaultValue != target.DefaultValue)
retval += "DefaultValue: " + item.DefaultValue + "->" + target.DefaultValue + "\r\n";
if (item.IsOutputParameter != target.IsOutputParameter)
retval += "IsOutputParameter: " + item.IsOutputParameter + "->" + target.IsOutputParameter + "\r\n";
if (item.Length != target.Length)
retval += "Length: " + item.Length + "->" + target.Length + "\r\n";
if (item.Nullable != target.Nullable)
retval += "Nullable: " + item.Nullable + "->" + target.Nullable + "\r\n";
if (item.PrimaryKey != target.PrimaryKey)
retval += "PrimaryKey: " + item.PrimaryKey + "->" + target.PrimaryKey + "\r\n";
if (item.Scale != target.Scale)
retval += "Scale: " + item.Scale + "->" + target.Scale + "\r\n";
if (item.Name != target.Name)
retval += "Name: " + item.Name + "->" + target.Name + "\r\n";
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.Entity item, nHydrate.DataImport.Entity target)
{
var retval = string.Empty;
#region Fields
var addedFields = target.FieldList.Where(x => !item.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedFields = item.FieldList.Where(x => !target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonFields = item.FieldList.Where(x => target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedFields.Count > 0)
{
retval += "\r\nAdded fields: " + string.Join(", ", addedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedFields.Count > 0)
{
retval += "\r\nDeleted fields: " + string.Join(", ", deletedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var field in commonFields)
{
var t = field.GetChangedText(target.FieldList.FirstOrDefault(x => x.Name == field.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed field (" + field.Name + ")\r\n" + t + "\r\n";
}
#endregion
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.StoredProc item, nHydrate.DataImport.StoredProc target)
{
var retval = string.Empty;
if (item.Collate != target.Collate)
retval += "Collate: " + item.Collate + "->" + target.Collate + "\r\n";
if (item.Name != target.Name)
retval += "Name: " + item.Name + "->" + target.Name + "\r\n";
if (item.Schema != target.Schema)
retval += "Schema: " + item.Schema + "->" + target.Schema + "\r\n";
if (item.SQL != target.SQL)
retval += "Original SQL\r\n" + item.SQL + "\r\n\r\nNew SQL\r\n" + target.SQL + "\r\n";
#region Parameters
var addedParameters = target.ParameterList.Where(x => !item.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedParameters = item.ParameterList.Where(x => !target.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonParameters = item.ParameterList.Where(x => target.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedParameters.Count > 0)
{
retval += "Added Parameters: " + string.Join(", ", addedParameters.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedParameters.Count > 0)
{
retval += "Deleted Parameters: " + string.Join(", ", deletedParameters.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var parameter in commonParameters)
{
var t = parameter.GetChangedText(target.ParameterList.FirstOrDefault(x => x.Name == parameter.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed Parameter (" + parameter.Name + ")\r\n" + t + "\r\n";
}
#endregion
#region Fields
var addedFields = target.FieldList.Where(x => !item.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedFields = item.FieldList.Where(x => !target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonFields = item.FieldList.Where(x => target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedFields.Count > 0)
{
retval += "\r\nAdded fields: " + string.Join(", ", addedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedFields.Count > 0)
{
retval += "\r\nDeleted fields: " + string.Join(", ", deletedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var field in commonFields)
{
var t = field.GetChangedText(target.FieldList.FirstOrDefault(x => x.Name == field.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed field (" + field.Name + ")\r\n" + t + "\r\n";
}
#endregion
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.View item, nHydrate.DataImport.View target)
{
var retval = string.Empty;
if (item.Collate != target.Collate)
retval += "Collate: " + item.Collate + "->" + target.Collate + "\r\n";
if (item.Name != target.Name)
retval += "Name: " + item.Name + "->" + target.Name + "\r\n";
if (item.Schema != target.Schema)
retval += "Schema: " + item.Schema + "->" + target.Schema + "\r\n";
if (item.SQL != target.SQL)
retval += "Original SQL\r\n" + item.SQL + "\r\n\r\nNew SQL\r\n" + target.SQL + "\r\n";
#region Fields
var addedFields = target.FieldList.Where(x => !item.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedFields = item.FieldList.Where(x => !target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonFields = item.FieldList.Where(x => target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedFields.Count > 0)
{
retval += "\r\nAdded fields: " + string.Join(", ", addedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedFields.Count > 0)
{
retval += "\r\nDeleted fields: " + string.Join(", ", deletedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var field in commonFields)
{
var t = field.GetChangedText(target.FieldList.FirstOrDefault(x => x.Name == field.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed field (" + field.Name + ")\r\n" + t + "\r\n";
}
#endregion
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.Function item, nHydrate.DataImport.Function target)
{
var retval = string.Empty;
if (item.Collate != target.Collate)
retval += "Collate: " + item.Collate + "->" + target.Collate + "\r\n";
if (item.IsTable != target.IsTable)
retval += "IsTable: " + item.IsTable + "->" + target.IsTable + "\r\n";
if (item.Name != target.Name)
retval += "Name: " + item.Name + "->" + target.Name + "\r\n";
if (item.Schema != target.Schema)
retval += "Schema: " + item.Schema + "->" + target.Schema + "\r\n";
if (item.SQL != target.SQL)
retval += "Original SQL\r\n" + item.SQL + "\r\n\r\nNew SQL\r\n" + target.SQL + "\r\n";
#region Parameters
var addedParameters = target.ParameterList.Where(x => !item.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedParameters = item.ParameterList.Where(x => !target.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonParameters = item.ParameterList.Where(x => target.ParameterList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedParameters.Count > 0)
{
retval += "Added Parameters: " + string.Join(", ", addedParameters.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedParameters.Count > 0)
{
retval += "Deleted Parameters: " + string.Join(", ", deletedParameters.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var parameter in commonParameters)
{
var t = parameter.GetChangedText(target.ParameterList.FirstOrDefault(x => x.Name == parameter.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed Parameter (" + parameter.Name + ")\r\n" + t + "\r\n";
}
#endregion
#region Fields
var addedFields = target.FieldList.Where(x => !item.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var deletedFields = item.FieldList.Where(x => !target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
var commonFields = item.FieldList.Where(x => target.FieldList.Select(z => z.Name).Contains(x.Name)).ToList();
if (addedFields.Count > 0)
{
retval += "\r\nAdded fields: " + string.Join(", ", addedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
if (deletedFields.Count > 0)
{
retval += "\r\nDeleted fields: " + string.Join(", ", deletedFields.Select(x => x.Name).OrderBy(x => x).ToList()) + "\r\n";
}
foreach (var field in commonFields)
{
var t = field.GetChangedText(target.FieldList.FirstOrDefault(x => x.Name == field.Name));
if (!string.IsNullOrEmpty(t))
retval += "Changed field (" + field.Name + ")\r\n" + t + "\r\n";
}
#endregion
return retval;
}
public static string GetChangedText(this nHydrate.DataImport.DatabaseBaseObject item, nHydrate.DataImport.DatabaseBaseObject target)
{
if (item is nHydrate.DataImport.Entity) return ((nHydrate.DataImport.Entity)item).GetChangedText((nHydrate.DataImport.Entity)target);
if (item is nHydrate.DataImport.StoredProc) return ((nHydrate.DataImport.StoredProc)item).GetChangedText((nHydrate.DataImport.StoredProc)target);
if (item is nHydrate.DataImport.View) return ((nHydrate.DataImport.View)item).GetChangedText((nHydrate.DataImport.View)target);
if (item is nHydrate.DataImport.Function) return ((nHydrate.DataImport.Function)item).GetChangedText((nHydrate.DataImport.Function)target);
if (item is nHydrate.DataImport.Field) return ((nHydrate.DataImport.Field)item).GetChangedText((nHydrate.DataImport.Field)target);
if (item is nHydrate.DataImport.Parameter) return ((nHydrate.DataImport.Parameter)item).GetChangedText((nHydrate.DataImport.Parameter)target);
return string.Empty;
}
#endregion
public static string ToElapsedTimeString(double seconds)
{
var h = (int)(seconds / 3600);
seconds = seconds % 3600;
var m = (int)(seconds / 60);
seconds = seconds % 60;
var retval = string.Empty;
if (h > 0) retval += h.ToString("00") + ":";
retval += m.ToString("00") + ":";
retval += seconds.ToString("00");
return retval;
}
public static Field CloneFake(this Field original)
{
var newField = new Field(original.Partition)
{
Name = original.Name,
Category = original.Category,
CodeFacade = original.CodeFacade,
Collate = original.Collate,
DataType = original.DataType,
Default = original.Default,
Formula = original.Formula,
FriendlyName = original.FriendlyName,
IsBrowsable = original.IsBrowsable,
IsCalculated = original.IsCalculated,
Identity = original.Identity,
IsGenerated = original.IsGenerated,
IsIndexed = original.IsIndexed,
IsPrimaryKey = original.IsPrimaryKey,
IsReadOnly = original.IsReadOnly,
IsUnique = original.IsUnique,
Length = original.Length,
Max = original.Max,
Min = original.Min,
Nullable = original.Nullable,
Scale = original.Scale,
Summary = original.Summary,
ValidationExpression = original.ValidationExpression,
};
return newField;
}
public static List<System.Windows.Forms.ListViewItem> ToList(this System.Windows.Forms.ListView.SelectedListViewItemCollection list)
{
var retval = new List<System.Windows.Forms.ListViewItem>();
foreach (System.Windows.Forms.ListViewItem item in list)
{
retval.Add(item);
}
return retval;
}
public static List<System.Windows.Forms.ListViewItem> ToList(this System.Windows.Forms.ListView.ListViewItemCollection list)
{
var retval = new List<System.Windows.Forms.ListViewItem>();
foreach (System.Windows.Forms.ListViewItem item in list)
{
retval.Add(item);
}
return retval;
}
public static bool IsMatch(this DataImport.Index index, Index other)
{
var validColumnList = other.IndexColumns.Where(x => x.GetField() != null).ToList();
if (index.FieldList.Count != validColumnList.Count) return false;
for (var ii = 0; ii < index.FieldList.Count; ii++)
{
var q = index.FieldList[ii];
var w = validColumnList[ii];
if (w.GetField().Name != q.Name || w.Ascending == q.IsDescending)
{
return false;
}
}
return true;
}
public static nHydrate.DataImport.SQLObject ToDatabaseObject(this Entity item)
{
var retval = new nHydrate.DataImport.Entity();
retval.Name = item.Name;
retval.Schema = item.Schema;
retval.AllowCreateAudit = item.AllowCreateAudit;
retval.AllowModifyAudit = item.AllowModifyAudit;
retval.AllowTimestamp = item.AllowTimestamp;
retval.IsTenant = item.IsTenant;
//Fields
foreach (var f in item.Fields)
{
retval.FieldList.Add(new nHydrate.DataImport.Field()
{
Collate = f.Collate,
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), f.DataType.ToString(), true),
DefaultValue = f.Default,
Identity = (f.Identity == IdentityTypeConstants.Database),
IsIndexed = f.IsIndexed,
IsUnique = f.IsUnique,
Length = f.Length,
Name = f.Name,
Nullable = f.Nullable,
PrimaryKey = f.IsPrimaryKey,
Scale = f.Scale,
SortOrder = f.SortOrder,
});
}
return retval;
}
public static nHydrate.DataImport.SQLObject ToDatabaseObject(this View item)
{
var retval = new nHydrate.DataImport.View();
retval.Name = item.Name;
retval.Schema = item.Schema;
retval.SQL = item.SQL;
//Fields
foreach (var f in item.Fields)
{
retval.FieldList.Add(new nHydrate.DataImport.Field()
{
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), f.DataType.ToString(), true),
DefaultValue = f.Default,
Length = f.Length,
Name = f.Name,
Nullable = f.Nullable,
Scale = f.Scale,
});
}
return retval;
}
public static nHydrate.DataImport.SQLObject ToDatabaseObject(this StoredProcedure item)
{
var retval = new nHydrate.DataImport.StoredProc();
retval.Name = item.Name;
retval.Schema = item.Schema;
retval.SQL = item.SQL;
//Fields
foreach (var f in item.Fields)
{
retval.FieldList.Add(new nHydrate.DataImport.Field()
{
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), f.DataType.ToString(), true),
DefaultValue = f.Default,
Length = f.Length,
Name = f.Name,
Nullable = f.Nullable,
Scale = f.Scale,
});
}
//Parameters
foreach (var p in item.Parameters)
{
retval.ParameterList.Add(new nHydrate.DataImport.Parameter()
{
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), p.DataType.ToString(), true),
DefaultValue = p.Default,
Length = p.Length,
Name = p.Name,
Nullable = p.Nullable,
Scale = p.Scale,
IsOutputParameter = p.IsOutputParameter,
});
}
return retval;
}
public static nHydrate.DataImport.SQLObject ToDatabaseObject(this Function item)
{
var retval = new nHydrate.DataImport.Function();
retval.Name = item.Name;
retval.Schema = item.Schema;
retval.SQL = item.SQL;
//Fields
foreach (var f in item.Fields)
{
retval.FieldList.Add(new nHydrate.DataImport.Field()
{
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), f.DataType.ToString(), true),
DefaultValue = f.Default,
Length = f.Length,
Name = f.Name,
Nullable = f.Nullable,
Scale = f.Scale,
});
}
//Parameters
foreach (var p in item.Parameters)
{
retval.ParameterList.Add(new nHydrate.DataImport.Parameter()
{
DataType = (System.Data.SqlDbType)Enum.Parse(typeof(System.Data.SqlDbType), p.DataType.ToString(), true),
DefaultValue = p.Default,
Length = p.Length,
Name = p.Name,
Nullable = p.Nullable,
Scale = p.Scale,
});
}
return retval;
}
public static List<T> ToList<T>(this System.Collections.ICollection list)
{
var retval = new List<T>();
foreach (T item in list)
{
retval.Add(item);
}
return retval;
}
}
}
| 36.932471 | 162 | 0.620813 | [
"MIT"
] | giannik/nHydrate | Source/nHydrate.DslPackage/Extensions/ExtensionMethods.cs | 25,705 | C# |
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Formatting;
namespace RefactoringEssentials.CSharp.CodeRefactorings
{
[ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Convert 'Equals' call to '==' or '!='")]
public class ConvertEqualsToEqualityOperatorCodeRefactoringProvider : CodeRefactoringProvider
{
public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
{
var document = context.Document;
if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
return;
var span = context.Span;
if (!span.IsEmpty)
return;
var cancellationToken = context.CancellationToken;
if (cancellationToken.IsCancellationRequested)
return;
var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
if (model.IsFromGeneratedCode(cancellationToken))
return;
var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
var node = root.FindNode(span) as IdentifierNameSyntax;
if (node == null)
return;
var invocation = node.Parent as InvocationExpressionSyntax ?? node.Parent.Parent as InvocationExpressionSyntax;
if (invocation == null)
return;
var symbol = model.GetSymbolInfo(node).Symbol;
if (symbol == null || symbol.Name != "Equals" || symbol.ContainingType.SpecialType != SpecialType.System_Object)
return;
ExpressionSyntax expr = invocation;
bool useEquality = true;
if (invocation.ArgumentList.Arguments.Count != 2 && invocation.ArgumentList.Arguments.Count != 1)
return;
//node is identifier, parent is invocation, parent.parent (might) be unary negation
var uOp = invocation.Parent as PrefixUnaryExpressionSyntax;
if (uOp != null && uOp.IsKind(SyntaxKind.LogicalNotExpression))
{
expr = uOp;
useEquality = false;
}
context.RegisterRefactoring(
CodeActionFactory.Create(
span,
DiagnosticSeverity.Info,
useEquality ? GettextCatalog.GetString("To '=='") : GettextCatalog.GetString("To '!='"),
t2 =>
{
var newRoot = root.ReplaceNode((SyntaxNode)
expr,
SyntaxFactory.BinaryExpression(
useEquality ? SyntaxKind.EqualsExpression : SyntaxKind.NotEqualsExpression,
invocation.ArgumentList.Arguments.Count == 1 ? ((MemberAccessExpressionSyntax)invocation.Expression).Expression : invocation.ArgumentList.Arguments.First().Expression,
invocation.ArgumentList.Arguments.Last().Expression
).WithAdditionalAnnotations(Formatter.Annotation)
);
return Task.FromResult(document.WithSyntaxRoot(newRoot));
}
)
);
}
}
}
| 45.363636 | 199 | 0.599485 | [
"MIT"
] | GrahamTheCoder/RefactoringEssentials | RefactoringEssentials/CSharp/CodeRefactorings/Synced/ConvertEqualsToEqualityOperatorCodeRefactoringProvider.cs | 3,493 | C# |
//===============================================================================
// Microsoft patterns & practices
// Composite Application Guidance for Windows Presentation Foundation
//===============================================================================
// Copyright (c) Microsoft Corporation. All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious. No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
namespace StockTraderRI.Infrastructure.Converters
{
public class EnumToBooleanConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || parameter == null)
return false;
return value.Equals(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || parameter == null)
return null;
if ((bool)value)
return parameter;
return null;
}
#endregion
}
}
| 36.923077 | 103 | 0.566146 | [
"Apache-2.0"
] | andrewdbond/CompositeWPF | sourceCode/compositewpf/V1/trunk/Source/StockTraderRI/StockTraderRI.Infrastructure/Converters/EnumToBooleanConverter.cs | 1,920 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the connect-2017-08-08.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Connect.Model
{
/// <summary>
/// This is the response object from the DeleteUser operation.
/// </summary>
public partial class DeleteUserResponse : AmazonWebServiceResponse
{
}
} | 29.026316 | 105 | 0.730734 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/Connect/Generated/Model/DeleteUserResponse.cs | 1,103 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNextGen.Synapse.Inputs
{
/// <summary>
/// Data proxy properties for a managed dedicated integration runtime.
/// </summary>
public sealed class IntegrationRuntimeDataProxyPropertiesArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The self-hosted integration runtime reference.
/// </summary>
[Input("connectVia")]
public Input<Inputs.EntityReferenceArgs>? ConnectVia { get; set; }
/// <summary>
/// The path to contain the staged data in the Blob storage.
/// </summary>
[Input("path")]
public Input<string>? Path { get; set; }
/// <summary>
/// The staging linked service reference.
/// </summary>
[Input("stagingLinkedService")]
public Input<Inputs.EntityReferenceArgs>? StagingLinkedService { get; set; }
public IntegrationRuntimeDataProxyPropertiesArgs()
{
}
}
}
| 30.707317 | 87 | 0.641779 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/dotnet/Synapse/Inputs/IntegrationRuntimeDataProxyPropertiesArgs.cs | 1,259 | C# |
// Copyright 2019 Esri.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI.Controls;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace ArcGISRuntimeXamarin.Samples.GroupLayers
{
[Activity]
[ArcGISRuntime.Samples.Shared.Attributes.Sample(
"Group layers",
"Layers",
"Group a collection of layers together and toggle their visibility as a group.",
"")]
public class GroupLayers : Activity
{
// Hold references to the UI controls.
private SceneView _mySceneView;
private LinearLayout _layerListView;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Title = "Group layers";
CreateLayout();
Initialize();
}
private async void Initialize()
{
// Create the layers.
ArcGISSceneLayer devOne = new ArcGISSceneLayer(new Uri("https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_Trees/SceneServer/layers/0"));
ArcGISSceneLayer devTwo = new ArcGISSceneLayer(new Uri("https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_Pathways/SceneServer/layers/0"));
ArcGISSceneLayer devThree = new ArcGISSceneLayer(new Uri("https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/DevA_BuildingShell_Textured/SceneServer/layers/0"));
ArcGISSceneLayer nonDevOne = new ArcGISSceneLayer(new Uri("https://scenesampleserverdev.arcgis.com/arcgis/rest/services/Hosted/PlannedDemo_BuildingShell/SceneServer/layers/0"));
FeatureLayer nonDevTwo = new FeatureLayer(new Uri("https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/DevelopmentProjectArea/FeatureServer/0"));
// Create the group layer and add sublayers.
GroupLayer gLayer = new GroupLayer();
gLayer.Name = "Group: Dev A";
gLayer.Layers.Add(devOne);
gLayer.Layers.Add(devTwo);
gLayer.Layers.Add(devThree);
// Create the scene with a basemap.
_mySceneView.Scene = new Scene(Basemap.CreateImagery());
// Add the top-level layers to the scene.
_mySceneView.Scene.OperationalLayers.Add(gLayer);
_mySceneView.Scene.OperationalLayers.Add(nonDevOne);
_mySceneView.Scene.OperationalLayers.Add(nonDevTwo);
// Wait for all of the layers in the group layer to load.
await Task.WhenAll(gLayer.Layers.ToList().Select(m => m.LoadAsync()).ToList());
// Zoom to the extent of the group layer.
_mySceneView.SetViewpoint(new Viewpoint(gLayer.FullExtent));
// Add the layer list to the UI.
foreach (Layer layer in _mySceneView.Scene.OperationalLayers)
{
AddLayersToUI(layer);
}
}
private async void AddLayersToUI(Layer layer, int nestLevel = 0)
{
// Wait for the layer to load - ensures that the UI will be up-to-date.
await layer.LoadAsync();
// Add a row for the current layer.
_layerListView.AddView(ViewForLayer(layer, nestLevel));
// Add rows for any children of this layer if it is a group layer.
if (layer is GroupLayer layerGroup)
{
foreach (Layer child in layerGroup.Layers)
{
AddLayersToUI(child, nestLevel + 1);
}
}
}
private View ViewForLayer(Layer layer, int nestLevel = 0)
{
// Create the view that holds the row.
LinearLayout rowContainer = new LinearLayout(this);
rowContainer.Orientation = Orientation.Horizontal;
// Padding implements the nesting/hieararchy display.
rowContainer.SetPadding(32 * nestLevel, 0, 0, 0);
// Create and configure the visibility toggle.
CheckBox toggle = new CheckBox(this);
toggle.Checked = true;
toggle.CheckedChange += (sender, args) => layer.IsVisible = toggle.Checked;
rowContainer.AddView(toggle);
// Add a label for the layer.
rowContainer.AddView(new TextView(this) {Text = layer.Name});
return rowContainer;
}
private void CreateLayout()
{
// Create a new vertical layout for the app.
var layout = new LinearLayout(this) {Orientation = Orientation.Vertical};
_layerListView = new LinearLayout(this);
_layerListView.Orientation = Orientation.Vertical;
layout.AddView(_layerListView);
// Add the map view to the layout.
_mySceneView = new SceneView();
layout.AddView(_mySceneView);
// Show the layout in the app.
SetContentView(layout);
}
}
} | 40.427536 | 190 | 0.639003 | [
"Apache-2.0"
] | ChrisFrenchPDX/arcgis-runtime-samples-dotnet | src/Android/Xamarin.Android/Samples/Layers/GroupLayers/GroupLayers.cs | 5,579 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 組件的一般資訊是由下列的屬性集控制。
// 變更這些屬性的值即可修改組件的相關
// 資訊。
[assembly: AssemblyTitle("DBFunctions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DBFunctions")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 將 ComVisible 設為 false 可對 COM 元件隱藏
// 組件中的類型。若必須從 COM 存取此組件中的類型,
// 的類型,請在該類型上將 ComVisible 屬性設定為 true。
[assembly: ComVisible(false)]
// 下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID
[assembly: Guid("740236ad-2a67-4ded-8ce2-f267036d3966")]
// 組件的版本資訊由下列四個值所組成:
//
// 主要版本
// 次要版本
// 組建編號
// 修訂編號
//
// 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號
// 設為預設,如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 25.783784 | 56 | 0.713836 | [
"MIT"
] | zxz13561/WebFormMiniSample | WebFormMiniSample/DBFunctions/Properties/AssemblyInfo.cs | 1,283 | C# |
using System;
using FluentAssertions;
using MediatR.AspNet.Exceptions;
using NUnit.Framework;
namespace MediatR.AspNet.Tests.ExceptionsTests {
public class ExistsExceptionTests {
[Test]
public void ShouldBeException() {
// Arrange
// Act
// Assert
typeof(ExistsException).Should().BeAssignableTo(typeof(Exception));
}
[Test]
public void NoArguments_ShouldReturnExceptionWithBaseMessage() {
// Arrange
// Act
var exception = new ExistsException();
// Assert
exception.Message.Should().Be("Entity already exists");
}
[Test]
public void EntityType_ShouldReturnExceptionWithEntityType() {
// Arrange
var type = typeof(string);
// Act
var exception = new ExistsException(type);
// Assert
exception.Message.Should().Be($"{type.Name} already exists");
}
[Test]
public void EntityTypeAndId_ShouldReturnExceptionWithEntityTypeAndId() {
// Arrange
var type = typeof(string);
var id = "000";
// Act
var exception = new ExistsException(type, id);
// Assert
exception.Message.Should().Be($"{type.Name} with id {id} already exists");
}
[Test]
public void MessageAndInnerException_ShouldReturnExceptionWithMessageAndInnerException() {
// Arrange
var innerException = new ArgumentException();
var message = "test";
// Act
var exception = new ExistsException(message, innerException);
// Assert
exception.Message.Should().Be(message);
exception.InnerException.Should().Be(innerException);
}
[Test]
public void Message_ShouldReturnExceptionWithMessage() {
// Arrange
var message = "test";
// Act
var exception = new ExistsException(message);
// Assert
exception.Message.Should().Be(message);
}
}
} | 33.323077 | 98 | 0.561404 | [
"MIT"
] | MossPiglets/MediatR.AspNet | MediatR.AspNet/MediatR.AspNet.Tests/ExceptionsTests/ExistsExceptionTests.cs | 2,166 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Final.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| 34.193548 | 151 | 0.579245 | [
"MIT"
] | GageWaack/Final | Final/Final/Properties/Settings.Designer.cs | 1,062 | C# |
using UnityEngine;
namespace DuloGames.UI
{
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
public class UICanvasAnchorToCamera : MonoBehaviour
{
[SerializeField] private Camera m_Camera;
[SerializeField][Range(0f, 1f)] float m_Vertical = 0f;
[SerializeField][Range(0f, 1f)] float m_Horizontal = 0f;
private RectTransform m_RectTransform;
protected void Awake()
{
this.m_RectTransform = this.transform as RectTransform;
}
void Update()
{
if (this.m_Camera == null)
return;
Vector3 newPos = this.m_Camera.ViewportToWorldPoint(new Vector3(this.m_Horizontal, this.m_Vertical, this.m_Camera.farClipPlane));
newPos.z = this.m_RectTransform.position.z;
this.m_RectTransform.position = newPos;
}
}
}
| 28.903226 | 141 | 0.627232 | [
"BSD-2-Clause"
] | edisonlee0212/Geometry-Escape | Geometry-Escape/Assets/UI/Scripts/UI/Miscellaneous/UICanvasAnchorToCamera.cs | 896 | C# |
public class RPG : Ammunition
{
private const double WeightConst = 17.1;
public override double Weight => WeightConst;
} | 21.666667 | 49 | 0.715385 | [
"MIT"
] | valkin88/CSharp-Fundamentals | CSharp OOP Advanced/Exam Preparations/TheLastArmy/TheLastArmy/Entities/Ammunitions/RPG.cs | 132 | C# |
using System;
using System.Linq;
using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using Orleans;
using Orleans.Runtime;
using Orleans.Runtime.Configuration;
using TestGrainInterfaces;
using Xunit;
namespace NonSilo.Tests
{
/// <summary>
/// Tests for <see cref="ClientBuilder"/>.
/// </summary>
[TestCategory("BVT")]
[TestCategory("ClientBuilder")]
public class ClientBuilderTests
{
/// <summary>
/// Tests that the client builder will fail if no assemblies are configured.
/// </summary>
[Fact]
public void ClientBuilder_AssembliesTest()
{
var builder = ClientBuilder.CreateDefault();
Assert.Throws<OrleansConfigurationException>(() => builder.Build());
// Adding an application assembly causes the
builder = ClientBuilder.CreateDefault().AddApplicationPart(typeof(IAccountGrain).Assembly);
using (var client = builder.Build())
{
Assert.NotNull(client);
}
}
/// <summary>
/// Tests that a client can be created without specifying configuration.
/// </summary>
[Fact]
public void ClientBuilder_NoSpecifiedConfigurationTest()
{
var builder = ClientBuilder.CreateDefault().ConfigureServices(RemoveConfigValidators);
using (var client = builder.Build())
{
Assert.NotNull(client);
}
}
/// <summary>
/// Tests that a builder can not be used to build more than one client.
/// </summary>
[Fact]
public void ClientBuilder_DoubleBuildTest()
{
var builder = ClientBuilder.CreateDefault().ConfigureServices(RemoveConfigValidators);
using (builder.Build())
{
Assert.Throws<InvalidOperationException>(() => builder.Build());
}
}
/// <summary>
/// Tests that configuration cannot be specified twice.
/// </summary>
[Fact]
public void ClientBuilder_DoubleSpecifyConfigurationTest()
{
var builder = ClientBuilder.CreateDefault().ConfigureServices(RemoveConfigValidators).UseConfiguration(new ClientConfiguration());
Assert.Throws<InvalidOperationException>(() => builder.UseConfiguration(new ClientConfiguration()));
}
/// <summary>
/// Tests that a client can be created without specifying configuration.
/// </summary>
[Fact]
public void ClientBuilder_NullConfigurationTest()
{
var builder = ClientBuilder.CreateDefault().ConfigureServices(RemoveConfigValidators);
Assert.Throws<ArgumentNullException>(() => builder.UseConfiguration(null));
}
/// <summary>
/// Tests that the <see cref="IClientBuilder.ConfigureServices"/> delegate works as expected.
/// </summary>
[Fact]
public void ClientBuilder_ServiceProviderTest()
{
var builder = ClientBuilder.CreateDefault().ConfigureServices(RemoveConfigValidators);
Assert.Throws<ArgumentNullException>(() => builder.ConfigureServices(null));
var registeredFirst = new int[1];
var one = new MyService { Id = 1 };
builder.ConfigureServices(
services =>
{
Interlocked.CompareExchange(ref registeredFirst[0], 1, 0);
services.AddSingleton(one);
});
var two = new MyService { Id = 2 };
builder.ConfigureServices(
services =>
{
Interlocked.CompareExchange(ref registeredFirst[0], 2, 0);
services.AddSingleton(two);
});
using (var client = builder.Build())
{
var services = client.ServiceProvider.GetServices<MyService>()?.ToList();
Assert.NotNull(services);
// Both services should be registered.
Assert.Equal(2, services.Count);
Assert.NotNull(services.FirstOrDefault(svc => svc.Id == 1));
Assert.NotNull(services.FirstOrDefault(svc => svc.Id == 2));
// Service 1 should have been registered first - the pipeline order should be preserved.
Assert.Equal(1, registeredFirst[0]);
// The last registered service should be provided by default.
Assert.Equal(2, client.ServiceProvider.GetRequiredService<MyService>().Id);
}
}
private static void RemoveConfigValidators(IServiceCollection services)
{
var validators = services.Where(descriptor => descriptor.ServiceType == typeof(IConfigurationValidator)).ToList();
foreach (var validator in validators) services.Remove(validator);
}
private class MyService
{
public int Id { get; set; }
}
}
}
| 36.340426 | 142 | 0.584504 | [
"MIT"
] | seralexeev/orleans | test/NonSilo.Tests/ClientBuilderTests.cs | 5,126 | C# |
/*
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using Adxstudio.Xrm.Resources;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
namespace Adxstudio.Xrm.Cases
{
/// <summary>
/// Implements <see cref="ICaseAccessPermissionScopesProvider"/> for adx_caseaccess permission rules.
/// </summary>
public class ContactCaseAccessPermissionScopesProvider : ICaseAccessPermissionScopesProvider
{
internal enum CaseAccessPermissionScope
{
Self = 1,
Account = 2,
}
public ContactCaseAccessPermissionScopesProvider(EntityReference contact, IDataAdapterDependencies dependencies)
{
if (contact == null) throw new ArgumentNullException("contact");
if (contact.LogicalName != "contact") throw new ArgumentException(string.Format(ResourceManager.GetString("Value_Missing_For_LogicalName"), contact.LogicalName), "contact");
if (dependencies == null) throw new ArgumentNullException("dependencies");
Contact = contact;
Dependencies = dependencies;
}
protected EntityReference Contact { get; private set; }
protected IDataAdapterDependencies Dependencies { get; private set; }
public ICaseAccessPermissionScopes SelectPermissionScopes()
{
var serviceContext = Dependencies.GetServiceContext();
var adx_caseaccesses = serviceContext.GetCaseAccessByContact(Contact).ToArray();
// If no permissions are defined for Contact at all, default to full Self permissions, but no account permissions.
if (!adx_caseaccesses.Any())
{
return CaseAccessPermissionScopes.SelfOnly;
}
var self = new MutableCaseAccessPermissions();
var accounts = new Dictionary<Guid, Tuple<EntityReference, MutableCaseAccessPermissions>>();
// Equivalent permission rules get their individual rights grants OR'ed together.
foreach (var adx_caseaccess in adx_caseaccesses)
{
var scope = adx_caseaccess.GetAttributeValue<OptionSetValue>("adx_scope") ?? new OptionSetValue((int)CaseAccessPermissionScope.Self);
var account = GetAccount(serviceContext, adx_caseaccess);
var grantCreate = adx_caseaccess.GetAttributeValue<bool?>("adx_create").GetValueOrDefault();
var grantDelete = adx_caseaccess.GetAttributeValue<bool?>("adx_delete").GetValueOrDefault();
var grantWrite = adx_caseaccess.GetAttributeValue<bool?>("adx_write").GetValueOrDefault();
var grantRead = adx_caseaccess.GetAttributeValue<bool?>("adx_read").GetValueOrDefault();
if (scope.Value == (int)CaseAccessPermissionScope.Self)
{
self.Create = grantCreate || self.Create;
self.Delete = grantDelete || self.Delete;
self.Read = grantRead || self.Read;
self.Write = grantWrite || self.Write;
continue;
}
if (scope.Value == (int)CaseAccessPermissionScope.Account && account != null)
{
Tuple<EntityReference, MutableCaseAccessPermissions> accountPermissions;
if (accounts.TryGetValue(account.Id, out accountPermissions))
{
var permissions = accountPermissions.Item2;
permissions.Create = grantCreate || permissions.Create;
permissions.Delete = grantDelete || permissions.Delete;
permissions.Read = grantRead || permissions.Read;
permissions.Write = grantWrite || permissions.Write;
}
else
{
accounts.Add(
account.Id,
new Tuple<EntityReference, MutableCaseAccessPermissions>(
account,
new MutableCaseAccessPermissions(grantCreate, grantDelete, grantRead, grantWrite)));
}
}
}
return new CaseAccessPermissionScopes(
new CaseAccessPermissions(self.Create, self.Delete, self.Read, self.Write),
from e in accounts
let account = e.Value.Item1
let permissions = e.Value.Item2
select new AccountCaseAccessPermissions(account, permissions.Create, permissions.Delete, permissions.Read, permissions.Write));
}
private static EntityReference GetAccount(OrganizationServiceContext serviceContext, Entity adx_caseaccess)
{
if (serviceContext == null) throw new ArgumentNullException("serviceContext");
if (adx_caseaccess == null) throw new ArgumentNullException("adx_caseaccess");
var accountReference = adx_caseaccess.GetAttributeValue<EntityReference>("adx_accountid");
if (accountReference == null)
{
return null;
}
if (!string.IsNullOrEmpty(accountReference.Name))
{
return accountReference;
}
// If the account EntityReference retrieved from the adx_caseaccess entity does not have its Name
// set, retrieve the full account to get its name and rebuild the EntityReference with this data.
// We want consumers of the API to be able to rely on that value being present.
var account = serviceContext.CreateQuery("account").FirstOrDefault(e => e.GetAttributeValue<Guid>("accountid") == accountReference.Id);
if (account == null)
{
return accountReference;
}
return new EntityReference(account.LogicalName, account.Id)
{
Name = account.GetAttributeValue<string>("name")
};
}
private class MutableCaseAccessPermissions : ICaseAccessPermissions
{
public MutableCaseAccessPermissions(bool create = false, bool delete = false, bool read = false, bool write = false)
{
Create = create;
Delete = delete;
Read = read;
Write = write;
}
public bool Create { get; set; }
public bool Delete { get; set; }
public bool Read { get; set; }
public bool Write { get; set; }
}
}
}
| 34.99375 | 176 | 0.732809 | [
"MIT"
] | Adoxio/xRM-Portals-Community-Edition | Framework/Adxstudio.Xrm/Cases/ContactCaseAccessPermissionScopesProvider.cs | 5,599 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace WL.Account.Core.Core
{
/// <summary>
/// 公共错误
/// </summary>
public static class PubError
{
public static readonly string DBOPERR = "数据库操作错误";
/* 错误分类:(只涉及大分类。不考虑细节,这一阶段重点考虑 接口)
*
* 数据库操作错误,创建错误,更新错误,查询错误-查询不到,其他错误,数据层业务错误-缺少数据,数据层业务错误-数据不符
* 重点记录:类别,摘要,参数
*/
public static readonly IDictionary<string, IErrorDic> ErrorDic = new Dictionary<string, IErrorDic>() {
[""] = CreateError("ERR-00200001", "DB", "未定义的错误"),
["ERR-00200001"] = CreateError("ERR-00200001", "DB", "定义的常规错误"),
["ERR-00200101"] = CreateError("ERR-00200100", "DB", "数据库语句错误"),
["ERR-00200201"] = CreateError("ERR-00200200", "DB", "数据库创建数据失败"),
["ERR-00200301"] = CreateError("ERR-00200300", "DB", "数据库更新,结果不符合更新预期 响应行数=0"),
[""] = CreateError("ERR-0030002", "BLLError", "业务错误"),
};
/// <summary>
/// 创建错误
/// </summary>
/// <param name="errorCode"></param>
/// <param name="errorCate"></param>
/// <param name="errorContent"></param>
/// <param name="errorAbstract"></param>
/// <param name="errorTemplate"></param>
/// <returns></returns>
public static IErrorDic CreateError(string errorCode, string errorCate, string errorContent, string errorAbstract = "", string errorTemplate = "")
{
var err = new StaticError() { ErrorCode = errorCode, ErrorCate = errorCate, ErrorAbstract = errorAbstract, ErrorTemplate = errorTemplate };
if (string.IsNullOrWhiteSpace(err.ErrorAbstract)) { err.ErrorAbstract = DBOPERR; }
return err;
}
/// <summary>
/// 链接一个错误,编码找不到就生成一个新的错误
/// </summary>
/// <param name="errorCode"></param>
/// <param name="errorDetail"></param>
/// <param name="errorFunc"></param>
/// <param name="paramData"></param>
/// <returns></returns>
public static IErrorDic DBError(string errorCode, string errorFunc, string errorDetail = "", params object[] paramData)
{
IErrorDic temp = new StaticError() { ErrorCode = errorCode, ErrorCate = "DB", ErrorFunc = errorFunc };
IErrorDic err = ErrorDic.ContainsKey(errorCode) ? ErrorDic[errorCode] : temp;
err.ErrorDetail = errorDetail;
return err;
}
}
public class StaticError : IErrorDic
{
public string ErrorCode { get; set; } = "";
public string ErrorFunc { get; set; }
public string ErrorFuncCN { get; set; }
public string ErrorLevel { get; set; }
public string ErrorCate { get; set; }
public string ErrorDetail { get; set; }
public string ErrorContent { get; set; }
public string ErrorPath { get; set; }
public string ErrorTemplate { get; set; }
public string ErrorAbstract { get; set; }
public string ToStr()
{
return $"ErrorCode:{ErrorCode}, ErrorFunc:{ErrorFuncCN}[{ErrorFunc}] ErrorContent: {ErrorContent} - {ErrorDetail}";
}
public override string ToString()
{
return $"ErrorCode:{ErrorCode}, ErrorContent: {ErrorContent} - {ErrorDetail}";
}
}
/// <summary>
///
/// </summary>
public interface IErrorDic
{
string ErrorCate { get; set; }
string ErrorCode { get; set; }
string ErrorFunc { get; set; }
string ErrorTemplate { get; set; }
string ErrorDetail { get; set; }
string ErrorContent { get; set; }
string ErrorAbstract { get; set; }
string ToString();
string ToStr() => $"ErrorCode:{ErrorCode}, ErrorFunc:[{ErrorFunc}] ErrorContent: {ErrorContent} - {ErrorDetail}";
}
}
| 36.688679 | 154 | 0.576755 | [
"MIT"
] | wlfsky/netcorewebapi | src/Account/WL.Account.Core/Core/PubErrorDic.cs | 4,263 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace InvestmentAnalysis.Runtime.Extensions {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Messages {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Messages() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InvestmentAnalysis.Runtime.Extensions.Messages", typeof(Messages).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Empty path name is not legal..
/// </summary>
public static string Argument_EmptyPath {
get {
return ResourceManager.GetString("Argument_EmptyPath", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Positive number required..
/// </summary>
public static string ArgumentOutOfRange_NeedPosNum {
get {
return ResourceManager.GetString("ArgumentOutOfRange_NeedPosNum", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cannot read from a closed PortfolioReader..
/// </summary>
public static string ObjectDisposed_ReaderClosed {
get {
return ResourceManager.GetString("ObjectDisposed_ReaderClosed", resourceCulture);
}
}
}
}
| 41.89011 | 190 | 0.601259 | [
"Apache-2.0"
] | andreypudov/InvestmentAnalysis | src/InvestmentAnalysis.Runtime.Extensions/Messages.Designer.cs | 3,814 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Symbols;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.Emit
{
internal abstract class PEAssemblyBuilderBase : PEModuleBuilder, Cci.IAssemblyReference
{
private readonly SourceAssemblySymbol _sourceAssembly;
/// <summary>
/// Additional types injected by the Expression Evaluator.
/// </summary>
private readonly ImmutableArray<NamedTypeSymbol> _additionalTypes;
private ImmutableArray<Cci.IFileReference> _lazyFiles;
/// <summary>This is a cache of a subset of <seealso cref="_lazyFiles"/>. We don't include manifest resources in ref assemblies</summary>
private ImmutableArray<Cci.IFileReference> _lazyFilesWithoutManifestResources;
private SynthesizedEmbeddedAttributeSymbol _lazyEmbeddedAttribute;
private SynthesizedEmbeddedAttributeSymbol _lazyIsReadOnlyAttribute;
private SynthesizedEmbeddedAttributeSymbol _lazyIsByRefLikeAttribute;
private SynthesizedEmbeddedAttributeSymbol _lazyIsUnmanagedAttribute;
private SynthesizedEmbeddedNullableAttributeSymbol _lazyNullableAttribute;
private SynthesizedEmbeddedNullableContextAttributeSymbol _lazyNullableContextAttribute;
private SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol _lazyNullablePublicOnlyAttribute;
private SynthesizedEmbeddedNativeIntegerAttributeSymbol _lazyNativeIntegerAttribute;
/// <summary>
/// The behavior of the C# command-line compiler is as follows:
/// 1) If the /out switch is specified, then the explicit assembly name is used.
/// 2) Otherwise,
/// a) if the assembly is executable, then the assembly name is derived from
/// the name of the file containing the entrypoint;
/// b) otherwise, the assembly name is derived from the name of the first input
/// file.
///
/// Since we don't know which method is the entrypoint until well after the
/// SourceAssemblySymbol is created, in case 2a, its name will not reflect the
/// name of the file containing the entrypoint. We leave it to our caller to
/// provide that name explicitly.
/// </summary>
/// <remarks>
/// In cases 1 and 2b, we expect (metadataName == sourceAssembly.MetadataName).
/// </remarks>
private readonly string _metadataName;
public PEAssemblyBuilderBase(
SourceAssemblySymbol sourceAssembly,
EmitOptions emitOptions,
OutputKind outputKind,
Cci.ModulePropertiesForSerialization serializationProperties,
IEnumerable<ResourceDescription> manifestResources,
ImmutableArray<NamedTypeSymbol> additionalTypes)
: base((SourceModuleSymbol)sourceAssembly.Modules[0], emitOptions, outputKind, serializationProperties, manifestResources)
{
Debug.Assert(sourceAssembly is object);
_sourceAssembly = sourceAssembly;
_additionalTypes = additionalTypes.NullToEmpty();
_metadataName = (emitOptions.OutputNameOverride == null) ? sourceAssembly.MetadataName : FileNameUtilities.ChangeExtension(emitOptions.OutputNameOverride, extension: null);
AssemblyOrModuleSymbolToModuleRefMap.Add(sourceAssembly, this);
}
public sealed override ISourceAssemblySymbolInternal SourceAssemblyOpt
=> _sourceAssembly;
public sealed override ImmutableArray<NamedTypeSymbol> GetAdditionalTopLevelTypes()
=> _additionalTypes;
internal sealed override ImmutableArray<NamedTypeSymbol> GetEmbeddedTypes(BindingDiagnosticBag diagnostics)
{
var builder = ArrayBuilder<NamedTypeSymbol>.GetInstance();
CreateEmbeddedAttributesIfNeeded(diagnostics);
builder.AddIfNotNull(_lazyEmbeddedAttribute);
builder.AddIfNotNull(_lazyIsReadOnlyAttribute);
builder.AddIfNotNull(_lazyIsUnmanagedAttribute);
builder.AddIfNotNull(_lazyIsByRefLikeAttribute);
builder.AddIfNotNull(_lazyNullableAttribute);
builder.AddIfNotNull(_lazyNullableContextAttribute);
builder.AddIfNotNull(_lazyNullablePublicOnlyAttribute);
builder.AddIfNotNull(_lazyNativeIntegerAttribute);
return builder.ToImmutableAndFree();
}
public sealed override IEnumerable<Cci.IFileReference> GetFiles(EmitContext context)
{
if (!context.IsRefAssembly)
{
return getFiles(ref _lazyFiles);
}
return getFiles(ref _lazyFilesWithoutManifestResources);
ImmutableArray<Cci.IFileReference> getFiles(ref ImmutableArray<Cci.IFileReference> lazyFiles)
{
if (lazyFiles.IsDefault)
{
var builder = ArrayBuilder<Cci.IFileReference>.GetInstance();
try
{
var modules = _sourceAssembly.Modules;
for (int i = 1; i < modules.Length; i++)
{
builder.Add((Cci.IFileReference)Translate(modules[i], context.Diagnostics));
}
if (!context.IsRefAssembly)
{
// resources are not emitted into ref assemblies
foreach (ResourceDescription resource in ManifestResources)
{
if (!resource.IsEmbedded)
{
builder.Add(resource);
}
}
}
// Dev12 compilers don't report ERR_CryptoHashFailed if there are no files to be hashed.
if (ImmutableInterlocked.InterlockedInitialize(ref lazyFiles, builder.ToImmutable()) && lazyFiles.Length > 0)
{
if (!CryptographicHashProvider.IsSupportedAlgorithm(_sourceAssembly.HashAlgorithm))
{
context.Diagnostics.Add(new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_CryptoHashFailed), NoLocation.Singleton));
}
}
}
finally
{
builder.Free();
}
}
return lazyFiles;
}
}
protected override void AddEmbeddedResourcesFromAddedModules(ArrayBuilder<Cci.ManagedResource> builder, DiagnosticBag diagnostics)
{
var modules = _sourceAssembly.Modules;
int count = modules.Length;
for (int i = 1; i < count; i++)
{
var file = (Cci.IFileReference)Translate(modules[i], diagnostics);
try
{
foreach (EmbeddedResource resource in ((Symbols.Metadata.PE.PEModuleSymbol)modules[i]).Module.GetEmbeddedResourcesOrThrow())
{
builder.Add(new Cci.ManagedResource(
resource.Name,
(resource.Attributes & ManifestResourceAttributes.Public) != 0,
null,
file,
resource.Offset));
}
}
catch (BadImageFormatException)
{
diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_BindToBogus, modules[i]), NoLocation.Singleton);
}
}
}
public override string Name => _metadataName;
public AssemblyIdentity Identity => _sourceAssembly.Identity;
public Version AssemblyVersionPattern => _sourceAssembly.AssemblyVersionPattern;
internal override SynthesizedAttributeData SynthesizeEmbeddedAttribute()
{
// _lazyEmbeddedAttribute should have been created before calling this method.
return new SynthesizedAttributeData(
_lazyEmbeddedAttribute.Constructors[0],
ImmutableArray<TypedConstant>.Empty,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
internal override SynthesizedAttributeData SynthesizeNullableAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments)
{
if ((object)_lazyNullableAttribute != null)
{
var constructorIndex = (member == WellKnownMember.System_Runtime_CompilerServices_NullableAttribute__ctorTransformFlags) ? 1 : 0;
return new SynthesizedAttributeData(
_lazyNullableAttribute.Constructors[constructorIndex],
arguments,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.SynthesizeNullableAttribute(member, arguments);
}
internal override SynthesizedAttributeData SynthesizeNullableContextAttribute(ImmutableArray<TypedConstant> arguments)
{
if ((object)_lazyNullableContextAttribute != null)
{
return new SynthesizedAttributeData(
_lazyNullableContextAttribute.Constructors[0],
arguments,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.SynthesizeNullableContextAttribute(arguments);
}
internal override SynthesizedAttributeData SynthesizeNullablePublicOnlyAttribute(ImmutableArray<TypedConstant> arguments)
{
if ((object)_lazyNullablePublicOnlyAttribute != null)
{
return new SynthesizedAttributeData(
_lazyNullablePublicOnlyAttribute.Constructors[0],
arguments,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.SynthesizeNullablePublicOnlyAttribute(arguments);
}
internal override SynthesizedAttributeData SynthesizeNativeIntegerAttribute(WellKnownMember member, ImmutableArray<TypedConstant> arguments)
{
if ((object)_lazyNativeIntegerAttribute != null)
{
var constructorIndex = (member == WellKnownMember.System_Runtime_CompilerServices_NativeIntegerAttribute__ctorTransformFlags) ? 1 : 0;
return new SynthesizedAttributeData(
_lazyNativeIntegerAttribute.Constructors[constructorIndex],
arguments,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.SynthesizeNativeIntegerAttribute(member, arguments);
}
protected override SynthesizedAttributeData TrySynthesizeIsReadOnlyAttribute()
{
if ((object)_lazyIsReadOnlyAttribute != null)
{
return new SynthesizedAttributeData(
_lazyIsReadOnlyAttribute.Constructors[0],
ImmutableArray<TypedConstant>.Empty,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.TrySynthesizeIsReadOnlyAttribute();
}
protected override SynthesizedAttributeData TrySynthesizeIsUnmanagedAttribute()
{
if ((object)_lazyIsUnmanagedAttribute != null)
{
return new SynthesizedAttributeData(
_lazyIsUnmanagedAttribute.Constructors[0],
ImmutableArray<TypedConstant>.Empty,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.TrySynthesizeIsUnmanagedAttribute();
}
protected override SynthesizedAttributeData TrySynthesizeIsByRefLikeAttribute()
{
if ((object)_lazyIsByRefLikeAttribute != null)
{
return new SynthesizedAttributeData(
_lazyIsByRefLikeAttribute.Constructors[0],
ImmutableArray<TypedConstant>.Empty,
ImmutableArray<KeyValuePair<string, TypedConstant>>.Empty);
}
return base.TrySynthesizeIsByRefLikeAttribute();
}
private void CreateEmbeddedAttributesIfNeeded(BindingDiagnosticBag diagnostics)
{
EmbeddableAttributes needsAttributes = GetNeedsGeneratedAttributes();
if (ShouldEmitNullablePublicOnlyAttribute() &&
Compilation.CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes.NullablePublicOnlyAttribute, diagnostics, Location.None))
{
needsAttributes |= EmbeddableAttributes.NullablePublicOnlyAttribute;
}
else if (needsAttributes == 0)
{
return;
}
var createParameterlessEmbeddedAttributeSymbol = new Func<string, NamespaceSymbol, BindingDiagnosticBag, SynthesizedEmbeddedAttributeSymbol>(CreateParameterlessEmbeddedAttributeSymbol);
CreateAttributeIfNeeded(
ref _lazyEmbeddedAttribute,
diagnostics,
AttributeDescription.CodeAnalysisEmbeddedAttribute,
createParameterlessEmbeddedAttributeSymbol);
if ((needsAttributes & EmbeddableAttributes.IsReadOnlyAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyIsReadOnlyAttribute,
diagnostics,
AttributeDescription.IsReadOnlyAttribute,
createParameterlessEmbeddedAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.IsByRefLikeAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyIsByRefLikeAttribute,
diagnostics,
AttributeDescription.IsByRefLikeAttribute,
createParameterlessEmbeddedAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.IsUnmanagedAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyIsUnmanagedAttribute,
diagnostics,
AttributeDescription.IsUnmanagedAttribute,
createParameterlessEmbeddedAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.NullableAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyNullableAttribute,
diagnostics,
AttributeDescription.NullableAttribute,
CreateNullableAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.NullableContextAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyNullableContextAttribute,
diagnostics,
AttributeDescription.NullableContextAttribute,
CreateNullableContextAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.NullablePublicOnlyAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyNullablePublicOnlyAttribute,
diagnostics,
AttributeDescription.NullablePublicOnlyAttribute,
CreateNullablePublicOnlyAttributeSymbol);
}
if ((needsAttributes & EmbeddableAttributes.NativeIntegerAttribute) != 0)
{
CreateAttributeIfNeeded(
ref _lazyNativeIntegerAttribute,
diagnostics,
AttributeDescription.NativeIntegerAttribute,
CreateNativeIntegerAttributeSymbol);
}
}
private SynthesizedEmbeddedAttributeSymbol CreateParameterlessEmbeddedAttributeSymbol(string name, NamespaceSymbol containingNamespace, BindingDiagnosticBag diagnostics)
=> new SynthesizedEmbeddedAttributeSymbol(
name,
containingNamespace,
SourceModule,
baseType: GetWellKnownType(WellKnownType.System_Attribute, diagnostics));
private SynthesizedEmbeddedNullableAttributeSymbol CreateNullableAttributeSymbol(string name, NamespaceSymbol containingNamespace, BindingDiagnosticBag diagnostics)
=> new SynthesizedEmbeddedNullableAttributeSymbol(
name,
containingNamespace,
SourceModule,
GetWellKnownType(WellKnownType.System_Attribute, diagnostics),
GetSpecialType(SpecialType.System_Byte, diagnostics));
private SynthesizedEmbeddedNullableContextAttributeSymbol CreateNullableContextAttributeSymbol(string name, NamespaceSymbol containingNamespace, BindingDiagnosticBag diagnostics)
=> new SynthesizedEmbeddedNullableContextAttributeSymbol(
name,
containingNamespace,
SourceModule,
GetWellKnownType(WellKnownType.System_Attribute, diagnostics),
GetSpecialType(SpecialType.System_Byte, diagnostics));
private SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol CreateNullablePublicOnlyAttributeSymbol(string name, NamespaceSymbol containingNamespace, BindingDiagnosticBag diagnostics)
=> new SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol(
name,
containingNamespace,
SourceModule,
GetWellKnownType(WellKnownType.System_Attribute, diagnostics),
GetSpecialType(SpecialType.System_Boolean, diagnostics));
private SynthesizedEmbeddedNativeIntegerAttributeSymbol CreateNativeIntegerAttributeSymbol(string name, NamespaceSymbol containingNamespace, BindingDiagnosticBag diagnostics)
=> new SynthesizedEmbeddedNativeIntegerAttributeSymbol(
name,
containingNamespace,
SourceModule,
GetWellKnownType(WellKnownType.System_Attribute, diagnostics),
GetSpecialType(SpecialType.System_Boolean, diagnostics));
private void CreateAttributeIfNeeded<T>(
ref T symbol,
BindingDiagnosticBag diagnostics,
AttributeDescription description,
Func<string, NamespaceSymbol, BindingDiagnosticBag, T> factory)
where T : SynthesizedEmbeddedAttributeSymbolBase
{
if (symbol is null)
{
AddDiagnosticsForExistingAttribute(description, diagnostics);
var containingNamespace = GetOrSynthesizeNamespace(description.Namespace);
symbol = factory(description.Name, containingNamespace, diagnostics);
Debug.Assert(symbol.Constructors.Length == description.Signatures.Length);
if (symbol.GetAttributeUsageInfo() != AttributeUsageInfo.Default)
{
EnsureAttributeUsageAttributeMembersAvailable(diagnostics);
}
AddSynthesizedDefinition(containingNamespace, symbol);
}
}
private void AddDiagnosticsForExistingAttribute(AttributeDescription description, BindingDiagnosticBag diagnostics)
{
var attributeMetadataName = MetadataTypeName.FromFullName(description.FullName);
var userDefinedAttribute = _sourceAssembly.SourceModule.LookupTopLevelMetadataType(ref attributeMetadataName);
Debug.Assert((object)userDefinedAttribute.ContainingModule == _sourceAssembly.SourceModule);
if (!(userDefinedAttribute is MissingMetadataTypeSymbol))
{
diagnostics.Add(ErrorCode.ERR_TypeReserved, userDefinedAttribute.Locations[0], description.FullName);
}
}
private NamespaceSymbol GetOrSynthesizeNamespace(string namespaceFullName)
{
var result = SourceModule.GlobalNamespace;
foreach (var partName in namespaceFullName.Split('.'))
{
var subnamespace = (NamespaceSymbol)result.GetMembers(partName).FirstOrDefault(m => m.Kind == SymbolKind.Namespace);
if (subnamespace == null)
{
subnamespace = new SynthesizedNamespaceSymbol(result, partName);
AddSynthesizedDefinition(result, subnamespace);
}
result = subnamespace;
}
return result;
}
private NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics)
{
var result = _sourceAssembly.DeclaringCompilation.GetWellKnownType(type);
Binder.ReportUseSite(result, diagnostics, Location.None);
return result;
}
private NamedTypeSymbol GetSpecialType(SpecialType type, BindingDiagnosticBag diagnostics)
{
var result = _sourceAssembly.DeclaringCompilation.GetSpecialType(type);
Binder.ReportUseSite(result, diagnostics, Location.None);
return result;
}
private void EnsureAttributeUsageAttributeMembersAvailable(BindingDiagnosticBag diagnostics)
{
var compilation = _sourceAssembly.DeclaringCompilation;
Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__ctor, diagnostics, Location.None);
Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, diagnostics, Location.None);
Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__Inherited, diagnostics, Location.None);
}
}
internal sealed class PEAssemblyBuilder : PEAssemblyBuilderBase
{
public PEAssemblyBuilder(
SourceAssemblySymbol sourceAssembly,
EmitOptions emitOptions,
OutputKind outputKind,
Cci.ModulePropertiesForSerialization serializationProperties,
IEnumerable<ResourceDescription> manifestResources)
: base(sourceAssembly, emitOptions, outputKind, serializationProperties, manifestResources, ImmutableArray<NamedTypeSymbol>.Empty)
{
}
public override int CurrentGenerationOrdinal => 0;
}
}
| 45.745098 | 197 | 0.632447 | [
"MIT"
] | Acidburn0zzz/roslyn | src/Compilers/CSharp/Portable/Emitter/Model/PEAssemblyBuilder.cs | 23,332 | C# |
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Management.SiteRecovery.Models;
namespace Microsoft.WindowsAzure.Management.SiteRecovery.Models
{
/// <summary>
/// The response structure for the Network Operations List operation.
/// </summary>
public partial class AzureNetworkListResponse : AzureOperationResponse, IEnumerable<AzureNetworkListResponse.VirtualNetworkSite>
{
private IList<AzureNetworkListResponse.VirtualNetworkSite> _virtualNetworkSites;
/// <summary>
/// Optional.
/// </summary>
public IList<AzureNetworkListResponse.VirtualNetworkSite> VirtualNetworkSites
{
get { return this._virtualNetworkSites; }
set { this._virtualNetworkSites = value; }
}
/// <summary>
/// Initializes a new instance of the AzureNetworkListResponse class.
/// </summary>
public AzureNetworkListResponse()
{
this.VirtualNetworkSites = new LazyList<AzureNetworkListResponse.VirtualNetworkSite>();
}
/// <summary>
/// Gets the sequence of VirtualNetworkSites.
/// </summary>
public IEnumerator<AzureNetworkListResponse.VirtualNetworkSite> GetEnumerator()
{
return this.VirtualNetworkSites.GetEnumerator();
}
/// <summary>
/// Gets the sequence of VirtualNetworkSites.
/// </summary>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
public partial class AddressSpace
{
private IList<string> _addressPrefixes;
/// <summary>
/// Optional. Address spaces, in CIDR format in the virtual network.
/// </summary>
public IList<string> AddressPrefixes
{
get { return this._addressPrefixes; }
set { this._addressPrefixes = value; }
}
/// <summary>
/// Initializes a new instance of the AddressSpace class.
/// </summary>
public AddressSpace()
{
this.AddressPrefixes = new LazyList<string>();
}
}
/// <summary>
/// Specifies the type of connection of the local network site. The
/// value of this element can be either IPsec or Dedicated. The
/// default value is IPsec.
/// </summary>
public partial class Connection
{
private LocalNetworkConnectionType _type;
/// <summary>
/// Optional.
/// </summary>
public LocalNetworkConnectionType Type
{
get { return this._type; }
set { this._type = value; }
}
/// <summary>
/// Initializes a new instance of the Connection class.
/// </summary>
public Connection()
{
}
}
public partial class DnsServer
{
private string _address;
/// <summary>
/// Optional. The IPv4 address of the DNS server.
/// </summary>
public string Address
{
get { return this._address; }
set { this._address = value; }
}
private string _name;
/// <summary>
/// Optional. The name of the DNS server.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
/// <summary>
/// Initializes a new instance of the DnsServer class.
/// </summary>
public DnsServer()
{
}
}
/// <summary>
/// Contains gateway references to the local network sites that the
/// virtual network can connect to.
/// </summary>
public partial class Gateway
{
private GatewayProfile _profile;
/// <summary>
/// Optional. The gateway connection size.
/// </summary>
public GatewayProfile Profile
{
get { return this._profile; }
set { this._profile = value; }
}
private IList<AzureNetworkListResponse.LocalNetworkSite> _sites;
/// <summary>
/// Optional. The list of local network sites that the virtual
/// network can connect to.
/// </summary>
public IList<AzureNetworkListResponse.LocalNetworkSite> Sites
{
get { return this._sites; }
set { this._sites = value; }
}
private AzureNetworkListResponse.VPNClientAddressPool _vPNClientAddressPool;
/// <summary>
/// Optional. The VPN Client Address Pool reserves a pool of IP
/// addresses for VPN clients. This object is used for
/// point-to-site connectivity.
/// </summary>
public AzureNetworkListResponse.VPNClientAddressPool VPNClientAddressPool
{
get { return this._vPNClientAddressPool; }
set { this._vPNClientAddressPool = value; }
}
/// <summary>
/// Initializes a new instance of the Gateway class.
/// </summary>
public Gateway()
{
this.Sites = new LazyList<AzureNetworkListResponse.LocalNetworkSite>();
}
}
/// <summary>
/// Contains the list of parameters defining the local network site.
/// </summary>
public partial class LocalNetworkSite
{
private AzureNetworkListResponse.AddressSpace _addressSpace;
/// <summary>
/// Optional. The address space of the local network site.
/// </summary>
public AzureNetworkListResponse.AddressSpace AddressSpace
{
get { return this._addressSpace; }
set { this._addressSpace = value; }
}
private IList<AzureNetworkListResponse.Connection> _connections;
/// <summary>
/// Optional. Specifies the types of connections to the local
/// network site.
/// </summary>
public IList<AzureNetworkListResponse.Connection> Connections
{
get { return this._connections; }
set { this._connections = value; }
}
private string _name;
/// <summary>
/// Optional. The name of the local network site.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private string _vpnGatewayAddress;
/// <summary>
/// Optional. The IPv4 address of the local network site.
/// </summary>
public string VpnGatewayAddress
{
get { return this._vpnGatewayAddress; }
set { this._vpnGatewayAddress = value; }
}
/// <summary>
/// Initializes a new instance of the LocalNetworkSite class.
/// </summary>
public LocalNetworkSite()
{
this.Connections = new LazyList<AzureNetworkListResponse.Connection>();
}
}
public partial class Subnet
{
private string _addressPrefix;
/// <summary>
/// Optional. Represents an address space, in CIDR format that
/// defines the subnet.
/// </summary>
public string AddressPrefix
{
get { return this._addressPrefix; }
set { this._addressPrefix = value; }
}
private string _name;
/// <summary>
/// Optional. Name of the subnet.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private string _networkSecurityGroup;
/// <summary>
/// Optional. Name of Network Security Group associated with this
/// subnet.
/// </summary>
public string NetworkSecurityGroup
{
get { return this._networkSecurityGroup; }
set { this._networkSecurityGroup = value; }
}
/// <summary>
/// Initializes a new instance of the Subnet class.
/// </summary>
public Subnet()
{
}
}
/// <summary>
/// Contains the collections of parameters used to configure a virtual
/// network space that is dedicated to your subscription without
/// overlapping with other networks
/// </summary>
public partial class VirtualNetworkSite
{
private AzureNetworkListResponse.AddressSpace _addressSpace;
/// <summary>
/// Optional. The list of network address spaces for a virtual
/// network site. This represents the overall network space
/// contained within the virtual network site.
/// </summary>
public AzureNetworkListResponse.AddressSpace AddressSpace
{
get { return this._addressSpace; }
set { this._addressSpace = value; }
}
private string _affinityGroup;
/// <summary>
/// Optional. An affinity group, which indirectly refers to the
/// location where the virtual network exists.
/// </summary>
public string AffinityGroup
{
get { return this._affinityGroup; }
set { this._affinityGroup = value; }
}
private IList<AzureNetworkListResponse.DnsServer> _dnsServers;
/// <summary>
/// Optional. The list of available DNS Servers associated with the
/// virtual network site.
/// </summary>
public IList<AzureNetworkListResponse.DnsServer> DnsServers
{
get { return this._dnsServers; }
set { this._dnsServers = value; }
}
private AzureNetworkListResponse.Gateway _gateway;
/// <summary>
/// Optional. The gateway that contains a list of Local Network
/// Sites which enable the Virtual Network Site to communicate
/// with a customer's on-premise networks.
/// </summary>
public AzureNetworkListResponse.Gateway Gateway
{
get { return this._gateway; }
set { this._gateway = value; }
}
private string _id;
/// <summary>
/// Optional. A unique string identifier that represents the
/// virtual network site.
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
private string _label;
/// <summary>
/// Optional. The friendly identifier for the site.
/// </summary>
public string Label
{
get { return this._label; }
set { this._label = value; }
}
private string _location;
/// <summary>
/// Optional. Gets or sets the virtual network location.
/// </summary>
public string Location
{
get { return this._location; }
set { this._location = value; }
}
private string _name;
/// <summary>
/// Optional. Name of the virtual network site.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private string _state;
/// <summary>
/// Optional. Current status of the virtual network. (Created,
/// Creating, Updating, Deleting, or Unavailable.)
/// </summary>
public string State
{
get { return this._state; }
set { this._state = value; }
}
private IList<AzureNetworkListResponse.Subnet> _subnets;
/// <summary>
/// Optional. The list of network subnets for a virtual network
/// site. All network subnets must be contained within the overall
/// virtual network address spaces.
/// </summary>
public IList<AzureNetworkListResponse.Subnet> Subnets
{
get { return this._subnets; }
set { this._subnets = value; }
}
/// <summary>
/// Initializes a new instance of the VirtualNetworkSite class.
/// </summary>
public VirtualNetworkSite()
{
this.DnsServers = new LazyList<AzureNetworkListResponse.DnsServer>();
this.Subnets = new LazyList<AzureNetworkListResponse.Subnet>();
}
}
/// <summary>
/// The VPN Client Address Pool reserves a pool of IP addresses for VPN
/// clients. This object is used for point-to-site connectivity.
/// </summary>
public partial class VPNClientAddressPool
{
private IList<string> _addressPrefixes;
/// <summary>
/// Optional. The CIDR identifiers that identify addresses in the
/// pool.
/// </summary>
public IList<string> AddressPrefixes
{
get { return this._addressPrefixes; }
set { this._addressPrefixes = value; }
}
/// <summary>
/// Initializes a new instance of the VPNClientAddressPool class.
/// </summary>
public VPNClientAddressPool()
{
this.AddressPrefixes = new LazyList<string>();
}
}
}
}
| 34.286624 | 132 | 0.503313 | [
"Apache-2.0"
] | CerebralMischief/azure-sdk-for-net | src/ServiceManagement/SiteRecovery/SiteRecoveryManagement/Generated/Models/AzureNetworkListResponse.cs | 16,149 | C# |
namespace HRtoVRChat_OSC
{
public static class ParamsManager
{
public static List<HRParameter> Parameters = new List<HRParameter>();
public static void InitParams()
{
Parameters.Add(new IntParameter(hro => hro.ones, ConfigManager.LoadedConfig.ParameterNames["onesHR"]));
Parameters.Add(new IntParameter(hro => hro.tens, ConfigManager.LoadedConfig.ParameterNames["tensHR"]));
Parameters.Add(new IntParameter(hro => hro.hundreds, ConfigManager.LoadedConfig.ParameterNames["hundredsHR"]));
Parameters.Add(new IntParameter((hro) =>
{
string HRstring = $"{hro.hundreds}{hro.tens}{hro.ones}";
int HR = 0;
try
{
HR = Convert.ToInt32(HRstring);
}
catch (Exception)
{
}
if (HR > 255)
HR = 255;
if (HR < 0)
HR = 0;
return HR;
}, ConfigManager.LoadedConfig.ParameterNames["HR"]));
Parameters.Add(new FloatParameter((hro) =>
{
float targetFloat = 0f;
float maxhr = (float) ConfigManager.LoadedConfig.MaxHR;
float minhr = (float) ConfigManager.LoadedConfig.MinHR;
float HR = (float) hro.HR;
if (HR > maxhr)
targetFloat = 1;
else if (HR < minhr)
targetFloat = 0;
else
targetFloat = (HR - minhr) / (maxhr - minhr);
return targetFloat;
}, ConfigManager.LoadedConfig.ParameterNames["HRPercent"]));
Parameters.Add(new BoolParameter(hro => hro.isActive, ConfigManager.LoadedConfig.ParameterNames["isHRActive"]));
Parameters.Add(new BoolParameter(hro => hro.isConnected, ConfigManager.LoadedConfig.ParameterNames["isHRConnected"]));
Parameters.Add(new BoolParameter(BoolCheckType.HeartBeat, ConfigManager.LoadedConfig.ParameterNames["isHRBeat"]));
}
public static void ResetParams()
{
int paramcount = Parameters.Count;
foreach (HRParameter hrParameter in Parameters)
hrParameter.UpdateParameter(true);
Parameters.Clear();
LogHelper.Debug($"Cleared {paramcount} parameters!");
}
public class IntParameter : HRParameter
{
public IntParameter(Func<HROutput, int> getVal, string parameterName)
{
ParameterName = parameterName;
LogHelper.Debug($"IntParameter with ParameterName: {parameterName}, has been created!");
Program.OnHRValuesUpdated += (ones, tens, hundreds, HR, isConnected, isActive) =>
{
HROutput hro = new HROutput()
{
ones = ones,
tens = tens,
hundreds = hundreds,
isConnected = isConnected
};
int valueToSet = getVal.Invoke(hro);
ParamValue = valueToSet.ToString();
UpdateParameter();
};
}
public string ParameterName { get; set; }
public string ParamValue { get; set; }
public string DefaultValue => "0";
public void UpdateParameter(bool fromReset = false)
{
string val = ParamValue;
if (fromReset)
val = DefaultValue;
OSCManager.SendMessage("/avatar/parameters/" + ParameterName, Convert.ToInt32(val));
}
}
public class BoolParameter : HRParameter
{
public BoolParameter(Func<HROutput, bool> getVal, string parameterName)
{
ParameterName = parameterName;
LogHelper.Debug($"BoolParameter with ParameterName: {parameterName}, has been created!");
Program.OnHRValuesUpdated += (ones, tens, hundreds, HR, isConnected, isActive) =>
{
HROutput hro = new HROutput()
{
ones = ones,
tens = tens,
hundreds = hundreds,
HR = HR,
isConnected = isConnected,
isActive = isActive
};
bool valueToSet = getVal.Invoke(hro);
ParamValue = valueToSet.ToString();
UpdateParameter();
};
}
public BoolParameter(BoolCheckType bct, string parameterName)
{
ParameterName = parameterName;
LogHelper.Debug($"BoolParameter with ParameterName: {parameterName} and BoolCheckType of: {bct}, has been created!");
Program.OnHeartBeatUpdate += (isHeartBeat, shouldRestart) =>
{
switch (bct)
{
case BoolCheckType.HeartBeat:
ParamValue = isHeartBeat.ToString();
UpdateParameter();
break;
}
};
}
public string ParameterName { get; set; }
public string ParamValue { get; set; }
public string DefaultValue => "false";
public void UpdateParameter(bool fromReset = false)
{
string val = ParamValue;
if (fromReset)
val = DefaultValue;
OSCManager.SendMessage("/avatar/parameters/" + ParameterName, Convert.ToBoolean(val));
}
}
public class FloatParameter : HRParameter
{
public FloatParameter(Func<HROutput, float> getVal, string parameterName)
{
ParameterName = parameterName;
LogHelper.Debug($"FloatParameter with ParameterName: {parameterName} has been created!");
Program.OnHRValuesUpdated += (ones, tens, hundreds, HR, isConnected, isActive) =>
{
HROutput hro = new HROutput()
{
ones = ones,
tens = tens,
hundreds = hundreds,
HR = HR,
isConnected = isConnected,
isActive = isActive
};
float targetValue = getVal.Invoke(hro);
ParamValue = targetValue.ToString();
UpdateParameter();
};
}
public string ParameterName { get; set; }
public string ParamValue { get; set; }
public string DefaultValue => "0";
public void UpdateParameter(bool fromReset = false)
{
string val = ParamValue;
if (fromReset)
val = DefaultValue;
OSCManager.SendMessage("/avatar/parameters/" + ParameterName, (float) Convert.ToDouble(val));
}
}
public class HROutput
{
public int ones;
public int tens;
public int hundreds;
public int HR;
public bool isConnected;
public bool isActive;
}
public interface HRParameter
{
public string ParameterName { get; set; }
public string ParamValue { get; set; }
public string DefaultValue { get; }
public void UpdateParameter(bool fromReset = false);
}
public enum BoolCheckType
{
HeartBeat
}
}
} | 40.825 | 134 | 0.48071 | [
"MIT"
] | 200Tigersbloxed/HRtoVRChat_OSC | HRtoVRChat_OSC/ParamsManager.cs | 8,167 | C# |
// Copyright 2021-2022 The SeedV Lab.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using SeedLang.Common;
namespace SeedLang.Ast {
// The base class of all AST nodes.
internal abstract class AstNode {
// The source code range of this AST node. It could be BlockRange or TextRange.
public Range Range { get; }
internal AstNode(Range range) {
Range = range;
}
// Creates the string representation of the AST node.
public override string ToString() {
return AstStringBuilder.AstToString(this);
}
}
}
| 32.121212 | 83 | 0.715094 | [
"Apache-2.0"
] | aha-001/SeedLang | csharp/src/SeedLang/Ast/AstNode.cs | 1,060 | C# |
using GoogleMapsApiExample.Common.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GoogleMapsApiExample.Models
{
public class HomeModel
{
public HomeModel()
{
Locations = new List<LocationDto>();
}
public IEnumerable<LocationDto> Locations { get; set; }
}
}
| 20 | 63 | 0.668421 | [
"MIT"
] | divayo/google-maps-api-example | GoogleMapsApiExample/Models/HomeModel.cs | 382 | C# |
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
// 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("AWSSDK.Snowball")]
#if BCL35
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#elif BCL45
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (4.5) - Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#elif PCL
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (PCL) - Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#elif UNITY
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (Unity) - Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#elif NETSTANDARD13
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 1.3)- Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#elif NETSTANDARD20
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 2.0)- Amazon Import/Export Snowball. Amazon Snowball is a petabyte-scale data transport solution that uses secure appliances to transfer large amounts of data into and out of the AWS cloud")]
#else
#error Unknown platform constant - unable to set correct AssemblyDescription
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright 2009-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[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)]
// 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("3.3")]
[assembly: AssemblyFileVersion("3.3.101.41")]
#if WINDOWS_PHONE || UNITY
[assembly: System.CLSCompliant(false)]
# else
[assembly: System.CLSCompliant(true)]
#endif
#if BCL
[assembly: System.Security.AllowPartiallyTrustedCallers]
#endif | 55.864407 | 273 | 0.77943 | [
"Apache-2.0"
] | tmlife485/myawskendra | sdk/src/Services/Snowball/Properties/AssemblyInfo.cs | 3,296 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma warning disable 1591
using System;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using FASTER.core;
namespace FASTER.multibench
{
public struct Functions : IFunctions<Key, Value, Input, Output, Empty>
{
public void RMWCompletionCallback(ref Key key, ref Input input, Empty ctx, Status status)
{
}
public void ReadCompletionCallback(ref Key key, ref Input input, ref Output output, Empty ctx, Status status)
{
}
public void UpsertCompletionCallback(ref Key key, ref Value value, Empty ctx)
{
}
public void DeleteCompletionCallback(ref Key key, Empty ctx)
{
}
public void CheckpointCompletionCallback(string sessionId, CommitPoint commitPoint)
{
Debug.WriteLine("Session {0} reports persistence until {1}", sessionId, commitPoint.UntilSerialNo);
}
// Read functions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SingleReader(ref Key key, ref Input input, ref Value value, ref Output dst)
{
dst.value = value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ConcurrentReader(ref Key key, ref Input input, ref Value value, ref Output dst)
{
dst.value = value;
}
// Upsert functions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SingleWriter(ref Key key, ref Value src, ref Value dst)
{
dst = src;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool ConcurrentWriter(ref Key key, ref Value src, ref Value dst)
{
dst = src;
return true;
}
// RMW functions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void InitialUpdater(ref Key key, ref Input input, ref Value value)
{
value.value = input.value;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InPlaceUpdater(ref Key key, ref Input input, ref Value value)
{
value.value += input.value;
return true;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void CopyUpdater(ref Key key, ref Input input, ref Value oldValue, ref Value newValue)
{
newValue.value = input.value + oldValue.value;
}
}
}
| 30.690476 | 117 | 0.629946 | [
"MIT"
] | yangzheng2115/demofaster | cs/multibench/Functions.cs | 2,580 | C# |
using System;
using Aop.Api.Domain;
using System.Collections.Generic;
using Aop.Api.Response;
namespace Aop.Api.Request
{
/// <summary>
/// AOP API: alipay.open.public.default.extension.create
/// </summary>
public class AlipayOpenPublicDefaultExtensionCreateRequest : IAopRequest<AlipayOpenPublicDefaultExtensionCreateResponse>
{
/// <summary>
/// 默认扩展区创建接口
/// </summary>
public string BizContent { get; set; }
#region IAopRequest Members
private bool needEncrypt=false;
private string apiVersion = "1.0";
private string terminalType;
private string terminalInfo;
private string prodCode;
private string notifyUrl;
private string returnUrl;
private AopObject bizModel;
public void SetNeedEncrypt(bool needEncrypt){
this.needEncrypt=needEncrypt;
}
public bool GetNeedEncrypt(){
return this.needEncrypt;
}
public void SetNotifyUrl(string notifyUrl){
this.notifyUrl = notifyUrl;
}
public string GetNotifyUrl(){
return this.notifyUrl;
}
public void SetReturnUrl(string returnUrl){
this.returnUrl = returnUrl;
}
public string GetReturnUrl(){
return this.returnUrl;
}
public void SetTerminalType(String terminalType){
this.terminalType=terminalType;
}
public string GetTerminalType(){
return this.terminalType;
}
public void SetTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public string GetTerminalInfo(){
return this.terminalInfo;
}
public void SetProdCode(String prodCode){
this.prodCode=prodCode;
}
public string GetProdCode(){
return this.prodCode;
}
public string GetApiName()
{
return "alipay.open.public.default.extension.create";
}
public void SetApiVersion(string apiVersion){
this.apiVersion=apiVersion;
}
public string GetApiVersion(){
return this.apiVersion;
}
public IDictionary<string, string> GetParameters()
{
AopDictionary parameters = new AopDictionary();
parameters.Add("biz_content", this.BizContent);
return parameters;
}
public AopObject GetBizModel()
{
return this.bizModel;
}
public void SetBizModel(AopObject bizModel)
{
this.bizModel = bizModel;
}
#endregion
}
}
| 23.909091 | 124 | 0.610266 | [
"MIT"
] | BJDIIL/DiiL | Sdk/AlipaySdk/Request/AlipayOpenPublicDefaultExtensionCreateRequest.cs | 2,648 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace OpenMPCompiler
{
class Program
{
static void Main(string[] args)
{
string fileName = args[1].Substring(1);
StreamReader reader = new StreamReader(fileName);
string str = reader.ReadToEnd();
reader.Close();
List<string> result = new List<string>();
string solutionPath = string.Empty;
try
{
solutionPath = Directory.GetParent(Directory.GetCurrentDirectory()).ToString();
string solutionFile = System.IO.Directory.GetFiles(solutionPath, "*.sln")[0];
CodeProcessor codeProcessor = new CodeProcessor();
result = codeProcessor.ProcessSolution(Directory.GetCurrentDirectory().ToString(), solutionFile).Result;
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
str = ReplaceFileNamesFromCommand(str, result);
StreamWriter writer = new StreamWriter(fileName);
writer.AutoFlush = true;
writer.WriteLine(str);
writer.Close();
// TODO: figure out how to configure this path to compiler
var p = Process.Start(@"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Roslyn\csc.exe",
string.Join(" ", args));
p.WaitForExit();
var filesToDelete = Directory.GetFiles(solutionPath, "*.cs", SearchOption.AllDirectories).Where(f => f.Contains("_tmp_generated_doc"));
foreach(var file in filesToDelete)
{
File.Delete(file);
}
}
private static string ReplaceFileNamesFromCommand(string command, List<string> namesToReplace)
{
string[] args = command.Split(' ');
int startIndex = 0;
int endIndex = 0;
for (int i = 0, n = args.Length; i < n; i++)
{
if(args[i] == "/utf8output")
{
startIndex = i + 1;
}
if(args[i].StartsWith("\""))
{
endIndex = i;
}
}
for(int i = startIndex; i < endIndex; i++)
{
if (namesToReplace.Contains(args[i]))
{
args[i] = args[i].Substring(0, args[i].Length - 3) + "_tmp_generated_doc.cs";
}
}
return string.Join(" ", args);
}
}
}
| 32.223529 | 147 | 0.515517 | [
"Apache-2.0"
] | NamiraJV/OmpForDotNet.Compiler | OpenMPCompiler/OpenMPCompiler/Program.cs | 2,741 | C# |
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("EntityFramework DevData")]
[assembly: AssemblyDescription("Internal QP8 EntityFramework DevData")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Quantum Art")]
[assembly: AssemblyProduct("QP8.Framework")]
[assembly: AssemblyCopyright("Copyright © 2007-2017 Quantum Art")]
[assembly: ComVisible(false)]
[assembly: Guid("34924e69-c290-4359-82a5-0a07b9ade463")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
| 35.125 | 71 | 0.782918 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | QuantumArt/QP.EntityFramework | EntityFramework6.DevData/Properties/AssemblyInfo.cs | 563 | C# |
using System;
using System.Linq;
namespace FluentErgast.F1.Mappers.ConstructorStandings
{
public class StandingsListMapper : IMapper<InternalDtos.ConstructorStandings.StandingsList, Dtos.ConstructorStandings.StandingsList>
{
private readonly IMapper<InternalDtos.ConstructorStandings.ConstructorStanding, Dtos.ConstructorStandings.ConstructorStanding> constructorStandingMapper;
public StandingsListMapper(IMapper<InternalDtos.ConstructorStandings.ConstructorStanding, Dtos.ConstructorStandings.ConstructorStanding> constructorStandingMapper)
{
this.constructorStandingMapper = constructorStandingMapper;
}
public Dtos.ConstructorStandings.StandingsList Map(InternalDtos.ConstructorStandings.StandingsList input)
{
if (input == null)
{
return null;
}
return new Dtos.ConstructorStandings.StandingsList
{
Season = Convert.ToInt32(input.Season),
Round = Convert.ToInt32(input.Round),
ConstructorStandings = input.ConstructorStandings.Select(this.constructorStandingMapper.Map).ToArray()
};
}
}
} | 40.433333 | 171 | 0.70404 | [
"MIT"
] | lewishenson/FluentErgast | FluentErgast/F1/Mappers/ConstructorStandings/StandingsListMapper.cs | 1,213 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18052
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace oskz.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("oskz.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
| 43.296875 | 170 | 0.611332 | [
"Apache-2.0"
] | katopz/oskz-vcsharp | oskz/Properties/Resources.Designer.cs | 2,773 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// <Area> Nullable - CastClass </Area>
// <Title> Nullable type with castclass expr </Title>
// <Description>
// checking type of NotEmptyStructQA using cast expr
// </Description>
// <RelatedBugs> </RelatedBugs>
//<Expects Status=success></Expects>
// <Code>
using System.Runtime.InteropServices;
using System;
internal class NullableTest
{
private static bool BoxUnboxToNQGen<T>(T o)
{
return ((ValueType)(object)o) == null;
}
private static bool BoxUnboxToQGen<T>(T? o) where T : struct
{
return ((T?)(object)(ValueType)o) == null;
}
private static bool BoxUnboxToNQ(object o)
{
return ((ValueType)o) == null;
}
private static bool BoxUnboxToQ(object o)
{
return ((NotEmptyStructQA?)(ValueType)o) == null;
}
private static int Main()
{
NotEmptyStructQA? s = null;
if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
return ExitCode.Passed;
else
return ExitCode.Failed;
}
}
| 24.365385 | 89 | 0.640095 | [
"MIT"
] | 06needhamt/runtime | src/coreclr/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs | 1,267 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AE.Net.Mail {
public class ImapClientExceptionEventArgs : EventArgs
{
public ImapClientExceptionEventArgs(Exception Exception) {
this.Exception = Exception;
}
public Exception Exception { get; set; }
}
}
| 20.8125 | 61 | 0.720721 | [
"MIT"
] | zehavibarak/aenetmail | ImapClientExceptionEventArgs.cs | 335 | C# |
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace DotNetCore.EntityFrameworkCore;
public static class Extensions
{
public static void AddContext<T>(this IServiceCollection services, Action<DbContextOptionsBuilder> options) where T : DbContext
{
services.AddDbContextPool<T>(options);
services.BuildServiceProvider().GetRequiredService<T>().Database.Migrate();
services.AddScoped<IUnitOfWork, UnitOfWork<T>>();
}
public static void AddContextMemory<T>(this IServiceCollection services) where T : DbContext
{
services.AddDbContextPool<T>(options => options.UseInMemoryDatabase(typeof(T).Name));
services.BuildServiceProvider().GetRequiredService<T>().Database.EnsureCreated();
services.AddScoped<IUnitOfWork, UnitOfWork<T>>();
}
public static DbSet<T> CommandSet<T>(this DbContext context) where T : class
{
return context.DetectChangesLazyLoading(true).Set<T>();
}
public static DbContext DetectChangesLazyLoading(this DbContext context, bool enabled)
{
context.ChangeTracker.AutoDetectChangesEnabled = enabled;
context.ChangeTracker.LazyLoadingEnabled = enabled;
context.ChangeTracker.QueryTrackingBehavior = enabled ? QueryTrackingBehavior.TrackAll : QueryTrackingBehavior.NoTracking;
return context;
}
public static IQueryable<T> QuerySet<T>(this DbContext context) where T : class
{
return context.DetectChangesLazyLoading(false).Set<T>().AsNoTracking();
}
public static object[] PrimaryKeyValues<T>(this DbContext context, object entity)
{
return context.Model
.FindEntityType(typeof(T))
.FindPrimaryKey()
.Properties
.Select(property => entity.GetType().GetProperty(property.Name)?.GetValue(entity, default))
.ToArray();
}
}
| 33.77193 | 131 | 0.708052 | [
"MIT"
] | fabricepeltier/DotNetCore_CR_Examples | source/EntityFrameworkCore/Extensions.cs | 1,925 | C# |
using AutoMapper;
using CarDealer.Dtos.Import;
using CarDealer.Dtos.Export;
using CarDealer.Models;
using System.Linq;
namespace CarDealer
{
public class CarDealerProfile : Profile
{
public CarDealerProfile()
{
this.CreateMap<ImportSupplierDto, Supplier>();
this.CreateMap<ImportPartDto, Part>();
this.CreateMap<ImportCarDto, Car>();
this.CreateMap<ImportCustomerDto, Customer>();
this.CreateMap<ImportSaleDto, Sale>();
this.CreateMap<Car, ExportCarsWithDistanceDto>();
this.CreateMap<Part, ExportCarPartDto>();
this.CreateMap<Car, ExportCarDto>()
.ForMember(x => x.Parts, y => y.MapFrom(x => x.PartCars.Select(pc => pc.Part)));
this.CreateMap<Supplier, ExportLocalSuppliersDto>();
// If additional mapping is needed
//.ForMember(x => x.PartsCount, y => y.MapFrom(x => x.Parts.Count));
}
}
}
| 28.371429 | 96 | 0.60423 | [
"MIT"
] | danailstratiev/Csharp-SoftUni-Development | Entity Framework Core/09.Xml Processing/CarDealer/CarDealer/CarDealerProfile.cs | 995 | C# |
#region License
// Copyright (c) 2007 James Newton-King
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
using System;
using System.Collections.Generic;
using System.ComponentModel;
#if DNXCORE50
using Xunit;
using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
using Newtonsoft.Json.Linq;
#if NET20
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
namespace Newtonsoft.Json.Tests.Linq
{
[TestFixture]
public class JArrayTests : TestFixtureBase
{
[Test]
public void RemoveSpecificAndRemoveSelf()
{
JObject o = new JObject
{
{ "results", new JArray(1, 2, 3, 4) }
};
JArray a = (JArray)o["results"];
var last = a.Last();
Assert.IsTrue(a.Remove(last));
last = a.Last();
last.Remove();
Assert.AreEqual(2, a.Count);
}
[Test]
public void Clear()
{
JArray a = new JArray { 1 };
Assert.AreEqual(1, a.Count);
a.Clear();
Assert.AreEqual(0, a.Count);
}
[Test]
public void AddToSelf()
{
JArray a = new JArray();
a.Add(a);
Assert.IsFalse(ReferenceEquals(a[0], a));
}
[Test]
public void Contains()
{
JValue v = new JValue(1);
JArray a = new JArray { v };
Assert.AreEqual(false, a.Contains(new JValue(2)));
Assert.AreEqual(false, a.Contains(new JValue(1)));
Assert.AreEqual(false, a.Contains(null));
Assert.AreEqual(true, a.Contains(v));
}
[Test]
public void GenericCollectionCopyTo()
{
JArray j = new JArray();
j.Add(new JValue(1));
j.Add(new JValue(2));
j.Add(new JValue(3));
Assert.AreEqual(3, j.Count);
JToken[] a = new JToken[5];
((ICollection<JToken>)j).CopyTo(a, 1);
Assert.AreEqual(null, a[0]);
Assert.AreEqual(1, (int)a[1]);
Assert.AreEqual(2, (int)a[2]);
Assert.AreEqual(3, (int)a[3]);
Assert.AreEqual(null, a[4]);
}
[Test]
public void GenericCollectionCopyToNullArrayShouldThrow()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentNullException>(() => { ((ICollection<JToken>)j).CopyTo(null, 0); }, @"Value cannot be null.
Parameter name: array");
}
[Test]
public void GenericCollectionCopyToNegativeArrayIndexShouldThrow()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { ((ICollection<JToken>)j).CopyTo(new JToken[1], -1); }, @"arrayIndex is less than 0.
Parameter name: arrayIndex");
}
[Test]
public void GenericCollectionCopyToArrayIndexEqualGreaterToArrayLengthShouldThrow()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentException>(() => { ((ICollection<JToken>)j).CopyTo(new JToken[1], 1); }, @"arrayIndex is equal to or greater than the length of array.");
}
[Test]
public void GenericCollectionCopyToInsufficientArrayCapacity()
{
JArray j = new JArray();
j.Add(new JValue(1));
j.Add(new JValue(2));
j.Add(new JValue(3));
ExceptionAssert.Throws<ArgumentException>(() => { ((ICollection<JToken>)j).CopyTo(new JToken[3], 1); }, @"The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array.");
}
[Test]
public void Remove()
{
JValue v = new JValue(1);
JArray j = new JArray();
j.Add(v);
Assert.AreEqual(1, j.Count);
Assert.AreEqual(false, j.Remove(new JValue(1)));
Assert.AreEqual(false, j.Remove(null));
Assert.AreEqual(true, j.Remove(v));
Assert.AreEqual(false, j.Remove(v));
Assert.AreEqual(0, j.Count);
}
[Test]
public void IndexOf()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(1);
JValue v3 = new JValue(1);
JArray j = new JArray();
j.Add(v1);
Assert.AreEqual(0, j.IndexOf(v1));
j.Add(v2);
Assert.AreEqual(0, j.IndexOf(v1));
Assert.AreEqual(1, j.IndexOf(v2));
j.AddFirst(v3);
Assert.AreEqual(1, j.IndexOf(v1));
Assert.AreEqual(2, j.IndexOf(v2));
Assert.AreEqual(0, j.IndexOf(v3));
v3.Remove();
Assert.AreEqual(0, j.IndexOf(v1));
Assert.AreEqual(1, j.IndexOf(v2));
Assert.AreEqual(-1, j.IndexOf(v3));
}
[Test]
public void RemoveAt()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(1);
JValue v3 = new JValue(1);
JArray j = new JArray();
j.Add(v1);
j.Add(v2);
j.Add(v3);
Assert.AreEqual(true, j.Contains(v1));
j.RemoveAt(0);
Assert.AreEqual(false, j.Contains(v1));
Assert.AreEqual(true, j.Contains(v3));
j.RemoveAt(1);
Assert.AreEqual(false, j.Contains(v3));
Assert.AreEqual(1, j.Count);
}
[Test]
public void RemoveAtOutOfRangeIndexShouldError()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.RemoveAt(0); }, @"Index is equal to or greater than Count.
Parameter name: index");
}
[Test]
public void RemoveAtNegativeIndexShouldError()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.RemoveAt(-1); }, @"Index is less than 0.
Parameter name: index");
}
[Test]
public void Insert()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(2);
JValue v3 = new JValue(3);
JValue v4 = new JValue(4);
JArray j = new JArray();
j.Add(v1);
j.Add(v2);
j.Add(v3);
j.Insert(1, v4);
Assert.AreEqual(0, j.IndexOf(v1));
Assert.AreEqual(1, j.IndexOf(v4));
Assert.AreEqual(2, j.IndexOf(v2));
Assert.AreEqual(3, j.IndexOf(v3));
}
[Test]
public void AddFirstAddedTokenShouldBeFirst()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(2);
JValue v3 = new JValue(3);
JArray j = new JArray();
Assert.AreEqual(null, j.First);
Assert.AreEqual(null, j.Last);
j.AddFirst(v1);
Assert.AreEqual(v1, j.First);
Assert.AreEqual(v1, j.Last);
j.AddFirst(v2);
Assert.AreEqual(v2, j.First);
Assert.AreEqual(v1, j.Last);
j.AddFirst(v3);
Assert.AreEqual(v3, j.First);
Assert.AreEqual(v1, j.Last);
}
[Test]
public void InsertShouldInsertAtZeroIndex()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(2);
JArray j = new JArray();
j.Insert(0, v1);
Assert.AreEqual(0, j.IndexOf(v1));
j.Insert(0, v2);
Assert.AreEqual(1, j.IndexOf(v1));
Assert.AreEqual(0, j.IndexOf(v2));
}
[Test]
public void InsertNull()
{
JArray j = new JArray();
j.Insert(0, null);
Assert.AreEqual(null, ((JValue)j[0]).Value);
}
[Test]
public void InsertNegativeIndexShouldThrow()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.Insert(-1, new JValue(1)); }, @"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index");
}
[Test]
public void InsertOutOfRangeIndexShouldThrow()
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.Insert(2, new JValue(1)); }, @"Index must be within the bounds of the List.
Parameter name: index");
}
[Test]
public void Item()
{
JValue v1 = new JValue(1);
JValue v2 = new JValue(2);
JValue v3 = new JValue(3);
JValue v4 = new JValue(4);
JArray j = new JArray();
j.Add(v1);
j.Add(v2);
j.Add(v3);
j[1] = v4;
Assert.AreEqual(null, v2.Parent);
Assert.AreEqual(-1, j.IndexOf(v2));
Assert.AreEqual(j, v4.Parent);
Assert.AreEqual(1, j.IndexOf(v4));
}
[Test]
public void Parse_ShouldThrowOnUnexpectedToken()
{
string json = @"{""prop"":""value""}";
ExceptionAssert.Throws<JsonReaderException>(() => { JArray.Parse(json); }, "Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.");
}
public class ListItemFields
{
public string ListItemText { get; set; }
public object ListItemValue { get; set; }
}
[Test]
public void ArrayOrder()
{
string itemZeroText = "Zero text";
IEnumerable<ListItemFields> t = new List<ListItemFields>
{
new ListItemFields { ListItemText = "First", ListItemValue = 1 },
new ListItemFields { ListItemText = "Second", ListItemValue = 2 },
new ListItemFields { ListItemText = "Third", ListItemValue = 3 }
};
JObject optionValues =
new JObject(
new JProperty("options",
new JArray(
new JObject(
new JProperty("text", itemZeroText),
new JProperty("value", "0")),
from r in t
orderby r.ListItemValue
select new JObject(
new JProperty("text", r.ListItemText),
new JProperty("value", r.ListItemValue.ToString())))));
string result = "myOptions = " + optionValues.ToString();
StringAssert.AreEqual(@"myOptions = {
""options"": [
{
""text"": ""Zero text"",
""value"": ""0""
},
{
""text"": ""First"",
""value"": ""1""
},
{
""text"": ""Second"",
""value"": ""2""
},
{
""text"": ""Third"",
""value"": ""3""
}
]
}", result);
}
[Test]
public void Iterate()
{
JArray a = new JArray(1, 2, 3, 4, 5);
int i = 1;
foreach (JToken token in a)
{
Assert.AreEqual(i, (int)token);
i++;
}
}
#if !(PORTABLE || DNXCORE50 || PORTABLE40)
[Test]
public void ITypedListGetItemProperties()
{
JProperty p1 = new JProperty("Test1", 1);
JProperty p2 = new JProperty("Test2", "Two");
ITypedList a = new JArray(new JObject(p1, p2));
PropertyDescriptorCollection propertyDescriptors = a.GetItemProperties(null);
Assert.IsNotNull(propertyDescriptors);
Assert.AreEqual(2, propertyDescriptors.Count);
Assert.AreEqual("Test1", propertyDescriptors[0].Name);
Assert.AreEqual("Test2", propertyDescriptors[1].Name);
}
#endif
[Test]
public void AddArrayToSelf()
{
JArray a = new JArray(1, 2);
a.Add(a);
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreNotSame(a, a[2]);
}
[Test]
public void SetValueWithInvalidIndex()
{
ExceptionAssert.Throws<ArgumentException>(() =>
{
JArray a = new JArray();
a["badvalue"] = new JValue(3);
}, @"Set JArray values with invalid key value: ""badvalue"". Int32 array index expected.");
}
[Test]
public void SetValue()
{
object key = 0;
JArray a = new JArray((object)null);
a[key] = new JValue(3);
Assert.AreEqual(3, (int)a[key]);
}
[Test]
public void ReplaceAll()
{
JArray a = new JArray(new[] { 1, 2, 3 });
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(3, (int)a[2]);
a.ReplaceAll(1);
Assert.AreEqual(1, a.Count);
Assert.AreEqual(1, (int)a[0]);
}
[Test]
public void ParseIncomplete()
{
ExceptionAssert.Throws<JsonReaderException>(() => { JArray.Parse("[1"); }, "Unexpected end of content while loading JArray. Path '[0]', line 1, position 2.");
}
[Test]
public void InsertAddEnd()
{
JArray array = new JArray();
array.Insert(0, 123);
array.Insert(1, 456);
Assert.AreEqual(2, array.Count);
Assert.AreEqual(123, (int)array[0]);
Assert.AreEqual(456, (int)array[1]);
}
[Test]
public void ParseAdditionalContent()
{
string json = @"[
""Small"",
""Medium"",
""Large""
], 987987";
ExceptionAssert.Throws<JsonReaderException>(() => { JArray.Parse(json); }, "Additional text encountered after finished reading JSON content: ,. Path '', line 5, position 1.");
}
[Test]
public void ToListOnEmptyArray()
{
string json = @"{""decks"":[]}";
JArray decks = (JArray)JObject.Parse(json)["decks"];
IList<JToken> l = decks.ToList();
Assert.AreEqual(0, l.Count);
json = @"{""decks"":[1]}";
decks = (JArray)JObject.Parse(json)["decks"];
l = decks.ToList();
Assert.AreEqual(1, l.Count);
}
[Test]
public void Parse_NoComments()
{
string json = "[1,2/*comment*/,3]";
JArray a = JArray.Parse(json, new JsonLoadSettings());
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(3, (int)a[2]);
a = JArray.Parse(json, new JsonLoadSettings
{
CommentHandling = CommentHandling.Ignore
});
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(3, (int)a[2]);
a = JArray.Parse(json, new JsonLoadSettings
{
CommentHandling = CommentHandling.Load
});
Assert.AreEqual(4, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(JTokenType.Comment, a[2].Type);
Assert.AreEqual(3, (int)a[3]);
}
[Test]
public void Parse_ExcessiveContentJustComments()
{
string json = @"[1,2,3]/*comment*/
//Another comment.";
JArray a = JArray.Parse(json);
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(3, (int)a[2]);
}
[Test]
public void Parse_ExcessiveContent()
{
string json = @"[1,2,3]/*comment*/
//Another comment.
[]";
ExceptionAssert.Throws<JsonReaderException>(() => JArray.Parse(json),
"Additional text encountered after finished reading JSON content: [. Path '', line 3, position 0.");
}
[Test]
public void Parse_LineInfo()
{
string json = "[1,2,3]";
JArray a = JArray.Parse(json, new JsonLoadSettings());
Assert.AreEqual(true, ((IJsonLineInfo)a).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[0]).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[1]).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[2]).HasLineInfo());
a = JArray.Parse(json, new JsonLoadSettings
{
LineInfoHandling = LineInfoHandling.Ignore
});
Assert.AreEqual(false, ((IJsonLineInfo)a).HasLineInfo());
Assert.AreEqual(false, ((IJsonLineInfo)a[0]).HasLineInfo());
Assert.AreEqual(false, ((IJsonLineInfo)a[1]).HasLineInfo());
Assert.AreEqual(false, ((IJsonLineInfo)a[2]).HasLineInfo());
a = JArray.Parse(json, new JsonLoadSettings
{
LineInfoHandling = LineInfoHandling.Load
});
Assert.AreEqual(true, ((IJsonLineInfo)a).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[0]).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[1]).HasLineInfo());
Assert.AreEqual(true, ((IJsonLineInfo)a[2]).HasLineInfo());
}
}
} | 29.777953 | 254 | 0.522079 | [
"MIT"
] | Nucs/Alda | External Libraries/Clean-git/Newtonsoft.Json-master/Src/Newtonsoft.Json.Tests/Linq/JArrayTests.cs | 18,911 | C# |
using Abilities;
using ActionsList;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Upgrade;
using Ship;
using SubPhases;
using Tokens;
namespace UpgradesList
{
public class Opportunist : GenericUpgrade
{
public Opportunist() : base()
{
Types.Add(UpgradeType.Elite);
Name = "Opportunist";
Cost = 4;
UpgradeAbilities.Add(new OpportunistAbility());
}
}
}
namespace Abilities
{
public class OpportunistAbility : GenericAbility
{
public override void ActivateAbility()
{
HostShip.OnAttackStartAsAttacker += RegisterOpportunistAbility;
}
public override void DeactivateAbility()
{
HostShip.OnAttackStartAsAttacker -= RegisterOpportunistAbility;
}
public void RegisterOpportunistAbility()
{
Triggers.RegisterTrigger(
new Trigger()
{
Name = "Opportunist",
TriggerOwner = Combat.Attacker.Owner.PlayerNo,
TriggerType = TriggerTypes.OnAttackStart,
EventHandler = StartOpportunistDecisionSubPhase
}
);
}
private void StartOpportunistDecisionSubPhase(object sender, System.EventArgs e)
{
//card constraints say user can't have a stress token, and defender can't have focus or evade tokens
if(!Combat.Attacker.Tokens.HasToken(typeof(StressToken)) && (!Combat.Defender.Tokens.HasToken(typeof(FocusToken)) && !Combat.Defender.Tokens.HasToken(typeof(Tokens.EvadeToken))) )
{
var opportunistDecision = (OpportunistDecisionSubPhase)Phases.StartTemporarySubPhaseNew(
Name,
typeof(OpportunistDecisionSubPhase),
Triggers.FinishTrigger
);
opportunistDecision.InfoText = "Use Opportunist ability?";
opportunistDecision.AddDecision("Yes", UseOpportunistAbility);
opportunistDecision.AddDecision("No", DontUseOpportunistAbility);
opportunistDecision.DefaultDecisionName = "Yes";
opportunistDecision.Start();
}
else
{
Triggers.FinishTrigger();
}
}
private void UseOpportunistAbility(object sender, System.EventArgs e)
{
Combat.Attacker.Tokens.AssignToken(typeof(StressToken), AllowRollAdditionalDice);
}
private void AllowRollAdditionalDice()
{
Combat.Attacker.AfterGotNumberOfAttackDice += IncreaseByOne;
DecisionSubPhase.ConfirmDecision();
}
private void IncreaseByOne(ref int value)
{
value++;
Combat.Attacker.AfterGotNumberOfAttackDice -= IncreaseByOne;
}
private void DontUseOpportunistAbility(object sender, System.EventArgs e)
{
DecisionSubPhase.ConfirmDecision();
}
private class OpportunistDecisionSubPhase : DecisionSubPhase
{
public override void SkipButton()
{
ConfirmDecision();
}
}
}
} | 24.803738 | 182 | 0.740015 | [
"MIT"
] | MatthewBlanchard/FlyCasual | Assets/Scripts/Model/Upgrades/Elite/Opportunist.cs | 2,656 | C# |
namespace WebApi.Common.Constants
{
public enum RoleEnum
{
None = 0,
BasicUser = 1,
Employee = 2,
Trainer = 3,
Admin = 4,
}
}
| 14.916667 | 34 | 0.480447 | [
"MIT"
] | gartidas/Forehand | WebApi/Common/Constants/RoleEnum.cs | 181 | C# |
using IdentityServer4.Stores.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace CDR.DataHolder.IdentityServer.Extensions
{
public static class SerializationExtensions
{
public static string ToJson(this object value)
{
var jsonSerializerSettings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
DefaultValueHandling = DefaultValueHandling.Include,
NullValueHandling = NullValueHandling.Ignore,
Formatting = Formatting.Indented,
};
jsonSerializerSettings.Converters.Add(new ClaimConverter());
jsonSerializerSettings.Converters.Add(new ClaimsPrincipalConverter());
return JsonConvert.SerializeObject(value, jsonSerializerSettings);
}
}
}
| 35.346154 | 82 | 0.688792 | [
"MIT"
] | CDR-AmirM/mock-data-holder | Source/CDR.DataHolder.IdentityServer/Extensions/SerializationExtensions.cs | 921 | C# |
using System;
using System.Threading;
using System.Threading.Tasks;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Whyvra.Tunnel.Data;
namespace Whyvra.Tunnel.Core.Clients.Commands
{
public class RemoveAddressFromClientCommandHandler : IRequestHandler<RemoveAddressFromClientCommand>
{
private readonly ITunnelContext _context;
public RemoveAddressFromClientCommandHandler(ITunnelContext context)
{
_context = context;
}
public async Task<Unit> Handle(RemoveAddressFromClientCommand command, CancellationToken cancellationToken)
{
var clientAddress = await _context.ClientNetworkAddresses
.SingleOrDefaultAsync(x => x.ClientId == command.ClientId && x.NetworkAddressId == command.NetworkAddressId);
if (clientAddress == null)
{
throw new NullReferenceException($"A network address #{command.NetworkAddressId} on client #{command.ClientId} could not be found.");
}
_context.ClientNetworkAddresses.Remove(clientAddress);
await _context.SaveChangesAsync(cancellationToken);
return Unit.Value;
}
}
} | 34.514286 | 149 | 0.693709 | [
"MIT"
] | whyvra/tunnel | Whyvra.Tunnel.Core/Clients/Commands/RemoveAddressFromClientCommandHandler.cs | 1,208 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace KryptonButtonExamples.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KryptonButtonExamples.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
| 43.84375 | 187 | 0.61618 | [
"BSD-3-Clause"
] | BMBH/Krypton | Source/Krypton Toolkit Examples/KryptonButton Examples/Properties/Resources.Designer.cs | 2,808 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Xml;
using System.Xml.XPath;
using Microsoft.HealthVault.Exceptions;
using Microsoft.HealthVault.Helpers;
namespace Microsoft.HealthVault.ItemTypes
{
/// <summary>
/// Information related to a medication prescription.
/// </summary>
///
public class Prescription : ItemBase
{
/// <summary>
/// Creates a new instance of the <see cref="Prescription"/> class with default
/// values.
/// </summary>
///
public Prescription()
{
}
/// <summary>
/// Creates a new instance of the <see cref="Prescription"/> class
/// with the specified prescriber.
/// </summary>
///
/// <param name="prescribedBy">
/// The person that prescribed the medication.
/// </param>
///
/// <exception cref="ArgumentNullException">
/// The <paramref name="prescribedBy"/> parameter is <b>null</b>.
/// </exception>
///
public Prescription(PersonItem prescribedBy)
{
PrescribedBy = prescribedBy;
}
/// <summary>
/// Populates this Prescription instance from the data in the XML.
/// </summary>
///
/// <param name="navigator">
/// The XML containing the prescription information.
/// </param>
///
/// <exception cref="InvalidOperationException">
/// The first node indicated by <paramref name="navigator"/> is not a prescription node.
/// </exception>
///
public override void ParseXml(XPathNavigator navigator)
{
Validator.ThrowIfNavigatorNull(navigator);
// <prescribed-by>
_prescribedBy = new PersonItem();
_prescribedBy.ParseXml(navigator.SelectSingleNode("prescribed-by"));
// <date-prescribed>
_datePrescribed =
XPathHelper.GetOptNavValue<ApproximateDateTime>(navigator, "date-prescribed");
// <amount-prescribed>
_amountPrescribed =
XPathHelper.GetOptNavValue<GeneralMeasurement>(navigator, "amount-prescribed");
// <substitution>
_substitution =
XPathHelper.GetOptNavValue<CodableValue>(navigator, "substitution");
// <refills>
_refills =
XPathHelper.GetOptNavValueAsInt(navigator, "refills");
// <days-supply>
_daysSupply =
XPathHelper.GetOptNavValueAsInt(navigator, "days-supply");
// <prescription-expiration>
_expiration =
XPathHelper.GetOptNavValue<HealthServiceDate>(navigator, "prescription-expiration");
// <instructions>
_instructions =
XPathHelper.GetOptNavValue<CodableValue>(navigator, "instructions");
}
/// <summary>
/// Writes the prescription data to the specified XmlWriter.
/// </summary>
///
/// <param name="nodeName">
/// The name of the outer element for the prescription data.
/// </param>
///
/// <param name="writer">
/// The XmlWriter to write the prescription data to.
/// </param>
///
/// <exception cref="ArgumentException">
/// The <paramref name="nodeName"/> parameter is <b>null</b> or empty.
/// </exception>
///
/// <exception cref="ArgumentNullException">
/// The <paramref name="writer"/> parameter is <b>null</b>.
/// </exception>
///
/// <exception cref="ThingSerializationException">
/// The <see cref="PrescribedBy"/> property has not been set.
/// </exception>
///
public override void WriteXml(string nodeName, XmlWriter writer)
{
Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName");
Validator.ThrowIfWriterNull(writer);
Validator.ThrowSerializationIfNull(_prescribedBy, Resources.PrescriptionPrescribedByNotSet);
// <prescription>
writer.WriteStartElement(nodeName);
_prescribedBy.WriteXml("prescribed-by", writer);
// <date-prescribed>
XmlWriterHelper.WriteOpt(
writer,
"date-prescribed",
_datePrescribed);
// <amount-prescribed>
XmlWriterHelper.WriteOpt(
writer,
"amount-prescribed",
_amountPrescribed);
// <substitution>
XmlWriterHelper.WriteOpt(
writer,
"substitution",
_substitution);
// <refills>
XmlWriterHelper.WriteOptInt(
writer,
"refills",
_refills);
// <days-supply>
XmlWriterHelper.WriteOptInt(
writer,
"days-supply",
_daysSupply);
// <prescription-expiration>
XmlWriterHelper.WriteOpt(
writer,
"prescription-expiration",
_expiration);
// <instructions>
XmlWriterHelper.WriteOpt(
writer,
"instructions",
_instructions);
// </prescription>
writer.WriteEndElement();
}
/// <summary>
/// Gets or sets the person that prescribed the medication.
/// </summary>
///
/// <value>
/// A <see cref="Person"/> instance.
/// </value>
///
/// <exception cref="ArgumentNullException">
/// The <paramref name="value"/> parameter is <b>null</b> during set.
/// </exception>
///
public PersonItem PrescribedBy
{
get { return _prescribedBy; }
set
{
Validator.ThrowIfArgumentNull(value, nameof(PrescribedBy), Resources.PrescriptionPrescribedByNameMandatory);
_prescribedBy = value;
}
}
private PersonItem _prescribedBy;
/// <summary>
/// Gets or sets the date the medication was prescribed.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public ApproximateDateTime DatePrescribed
{
get { return _datePrescribed; }
set { _datePrescribed = value; }
}
private ApproximateDateTime _datePrescribed;
/// <summary>
/// Gets or sets the amount of medication prescribed.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public GeneralMeasurement AmountPrescribed
{
get { return _amountPrescribed; }
set { _amountPrescribed = value; }
}
private GeneralMeasurement _amountPrescribed;
/// <summary>
/// Gets or sets whether a substitution is permitted.
/// </summary>
///
/// <remarks>
/// Example: Dispense as written, substitution allowed.
/// If the value is not known, it will be set to <b>null</b>.
/// The preferred vocabulary for substitution is "medication-substitution".
/// </remarks>
///
public CodableValue Substitution
{
get { return _substitution; }
set { _substitution = value; }
}
private CodableValue _substitution;
/// <summary>
/// Gets or sets the number of refills of the medication.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public int? Refills
{
get { return _refills; }
set { _refills = value; }
}
private int? _refills;
/// <summary>
/// Gets or sets the number of days supply of medication.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public int? DaysSupply
{
get { return _daysSupply; }
set { _daysSupply = value; }
}
private int? _daysSupply;
/// <summary>
/// Gets or sets the date the prescription expires.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public HealthServiceDate PrescriptionExpiration
{
get { return _expiration; }
set { _expiration = value; }
}
private HealthServiceDate _expiration;
/// <summary>
/// Gets or sets the medication instructions.
/// </summary>
///
/// <remarks>
/// If the value is not known, it will be set to <b>null</b>.
/// </remarks>
///
public CodableValue Instructions
{
get { return _instructions; }
set { _instructions = value; }
}
private CodableValue _instructions;
/// <summary>
/// Gets a string representation of the prescription item.
/// </summary>
///
/// <returns>
/// A string representation of the prescription item.
/// </returns>
///
public override string ToString()
{
string result = string.Empty;
if (PrescribedBy != null)
{
result = PrescribedBy.ToString();
}
return result;
}
}
}
| 32.435294 | 463 | 0.544795 | [
"MIT"
] | Bhaskers-Blu-Org2/healthvault-dotnetstandard-sdk | Microsoft.HealthVault/ItemTypes/Prescription.cs | 11,028 | C# |
using System;
namespace FontAwesome
{
/// <summary>
/// The unicode values for all FontAwesome icons.
/// <para/>
/// See https://fontawesome.com/cheatsheet
/// <para/>
/// This code was automatically generated by FA2CS (https://github.com/michaelswells/fa2cs a modified fork from https://github.com/matthewrdev/fa2cs).
/// </summary>
public static partial class Unicode
{
/// <summary>
/// fa-draw-circle unicode value ("\uf5ed").
/// <para/>
/// This icon supports the following styles: Light (Pro), Regular (Pro), Solid (Pro), Duotone (Pro)
/// <para/>
/// See https://fontawesome.com/icons/draw-circle
/// </summary>
public const string DrawCircle = "\uf5ed";
}
/// <summary>
/// The Css values for all FontAwesome icons.
/// <para/>
/// See https://fontawesome.com/cheatsheet
/// <para/>
/// This code was automatically generated by FA2CS (https://github.com/michaelswells/fa2cs a modified fork from https://github.com/matthewrdev/fa2cs).
/// </summary>
public static partial class Css
{
/// <summary>
/// DrawCircle unicode value ("fa-draw-circle").
/// <para/>
/// This icon supports the following styles: Light (Pro), Regular (Pro), Solid (Pro), Duotone (Pro)
/// <para/>
/// See https://fontawesome.com/icons/draw-circle
/// </summary>
public const string DrawCircle = "fa-draw-circle";
}
/// <summary>
/// The Icon names for all FontAwesome icons.
/// <para/>
/// See https://fontawesome.com/cheatsheet
/// <para/>
/// This code was automatically generated by FA2CS (https://github.com/michaelswells/fa2cs a modified fork from https://github.com/matthewrdev/fa2cs).
/// </summary>
public static partial class Icon
{
/// <summary>
/// fa-draw-circle unicode value ("\uf5ed").
/// <para/>
/// This icon supports the following styles: Light (Pro), Regular (Pro), Solid (Pro), Duotone (Pro)
/// <para/>
/// See https://fontawesome.com/icons/draw-circle
/// </summary>
public const string DrawCircle = "DrawCircle";
}
} | 36.704918 | 154 | 0.593569 | [
"MIT"
] | michaelswells/FontAwesomeAttribute | FontAwesome/FontAwesome.DrawCircle.cs | 2,239 | C# |
namespace FleetManagement.Entities
{
public class EntityBase
{
public virtual int Id { get; set; }
}
}
| 15.5 | 43 | 0.620968 | [
"MIT"
] | mwalasz/Fleet-management-system | srv/src/FleetManagement/Entities/EntityBase.cs | 126 | C# |
using System;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(
fileName = "ItemList",
menuName = "Cat's Ship/Asset Storage/Item List",
order = 0)]
public class ItemList : ScriptableObject
{
public List<Item> items = new List<Item>();
public Item GetByName(string name)
{
foreach (var item in items)
{
if (item.name == name)
{
return item;
}
}
return null;
}
}
| 19.115385 | 52 | 0.559356 | [
"MIT"
] | qcoronia/a-cat-in-space-game | src/Assets/Scripts/ScriptableObjects/AssetStorages/ItemList.cs | 497 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities
{
/// <summary>
/// Domain object class BasketDO
/// </summary>
public class BasketDO
{
public int Id { get; set; }
public int Userid { get; set; }
public int Productid { get; set; }
public int Piece { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public virtual ProductDO Product { get; set; }
public virtual UserDO User { get; set; }
}
}
| 24.52 | 54 | 0.610114 | [
"Apache-2.0"
] | Victoralm/AspNetCore5AndVueJSFromZeroToHero | ShoppySolution/Entities/BasketDO.cs | 615 | C# |
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* 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 OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 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.
*/
using Nini.Config;
using log4net;
using System.Reflection;
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Collections.Generic;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Base;
using OpenSim.Server.Handlers.Base;
using Mono.Addins;
namespace OpenSim.Server
{
public class OpenSimServer
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
protected static HttpServerBase m_Server = null;
protected static List<IServiceConnector> m_ServiceConnectors =
new List<IServiceConnector>();
protected static PluginLoader loader;
private static bool m_NoVerifyCertChain = false;
private static bool m_NoVerifyCertHostname = false;
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
if (m_NoVerifyCertChain)
sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
if (m_NoVerifyCertHostname)
sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch;
if (sslPolicyErrors == SslPolicyErrors.None)
return true;
return false;
}
public static int Main(string[] args)
{
Culture.SetCurrentCulture();
Culture.SetDefaultCurrentCulture();
ServicePointManager.DefaultConnectionLimit = 32;
ServicePointManager.MaxServicePointIdleTime = 30000;
ServicePointManager.Expect100Continue = true; // needed now to suport auto redir without writecache
ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
m_Server = new HttpServerBase("R.O.B.U.S.T.", args);
string registryLocation;
IConfig serverConfig = m_Server.Config.Configs["Startup"];
if (serverConfig == null)
{
System.Console.WriteLine("Startup config section missing in .ini file");
throw new Exception("Configuration error");
}
int dnsTimeout = serverConfig.GetInt("DnsTimeout", 30000);
try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { }
m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);
string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
registryLocation = serverConfig.GetString("RegistryLocation",".");
IConfig servicesConfig = m_Server.Config.Configs["ServiceList"];
if (servicesConfig != null)
{
List<string> servicesList = new List<string>();
if (connList != String.Empty)
servicesList.Add(connList);
foreach (string k in servicesConfig.GetKeys())
{
string v = servicesConfig.GetString(k);
if (v != String.Empty)
servicesList.Add(v);
}
connList = String.Join(",", servicesList.ToArray());
}
string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
// int i = 0;
foreach (string c in conns)
{
if (c == String.Empty)
continue;
string configName = String.Empty;
string conn = c;
uint port = 0;
string[] split1 = conn.Split(new char[] {'/'});
if (split1.Length > 1)
{
conn = split1[1];
string[] split2 = split1[0].Split(new char[] {'@'});
if (split2.Length > 1)
{
configName = split2[0];
port = Convert.ToUInt32(split2[1]);
}
else
{
port = Convert.ToUInt32(split1[0]);
}
}
string[] parts = conn.Split(new char[] {':'});
string friendlyName = parts[0];
if (parts.Length > 1)
friendlyName = parts[1];
BaseHttpServer server;
if (port != 0)
server = (BaseHttpServer)MainServer.GetHttpServer(port, m_Server.IPAddress);
else
server = MainServer.Instance;
if (friendlyName == "LLLoginServiceInConnector")
server.AddSimpleStreamHandler(new IndexPHPHandler(server));
m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, server.Port);
IServiceConnector connector = null;
Object[] modargs = new Object[] { m_Server.Config, server, configName };
connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs);
if (connector == null)
{
modargs = new Object[] { m_Server.Config, server };
connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs);
}
if (connector != null)
{
m_ServiceConnectors.Add(connector);
m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName);
}
else
{
m_log.ErrorFormat("[SERVER]: Failed to load {0}", conn);
}
}
loader = new PluginLoader(m_Server.Config, registryLocation);
int res = m_Server.Run();
if(m_Server != null)
m_Server.Shutdown();
Util.StopThreadPool();
Environment.Exit(res);
return 0;
}
}
}
| 37.753555 | 111 | 0.590635 | [
"BSD-3-Clause"
] | BillBlight/consortium | OpenSim/Server/ServerMain.cs | 7,966 | C# |
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Shopping.Data;
namespace Shopping.Migrations
{
[DbContext(typeof(ShoppingDataContext))]
[Migration("20190907104634_datatypefix")]
partial class datatypefix
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.11-servicing-32099")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Shopping.Models.AllergieFoodItem", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<int>("FoodItemId")
.HasColumnName("FoodItemID");
b.Property<int>("UserId")
.HasColumnName("UserID");
b.HasKey("Id");
b.HasIndex("FoodItemId")
.HasName("fkIdx_121");
b.HasIndex("UserId")
.HasName("fkIdx_118");
b.ToTable("AllergieFoodItem");
});
modelBuilder.Entity("Shopping.Models.Category", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<string>("Filters");
b.Property<string>("ImageUri");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Category");
});
modelBuilder.Entity("Shopping.Models.FoodItem", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false);
b.HasKey("Id");
b.ToTable("FoodItem");
});
modelBuilder.Entity("Shopping.Models.MealPlan", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime");
b.Property<string>("Name");
b.Property<int>("UserId")
.HasColumnName("UserID");
b.HasKey("Id");
b.HasIndex("UserId")
.HasName("fkIdx_102");
b.ToTable("MealPlan");
});
modelBuilder.Entity("Shopping.Models.MealPlanRecipe", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<int>("MealPlanId")
.HasColumnName("MealPlanID");
b.Property<int>("RecipeId")
.HasColumnName("RecipeID");
b.HasKey("Id");
b.HasIndex("MealPlanId")
.HasName("fkIdx_109");
b.HasIndex("RecipeId")
.HasName("fkIdx_112");
b.ToTable("MealPLanRecipe");
});
modelBuilder.Entity("Shopping.Models.Pantry", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<DateTime?>("CreatedAt")
.HasColumnType("datetime");
b.Property<DateTime?>("LastUpdated")
.HasColumnType("datetime");
b.Property<int>("UserId")
.HasColumnName("UserID");
b.HasKey("Id");
b.HasIndex("UserId")
.HasName("fkIdx_20");
b.ToTable("Pantry");
});
modelBuilder.Entity("Shopping.Models.PantryItem", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<int>("FoodItemId")
.HasColumnName("FoodItemID");
b.Property<int>("PantryId")
.HasColumnName("PantryID");
b.Property<string>("Qty");
b.Property<string>("Unit")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false);
b.HasKey("Id");
b.HasIndex("FoodItemId")
.HasName("fkIdx_71");
b.HasIndex("PantryId")
.HasName("fkIdx_68");
b.ToTable("PantryItem");
});
modelBuilder.Entity("Shopping.Models.Recipe", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<string>("CarbsSugar");
b.Property<string>("CarbsTotal");
b.Property<string>("CookTime");
b.Property<string>("Difficulty")
.IsRequired()
.HasMaxLength(50);
b.Property<string>("Energy");
b.Property<string>("FatTotal");
b.Property<string>("Fibre");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false);
b.Property<int>("NumIngredients");
b.Property<string>("PreperationTime");
b.Property<string>("Protein");
b.Property<int>("RecipeCategoryId")
.HasColumnName("RecipeCategoryID");
b.Property<string>("SaturatedFat");
b.Property<string>("Servings");
b.Property<string>("Sodium");
b.HasKey("Id");
b.HasIndex("RecipeCategoryId")
.HasName("fkIdx_44");
b.ToTable("Recipe");
});
modelBuilder.Entity("Shopping.Models.RecipeItem", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<int>("FoodItemId")
.HasColumnName("FoodItemID");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PantryItemId")
.HasColumnName("PantryItemID");
b.Property<string>("Qty");
b.Property<int>("RecipeId")
.HasColumnName("RecipeID");
b.Property<string>("Unit")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false);
b.HasKey("Id");
b.HasIndex("FoodItemId")
.HasName("fkIdx_82");
b.HasIndex("PantryItemId")
.HasName("fkIdx_85");
b.HasIndex("RecipeId")
.HasName("fkIdx_79");
b.ToTable("RecipeItem");
});
modelBuilder.Entity("Shopping.Models.RecipeSteps", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<int>("RecipeId")
.HasColumnName("RecipeID");
b.Property<int>("StepNumber");
b.HasKey("Id");
b.HasIndex("RecipeId")
.HasName("fkIdx_94");
b.ToTable("RecipeSteps");
});
modelBuilder.Entity("Shopping.Models.ShoppingList", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<DateTime?>("CreatedAt")
.HasColumnType("datetime");
b.Property<int>("UserId")
.HasColumnName("UserID");
b.HasKey("Id");
b.HasIndex("UserId")
.HasName("fkIdx_12");
b.ToTable("ShoppingList");
});
modelBuilder.Entity("Shopping.Models.ShoppingListItem", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<int>("FoodItemId")
.HasColumnName("FoodItemID");
b.Property<string>("Qty");
b.Property<int>("ShoppingListId")
.HasColumnName("ShoppingListID");
b.Property<string>("Unit")
.IsRequired()
.HasMaxLength(50)
.IsUnicode(false);
b.HasKey("Id");
b.HasIndex("FoodItemId")
.HasName("fkIdx_65");
b.HasIndex("ShoppingListId")
.HasName("fkIdx_54");
b.ToTable("ShoppingListITem");
});
modelBuilder.Entity("Shopping.Models.User", b =>
{
b.Property<int>("Id")
.HasColumnName("ID");
b.Property<Guid>("ObjectId")
.HasColumnName("ObjectID");
b.HasKey("Id");
b.ToTable("User");
});
modelBuilder.Entity("Shopping.Models.AllergieFoodItem", b =>
{
b.HasOne("Shopping.Models.FoodItem", "FoodItem")
.WithMany("AllergieFoodItem")
.HasForeignKey("FoodItemId")
.HasConstraintName("FK_121");
b.HasOne("Shopping.Models.User", "User")
.WithMany("AllergieFoodItem")
.HasForeignKey("UserId")
.HasConstraintName("FK_118");
});
modelBuilder.Entity("Shopping.Models.MealPlan", b =>
{
b.HasOne("Shopping.Models.User", "User")
.WithMany("MealPlan")
.HasForeignKey("UserId")
.HasConstraintName("FK_102");
});
modelBuilder.Entity("Shopping.Models.MealPlanRecipe", b =>
{
b.HasOne("Shopping.Models.MealPlan", "MealPlan")
.WithMany("MealPlanRecipe")
.HasForeignKey("MealPlanId")
.HasConstraintName("FK_109");
b.HasOne("Shopping.Models.Recipe", "Recipe")
.WithMany("MealPlanRecipe")
.HasForeignKey("RecipeId")
.HasConstraintName("FK_112");
});
modelBuilder.Entity("Shopping.Models.Pantry", b =>
{
b.HasOne("Shopping.Models.User", "User")
.WithMany("Pantry")
.HasForeignKey("UserId")
.HasConstraintName("FK_20");
});
modelBuilder.Entity("Shopping.Models.PantryItem", b =>
{
b.HasOne("Shopping.Models.FoodItem", "FoodItem")
.WithMany("PantryItem")
.HasForeignKey("FoodItemId")
.HasConstraintName("FK_71");
b.HasOne("Shopping.Models.Pantry", "Pantry")
.WithMany("PantryItem")
.HasForeignKey("PantryId")
.HasConstraintName("FK_68");
});
modelBuilder.Entity("Shopping.Models.Recipe", b =>
{
b.HasOne("Shopping.Models.Category", "RecipeCategory")
.WithMany("Recipe")
.HasForeignKey("RecipeCategoryId")
.HasConstraintName("FK_44");
});
modelBuilder.Entity("Shopping.Models.RecipeItem", b =>
{
b.HasOne("Shopping.Models.FoodItem", "FoodItem")
.WithMany("RecipeItem")
.HasForeignKey("FoodItemId")
.HasConstraintName("FK_82");
b.HasOne("Shopping.Models.PantryItem", "PantryItem")
.WithMany("RecipeItem")
.HasForeignKey("PantryItemId")
.HasConstraintName("FK_85");
b.HasOne("Shopping.Models.Recipe", "Recipe")
.WithMany("RecipeItem")
.HasForeignKey("RecipeId")
.HasConstraintName("FK_79");
});
modelBuilder.Entity("Shopping.Models.RecipeSteps", b =>
{
b.HasOne("Shopping.Models.Recipe", "Recipe")
.WithMany("RecipeSteps")
.HasForeignKey("RecipeId")
.HasConstraintName("FK_94");
});
modelBuilder.Entity("Shopping.Models.ShoppingList", b =>
{
b.HasOne("Shopping.Models.User", "User")
.WithMany("ShoppingList")
.HasForeignKey("UserId")
.HasConstraintName("FK_12");
});
modelBuilder.Entity("Shopping.Models.ShoppingListItem", b =>
{
b.HasOne("Shopping.Models.FoodItem", "FoodItem")
.WithMany("ShoppingListItem")
.HasForeignKey("FoodItemId")
.HasConstraintName("FK_65");
b.HasOne("Shopping.Models.ShoppingList", "ShoppingList")
.WithMany("ShoppingListItem")
.HasForeignKey("ShoppingListId")
.HasConstraintName("FK_54");
});
#pragma warning restore 612, 618
}
}
}
| 33.262582 | 117 | 0.418854 | [
"MIT"
] | insightapac/pocketpantry-microservices | src/shopping/Migrations/20190907104634_datatypefix.Designer.cs | 15,203 | C# |
// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Kubernetes.Extensions.V1Beta1
{
/// <summary>
/// PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead.
/// </summary>
public partial class PodSecurityPolicy : KubernetesResource
{
/// <summary>
/// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
/// </summary>
[Output("apiVersion")]
public Output<string> ApiVersion { get; private set; } = null!;
/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
/// </summary>
[Output("kind")]
public Output<string> Kind { get; private set; } = null!;
/// <summary>
/// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
/// </summary>
[Output("metadata")]
public Output<Pulumi.Kubernetes.Types.Outputs.Meta.V1.ObjectMeta> Metadata { get; private set; } = null!;
/// <summary>
/// spec defines the policy enforced.
/// </summary>
[Output("spec")]
public Output<Pulumi.Kubernetes.Types.Outputs.Extensions.V1Beta1.PodSecurityPolicySpec> Spec { get; private set; } = null!;
/// <summary>
/// Create a PodSecurityPolicy resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public PodSecurityPolicy(string name, Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1.PodSecurityPolicyArgs? args = null, CustomResourceOptions? options = null)
: base("kubernetes:extensions/v1beta1:PodSecurityPolicy", name, MakeArgs(args), MakeResourceOptions(options, ""))
{
}
internal PodSecurityPolicy(string name, ImmutableDictionary<string, object?> dictionary, CustomResourceOptions? options = null)
: base("kubernetes:extensions/v1beta1:PodSecurityPolicy", name, new DictionaryResourceArgs(dictionary), MakeResourceOptions(options, ""))
{
}
private PodSecurityPolicy(string name, Input<string> id, CustomResourceOptions? options = null)
: base("kubernetes:extensions/v1beta1:PodSecurityPolicy", name, null, MakeResourceOptions(options, id))
{
}
private static Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1.PodSecurityPolicyArgs? MakeArgs(Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1.PodSecurityPolicyArgs? args)
{
args ??= new Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1.PodSecurityPolicyArgs();
args.ApiVersion = "extensions/v1beta1";
args.Kind = "PodSecurityPolicy";
return args;
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
Aliases =
{
new Pulumi.Alias { Type = "kubernetes:policy/v1beta1:PodSecurityPolicy"},
},
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing PodSecurityPolicy resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static PodSecurityPolicy Get(string name, Input<string> id, CustomResourceOptions? options = null)
{
return new PodSecurityPolicy(name, id, options);
}
}
}
namespace Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1
{
public class PodSecurityPolicyArgs : Pulumi.ResourceArgs
{
/// <summary>
/// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
/// </summary>
[Input("apiVersion")]
public Input<string>? ApiVersion { get; set; }
/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
/// </summary>
[Input("kind")]
public Input<string>? Kind { get; set; }
/// <summary>
/// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
/// </summary>
[Input("metadata")]
public Input<Pulumi.Kubernetes.Types.Inputs.Meta.V1.ObjectMetaArgs>? Metadata { get; set; }
/// <summary>
/// spec defines the policy enforced.
/// </summary>
[Input("spec")]
public Input<Pulumi.Kubernetes.Types.Inputs.Extensions.V1Beta1.PodSecurityPolicySpecArgs>? Spec { get; set; }
public PodSecurityPolicyArgs()
{
}
}
}
| 50.664179 | 302 | 0.665488 | [
"Apache-2.0"
] | hazsetata/pulumi-kubernetes | sdk/dotnet/Extensions/V1Beta1/PodSecurityPolicy.cs | 6,789 | C# |
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
namespace WebApp_OpenIDConnect_DotNet.Services.Arm
{
public class ArmApiOperationService : IArmOperations
{
private readonly HttpClient httpClient;
public ArmApiOperationService(HttpClient httpClient)
{
this.httpClient = httpClient;
}
/// <summary>
/// Enumerates the list of Tenant IDs accessible for a user. Gets a token for the user
/// and calls the ARM API.
/// </summary>
/// <returns></returns>
public async Task<IEnumerable<string>> EnumerateTenantsIdsAccessibleByUser(string accessToken)
{
httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var httpResult = await httpClient.GetAsync(ArmListTenantUrl);
string json = await httpResult.Content.ReadAsStringAsync();
ArmResult armTenants = JsonSerializer.Deserialize<ArmResult>(json);
return armTenants.value.Select(t => t.tenantId);
}
// Use Azure Resource manager to get the list of a tenant accessible by a user
// https://docs.microsoft.com/en-us/rest/api/resources/tenants/list
public static string ArmResource { get; } = "https://management.azure.com/";
protected string ArmListTenantUrl { get; } = "https://management.azure.com/tenants?api-version=2016-06-01";
}
} | 36.707317 | 115 | 0.671761 | [
"MIT"
] | jmprieur/TenantForApp | TenantForApp/Simplified ARM/ArmOperationsService.cs | 1,505 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using Aliyun.Acs.Core;
using System.Collections.Generic;
namespace Aliyun.Acs.CloudAPI.Model.V20160714
{
public class DescribePurchasedApiGroupResponse : AcsResponse
{
public string GroupId { get; set; }
public string GroupName { get; set; }
public string Description { get; set; }
public string PurchasedTime { get; set; }
public string RegionId { get; set; }
public string Status { get; set; }
public List<DomainItem> Domains { get; set; }
public class DomainItem{
public string DomainName { get; set; }
}
}
} | 31.5 | 63 | 0.71645 | [
"Apache-2.0"
] | VAllens/aliyun-openapi-sdk-net-core | src/aliyun-net-sdk-cloudapi/Model/V20160714/DescribePurchasedApiGroupResponse.cs | 1,386 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using VirtualVoid.Net;
public class LobbyMenu : MonoBehaviour
{
public static LobbyMenu instance;
private void Awake()
{
instance = this;
SteamManager.OnClientConnected += OnClientConnected;
SteamManager.OnClientDisconnected += OnClientsChanged;
SteamManager.OnConnectedToServer += WhenConnectedToServer;
SteamManager.OnDisconnectedFromServer += WhenDisconnectedFromServer;
for (int i = 0; i < entries.Length; i++)
{
entries[i].index = i;
}
DisableAllLobbyUIs();
EnableMainMenu(true, true);
}
private void OnDestroy()
{
SteamManager.OnClientConnected -= OnClientConnected;
SteamManager.OnClientDisconnected -= OnClientsChanged;
SteamManager.OnConnectedToServer -= WhenConnectedToServer;
SteamManager.OnDisconnectedFromServer -= WhenDisconnectedFromServer;
}
public static bool IsOpen => instance != null && instance.gameObject != null && instance.gameObject.activeSelf;
public LobbyUI[] entries;
public TMP_Text lobbyHeaderText;
public TMP_Text lobbyCodeText;
private Camera mainCam;
public GameObject hostOnlyObj;
public LayerMask lobbyUILayermask;
public static void OnScourgeChanged()
{
instance.OnClientsChanged();
}
private void OnClientsChanged(Client client)
{
OnClientsChanged();
}
[ContextMenu("Refresh Clients")]
private void OnClientsChanged()
{
try
{
if (lobbyCodeText != null)
{
if (SteamManager.IsServer)
lobbyHeaderText.text = SteamManager.SteamName + "'s Lobby";
else
lobbyHeaderText.text = SteamManager.CurrentLobby.Owner.Name + "'s Lobby";
}
if (lobbyCodeText != null)
lobbyCodeText.text = SteamManager.CurrentLobby.Id.ToString();
//Debug.Log("Lobby Clients Changed");
DisableAllLobbyUIs();
if (!SteamManager.ConnectedToServer)
{
Debug.Log("Skipping Lobby refresh because not connected");
return;
}
foreach (Player player in SteamManager.GetAllClients<Player>())
{
if (player != null)
EnableLobbyUI(player.clientID, player);
}
if (hostOnlyObj != null)
hostOnlyObj.SetActive(SteamManager.IsServer);
}
catch (System.Exception ex)
{
Debug.LogWarning("Error updating lobby clients: " + ex);
//throw;
}
}
private void OnClientConnected(Client client)
{
//if (SteamManager.IsServer)
//{
// ServerSend.SendScourgeIDs(GetScourgeIDs(), client.SteamID);
//}
OnClientsChanged();
}
// not using OnConnectedToServer as its a unity magic method
private void WhenConnectedToServer()
{
EnableMainMenu(false);
CancelInvoke();
Invoke(nameof(RefreshClientsAfterDelay), 1f);
}
private void WhenDisconnectedFromServer()
{
EnableMainMenu(true);
}
private void RefreshClientsAfterDelay()
{
OnClientsChanged();
}
//private void OnEnable()
//{
// if (!DSMSteamManager.ConnectedToServer)
// EnableMainMenu(true);
//}
//private void OnDisable()
//{
// EnableMainMenu(true);
//}
public static void EnableMainMenu(bool active, bool bypassStageChecks = false)
{
GameStage newStage = active ? GameStage.MainMenu : GameStage.Lobby;
if (newStage == SceneManager.CurrentGameStage && !bypassStageChecks)
{
Debug.Log("Skipping main menu <=> lobby transition, as already in " + newStage);
return;
}
if (instance.hostOnlyObj != null)
instance.hostOnlyObj.SetActive(SteamManager.IsServer);
if (MainMenu.MenuCanvas != null)
MainMenu.MenuCanvas.SetActive(active);
if (instance != null && instance.gameObject != null)
instance.gameObject.SetActive(!active);
if (active == false)
instance.DisableAllLobbyUIs();
//Debug.Log("Lobby changing to main menu? " + active);
SceneManager.CurrentGameStage = newStage;
}
public void OnReturnButtonPressed()
{
DSMSteamManager.Leave();
}
private async void EnableLobbyUI(int index, Player player)
{
//if (index > SteamManager.MaxPlayers - 1)
// Debug.LogWarning("Lobby index overflow attempt");
LobbyUI ui = entries[index];
if (ui == null || ui.IsNull())
{
Debug.LogWarning("Null lobbyUI obj for index" + index);
return;
}
ui.gameObject.SetActive(true);
ui.steamNameText.text = player.SteamName;
ui.pfpImage.texture = await player.GetPFP();
}
private void DisableAllLobbyUIs()
{
foreach (LobbyUI ui in entries)
{
if (ui != null && ui.gameObject != null)
ui.gameObject.SetActive(false);
}
}
[ContextMenu("Log Players")]
private void LogPlayers()
{
System.Text.StringBuilder output = new System.Text.StringBuilder();
output.AppendLine("Clients: " + SteamManager.clients.Count);
foreach (Client client in SteamManager.GetAllClients())
{
output.AppendLine("-" + client.SteamName + " / index / " + client.clientID);
}
List<Player> players = SteamManager.GetAllClients<Player>();
output.AppendLine("\nPlayers: " + players.Count);
foreach (Player player in players)
{
output.AppendLine("-" + player.SteamName + " / index / " + player.clientID);
}
Debug.Log(output.ToString());
}
public void OnStartButtonPressed()
{
if (!SteamManager.IsServer)
{
hostOnlyObj.SetActive(false);
return;
}
DSMSteamManager.ContinueFromLobby();
}
public void OnInviteButtonPressed()
{
SteamManager.OpenSteamOverlayLobbyInvite();
}
public void OnCopyLobbyCodeButtonPressed()
{
GUIUtility.systemCopyBuffer = SteamManager.CurrentLobby.Id.ToString();
}
public void OnRefreshLobbyButtonPressed()
{
PopUp.Show("Refreshing...", 1);
OnClientsChanged();
}
}
| 26.062745 | 115 | 0.5969 | [
"MIT"
] | Tobogganeer/MP-Proj-Setup | Assets/Scripts/UI/Menus/LobbyMenu.cs | 6,646 | C# |
using Sfa.Tl.ResultsAndCertification.Models.Contracts.PostResultsService;
using System.Threading.Tasks;
namespace Sfa.Tl.ResultsAndCertification.Data.Interfaces
{
public interface IPostResultsServiceRepository
{
Task<FindPrsLearnerRecord> FindPrsLearnerRecordAsync(long aoUkprn, long? uln, int? profileId = null);
Task<PrsLearnerDetails> GetPrsLearnerDetailsAsync(long aoUkprn, int profileId, int assessmentId);
}
}
| 37.166667 | 109 | 0.79148 | [
"MIT"
] | SkillsFundingAgency/tl-results-and-certification | src/Sfa.Tl.ResultsAndCertification.Data/Interfaces/IPostResultsServiceRepository.cs | 448 | C# |
#region License
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>
*/
#endregion
#region Include
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Reflection;
using System.Collections.Generic;
using System.Runtime.InteropServices;
#endregion
#region Loader
namespace CSGL
{
public static class DLL
{
#region DllImport
[DllImport( "kernel32.dll" )]
private static extern IntPtr LoadLibrary( string filename );
[DllImport( "kernel32.dll" )]
private static extern IntPtr GetProcAddress( IntPtr hModule, string procname );
[DllImport( "kernel32.dll" )]
private static extern void CopyMemory( IntPtr dest, IntPtr src, uint count );
[DllImport( "libdl.so" )]
private static extern IntPtr dlopen( string filename, int flags );
[DllImport( "libdl.so" )]
private static extern IntPtr dlsym( IntPtr handle, string symbol );
[DllImport( "libc.so.6" )]
private static extern void memcpy( IntPtr dest, IntPtr src, uint n );
const int RTLD_NOW = 2;
#endregion
#region Abstracted
private static bool _linuxset = false;
private static bool _linux = false;
public static bool __linux__
{
get
{
if ( !_linuxset )
{
int p = (int)Environment.OSVersion.Platform;
_linux = ( p == 4 ) || ( p == 6 ) || ( p == 128 );
_linuxset = true;
}
return _linux;
}
}
#endregion
#region Fields
private static Type _delegateType = typeof( MulticastDelegate );
#endregion
#region Methods
public static IntPtr csglDllLoad( string filename )
{
IntPtr mHnd;
if ( __linux__ )
mHnd = dlopen( filename, RTLD_NOW );
else
mHnd = LoadLibrary( filename );
if ( mHnd != IntPtr.Zero )
Console.WriteLine( "Linked '{0}' -> '0x{1}'", filename, mHnd.ToString( "X" ) );
else
Console.WriteLine( "Failed to link '{0}'", filename );
return mHnd;
}
public static IntPtr csglDllSymbol( IntPtr mHnd, string symbol )
{
IntPtr symPtr;
if ( __linux__ )
symPtr = dlsym( mHnd, symbol );
else
symPtr = GetProcAddress( mHnd, symbol );
return symPtr;
}
public static Delegate csglDllDelegate( Type delegateType, IntPtr mHnd, string symbol )
{
IntPtr ptrSym = csglDllSymbol( mHnd, symbol );
return Marshal.GetDelegateForFunctionPointer( ptrSym, delegateType );
}
public static void csglDllLinkAllDelegates( Type ofType, IntPtr mHnd )
{
FieldInfo[] fields = ofType.GetFields( BindingFlags.Public | BindingFlags.Static );
foreach ( FieldInfo fi in fields )
{
if ( fi.FieldType.BaseType == _delegateType )
{
IntPtr ptr = csglDllSymbol( mHnd, fi.Name );
if ( ptr != IntPtr.Zero )
fi.SetValue( null, Marshal.GetDelegateForFunctionPointer( ptr, fi.FieldType ) );
else
Console.WriteLine( "Could not resolve '{0}' in loaded assembly '0x{1}'.", fi.Name, mHnd.ToString( "X" ) );
}
}
}
public static void csglMemcpy( IntPtr dest, IntPtr source, uint count )
{
if ( __linux__ )
memcpy( dest, source, count );
else
CopyMemory( dest, source, count );
}
#endregion
}
}
#endregion
#region Implementation
namespace CSGL
{
using static DLL;
public static class Glfw3
{
public static string GLFWWindows = "glfw3.dll";
public static string GLFWLinux = "./libglfw.so";
private static IntPtr _glfwHnd;
#region Constants
public const int GLFW_VERSION_MAJOR = 3;
public const int GLFW_VERSION_MINOR = 2;
public const int GLFW_VERSION_REVISION = 1;
public const int GLFW_TRUE = 1;
public const int GLFW_FALSE = 0;
public const int GLFW_RELEASE = 0;
public const int GLFW_PRESS = 1;
public const int GLFW_REPEAT = 2;
public const int GLFW_KEY_UNKNOWN = -1;
public const int GLFW_KEY_SPACE = 32;
public const int GLFW_KEY_APOSTROPHE = 39;
public const int GLFW_KEY_COMMA = 44;
public const int GLFW_KEY_MINUS = 45;
public const int GLFW_KEY_PERIOD = 46;
public const int GLFW_KEY_SLASH = 47;
public const int GLFW_KEY_0 = 48;
public const int GLFW_KEY_1 = 49;
public const int GLFW_KEY_2 = 50;
public const int GLFW_KEY_3 = 51;
public const int GLFW_KEY_4 = 52;
public const int GLFW_KEY_5 = 53;
public const int GLFW_KEY_6 = 54;
public const int GLFW_KEY_7 = 55;
public const int GLFW_KEY_8 = 56;
public const int GLFW_KEY_9 = 57;
public const int GLFW_KEY_SEMICOLON = 59;
public const int GLFW_KEY_EQUAL = 61;
public const int GLFW_KEY_A = 65;
public const int GLFW_KEY_B = 66;
public const int GLFW_KEY_C = 67;
public const int GLFW_KEY_D = 68;
public const int GLFW_KEY_E = 69;
public const int GLFW_KEY_F = 70;
public const int GLFW_KEY_G = 71;
public const int GLFW_KEY_H = 72;
public const int GLFW_KEY_I = 73;
public const int GLFW_KEY_J = 74;
public const int GLFW_KEY_K = 75;
public const int GLFW_KEY_L = 76;
public const int GLFW_KEY_M = 77;
public const int GLFW_KEY_N = 78;
public const int GLFW_KEY_O = 79;
public const int GLFW_KEY_P = 80;
public const int GLFW_KEY_Q = 81;
public const int GLFW_KEY_R = 82;
public const int GLFW_KEY_S = 83;
public const int GLFW_KEY_T = 84;
public const int GLFW_KEY_U = 85;
public const int GLFW_KEY_V = 86;
public const int GLFW_KEY_W = 87;
public const int GLFW_KEY_X = 88;
public const int GLFW_KEY_Y = 89;
public const int GLFW_KEY_Z = 90;
public const int GLFW_KEY_LEFT_BRACKET = 91;
public const int GLFW_KEY_BACKSLASH = 92;
public const int GLFW_KEY_RIGHT_BRACKET = 93;
public const int GLFW_KEY_GRAVE_ACCENT = 96;
public const int GLFW_KEY_WORLD_1 = 161;
public const int GLFW_KEY_WORLD_2 = 162;
public const int GLFW_KEY_ESCAPE = 256;
public const int GLFW_KEY_ENTER = 257;
public const int GLFW_KEY_TAB = 258;
public const int GLFW_KEY_BACKSPACE = 259;
public const int GLFW_KEY_INSERT = 260;
public const int GLFW_KEY_DELETE = 261;
public const int GLFW_KEY_RIGHT = 262;
public const int GLFW_KEY_LEFT = 263;
public const int GLFW_KEY_DOWN = 264;
public const int GLFW_KEY_UP = 265;
public const int GLFW_KEY_PAGE_UP = 266;
public const int GLFW_KEY_PAGE_DOWN = 267;
public const int GLFW_KEY_HOME = 268;
public const int GLFW_KEY_END = 269;
public const int GLFW_KEY_CAPS_LOCK = 280;
public const int GLFW_KEY_SCROLL_LOCK = 281;
public const int GLFW_KEY_NUM_LOCK = 282;
public const int GLFW_KEY_PRINT_SCREEN = 283;
public const int GLFW_KEY_PAUSE = 284;
public const int GLFW_KEY_F1 = 290;
public const int GLFW_KEY_F2 = 291;
public const int GLFW_KEY_F3 = 292;
public const int GLFW_KEY_F4 = 293;
public const int GLFW_KEY_F5 = 294;
public const int GLFW_KEY_F6 = 295;
public const int GLFW_KEY_F7 = 296;
public const int GLFW_KEY_F8 = 297;
public const int GLFW_KEY_F9 = 298;
public const int GLFW_KEY_F10 = 299;
public const int GLFW_KEY_F11 = 300;
public const int GLFW_KEY_F12 = 301;
public const int GLFW_KEY_F13 = 302;
public const int GLFW_KEY_F14 = 303;
public const int GLFW_KEY_F15 = 304;
public const int GLFW_KEY_F16 = 305;
public const int GLFW_KEY_F17 = 306;
public const int GLFW_KEY_F18 = 307;
public const int GLFW_KEY_F19 = 308;
public const int GLFW_KEY_F20 = 309;
public const int GLFW_KEY_F21 = 310;
public const int GLFW_KEY_F22 = 311;
public const int GLFW_KEY_F23 = 312;
public const int GLFW_KEY_F24 = 313;
public const int GLFW_KEY_F25 = 314;
public const int GLFW_KEY_KP_0 = 320;
public const int GLFW_KEY_KP_1 = 321;
public const int GLFW_KEY_KP_2 = 322;
public const int GLFW_KEY_KP_3 = 323;
public const int GLFW_KEY_KP_4 = 324;
public const int GLFW_KEY_KP_5 = 325;
public const int GLFW_KEY_KP_6 = 326;
public const int GLFW_KEY_KP_7 = 327;
public const int GLFW_KEY_KP_8 = 328;
public const int GLFW_KEY_KP_9 = 329;
public const int GLFW_KEY_KP_DECIMAL = 330;
public const int GLFW_KEY_KP_DIVIDE = 331;
public const int GLFW_KEY_KP_MULTIPLY = 332;
public const int GLFW_KEY_KP_SUBTRACT = 333;
public const int GLFW_KEY_KP_ADD = 334;
public const int GLFW_KEY_KP_ENTER = 335;
public const int GLFW_KEY_KP_EQUAL = 336;
public const int GLFW_KEY_LEFT_SHIFT = 340;
public const int GLFW_KEY_LEFT_CONTROL = 341;
public const int GLFW_KEY_LEFT_ALT = 342;
public const int GLFW_KEY_LEFT_SUPER = 343;
public const int GLFW_KEY_RIGHT_SHIFT = 344;
public const int GLFW_KEY_RIGHT_CONTROL = 345;
public const int GLFW_KEY_RIGHT_ALT = 346;
public const int GLFW_KEY_RIGHT_SUPER = 347;
public const int GLFW_KEY_MENU = 348;
public const int GLFW_KEY_LAST = GLFW_KEY_MENU;
public const int GLFW_MOD_SHIFT = 1;
public const int GLFW_MOD_CONTROL = 2;
public const int GLFW_MOD_ALT = 4;
public const int GLFW_MOD_SUPER = 8;
public const int GLFW_MOUSE_BUTTON_1 = 0;
public const int GLFW_MOUSE_BUTTON_2 = 1;
public const int GLFW_MOUSE_BUTTON_3 = 2;
public const int GLFW_MOUSE_BUTTON_4 = 3;
public const int GLFW_MOUSE_BUTTON_5 = 4;
public const int GLFW_MOUSE_BUTTON_6 = 5;
public const int GLFW_MOUSE_BUTTON_7 = 6;
public const int GLFW_MOUSE_BUTTON_8 = 7;
public const int GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8;
public const int GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1;
public const int GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2;
public const int GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3;
public const int GLFW_JOYSTICK_1 = 0;
public const int GLFW_JOYSTICK_2 = 1;
public const int GLFW_JOYSTICK_3 = 2;
public const int GLFW_JOYSTICK_4 = 3;
public const int GLFW_JOYSTICK_5 = 4;
public const int GLFW_JOYSTICK_6 = 5;
public const int GLFW_JOYSTICK_7 = 6;
public const int GLFW_JOYSTICK_8 = 7;
public const int GLFW_JOYSTICK_9 = 8;
public const int GLFW_JOYSTICK_10 = 9;
public const int GLFW_JOYSTICK_11 = 10;
public const int GLFW_JOYSTICK_12 = 11;
public const int GLFW_JOYSTICK_13 = 12;
public const int GLFW_JOYSTICK_14 = 13;
public const int GLFW_JOYSTICK_15 = 14;
public const int GLFW_JOYSTICK_16 = 15;
public const int GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16;
public const int GLFW_NOT_INITIALIZED = 65537;
public const int GLFW_NO_CURRENT_CONTEXT = 65538;
public const int GLFW_INVALID_ENUM = 65539;
public const int GLFW_INVALID_VALUE = 65540;
public const int GLFW_OUT_OF_MEMORY = 65541;
public const int GLFW_API_UNAVAILABLE = 65542;
public const int GLFW_VERSION_UNAVAILABLE = 65543;
public const int GLFW_PLATFORM_ERROR = 65544;
public const int GLFW_FORMAT_UNAVAILABLE = 65545;
public const int GLFW_NO_WINDOW_CONTEXT = 65546;
public const int GLFW_FOCUSED = 131073;
public const int GLFW_ICONIFIED = 131074;
public const int GLFW_RESIZABLE = 131075;
public const int GLFW_VISIBLE = 131076;
public const int GLFW_DECORATED = 131077;
public const int GLFW_AUTO_ICONIFY = 131078;
public const int GLFW_FLOATING = 131079;
public const int GLFW_MAXIMIZED = 131080;
public const int GLFW_RED_BITS = 135169;
public const int GLFW_GREEN_BITS = 135170;
public const int GLFW_BLUE_BITS = 135171;
public const int GLFW_ALPHA_BITS = 135172;
public const int GLFW_DEPTH_BITS = 135173;
public const int GLFW_STENCIL_BITS = 135174;
public const int GLFW_ACCUM_RED_BITS = 135175;
public const int GLFW_ACCUM_GREEN_BITS = 135176;
public const int GLFW_ACCUM_BLUE_BITS = 135177;
public const int GLFW_ACCUM_ALPHA_BITS = 135178;
public const int GLFW_AUX_BUFFERS = 135179;
public const int GLFW_STEREO = 135180;
public const int GLFW_SAMPLES = 135181;
public const int GLFW_SRGB_CAPABLE = 135182;
public const int GLFW_REFRESH_RATE = 135183;
public const int GLFW_DOUBLEBUFFER = 135184;
public const int GLFW_CLIENT_API = 139265;
public const int GLFW_CONTEXT_VERSION_MAJOR = 139266;
public const int GLFW_CONTEXT_VERSION_MINOR = 139267;
public const int GLFW_CONTEXT_REVISION = 139268;
public const int GLFW_CONTEXT_ROBUSTNESS = 139269;
public const int GLFW_OPENGL_FORWARD_COMPAT = 139270;
public const int GLFW_OPENGL_DEBUG_CONTEXT = 139271;
public const int GLFW_OPENGL_PROFILE = 139272;
public const int GLFW_CONTEXT_RELEASE_BEHAVIOR = 139273;
public const int GLFW_CONTEXT_NO_ERROR = 139274;
public const int GLFW_CONTEXT_CREATION_API = 139275;
public const int GLFW_NO_API = 0;
public const int GLFW_OPENGL_API = 196609;
public const int GLFW_OPENGL_ES_API = 196610;
public const int GLFW_NO_ROBUSTNESS = 0;
public const int GLFW_NO_RESET_NOTIFICATION = 200705;
public const int GLFW_LOSE_CONTEXT_ON_RESET = 200706;
public const int GLFW_OPENGL_ANY_PROFILE = 0;
public const int GLFW_OPENGL_CORE_PROFILE = 204801;
public const int GLFW_OPENGL_COMPAT_PROFILE = 204802;
public const int GLFW_CURSOR = 208897;
public const int GLFW_STICKY_KEYS = 208898;
public const int GLFW_STICKY_MOUSE_BUTTONS = 208899;
public const int GLFW_CURSOR_NORMAL = 212993;
public const int GLFW_CURSOR_HIDDEN = 212994;
public const int GLFW_CURSOR_DISABLED = 212995;
public const int GLFW_ANY_RELEASE_BEHAVIOR = 0;
public const int GLFW_RELEASE_BEHAVIOR_FLUSH = 217089;
public const int GLFW_RELEASE_BEHAVIOR_NONE = 217090;
public const int GLFW_NATIVE_CONTEXT_API = 221185;
public const int GLFW_EGL_CONTEXT_API = 221186;
public const int GLFW_ARROW_CURSOR = 221185;
public const int GLFW_IBEAM_CURSOR = 221186;
public const int GLFW_CROSSHAIR_CURSOR = 221187;
public const int GLFW_HAND_CURSOR = 221188;
public const int GLFW_HRESIZE_CURSOR = 221189;
public const int GLFW_VRESIZE_CURSOR = 221190;
public const int GLFW_CONNECTED = 262145;
public const int GLFW_DISCONNECTED = 262146;
public const int GLFW_DONT_CARE = -1;
#endregion
#region Delegates
public delegate void GLFWvkproc();
public delegate void GLFWerrorfun( int code, [In] [MarshalAs( UnmanagedType.LPStr )] string description );
public delegate void GLFWwindowposfun( IntPtr window, int x, int y );
public delegate void GLFWwindowsizefun( IntPtr window, int w, int h );
public delegate void GLFWwindowclosefun( IntPtr window );
public delegate void GLFWwindowrefreshfun( IntPtr window );
public delegate void GLFWwindowfocusfun( IntPtr window, int got );
public delegate void GLFWwindowiconifyfun( IntPtr window, int iconify );
public delegate void GLFWframebuffersizefun( IntPtr window, int w, int h );
public delegate void GLFWmousebuttonfun( IntPtr window, int button, int action, int mods );
public delegate void GLFWcursorposfun( IntPtr window, double x, double y );
public delegate void GLFWcursorenterfun( IntPtr window, int entered );
public delegate void GLFWscrollfun( IntPtr window, double xoffset, double yoffset );
public delegate void GLFWkeyfun( IntPtr window, int key, int scancode, int action, int mods );
public delegate void GLFWcharfun( IntPtr window, uint codepoint );
public delegate void GLFWcharmodsfun( IntPtr window, uint codepoint, int mods );
public delegate void GLFWdropfun( IntPtr window, int count, [Out] string[] paths );
public delegate void GLFWmonitorfun( IntPtr window, int ev );
public delegate void GLFWjoystickfun( int window, int ev );
public delegate int PFNGLFWINITPROC();
public delegate void PFNGLFWTERMINATEPROC();
public delegate void PFNGLFWGETVERSIONPROC( ref int major, ref int minor, ref int rev );
public delegate IntPtr PFNGLFWGETVERSIONSTRINGPROC();
public delegate GLFWerrorfun PFNGLFWSETERRORCALLBACKPROC( GLFWerrorfun cbfun );
public delegate IntPtr PFNGLFWGETMONITORSPROC( ref int count );
public delegate IntPtr PFNGLFWGETPRIMARYMONITORPROC();
public delegate void PFNGLFWGETMONITORPOSPROC( IntPtr monitor, ref int xpos, ref int ypos );
public delegate void PFNGLFWGETMONITORPHYSICALSIZEPROC( IntPtr monitor, ref int widthMM, ref int heightMM );
public delegate IntPtr PFNGLFWGETMONITORNAMEPROC( IntPtr monitor );
public delegate GLFWmonitorfun PFNGLFWSETMONITORCALLBACKPROC( GLFWmonitorfun cbfun );
public delegate IntPtr PFNGLFWGETVIDEOMODESPROC( IntPtr monitor, ref int count );
public delegate IntPtr PFNGLFWGETVIDEOMODEPROC( IntPtr monitor );
public delegate void PFNGLFWSETGAMMAPROC( IntPtr monitor, float gamma );
public delegate IntPtr PFNGLFWGETGAMMARAMPPROC( IntPtr monitor );
public delegate void PFNGLFWSETGAMMARAMPPROC( IntPtr monitor, ref GLFWgammaramp ramp );
public delegate void PFNGLFWDEFAULTWINDOWHINTSPROC();
public delegate void PFNGLFWWINDOWHINTPROC( int hint, int value );
public delegate IntPtr PFNGLFWCREATEWINDOWPROC( int width, int height, [In] [MarshalAs( UnmanagedType.LPStr )] string title, IntPtr monitor, IntPtr share );
public delegate void PFNGLFWDESTROYWINDOWPROC( IntPtr window );
public delegate int PFNGLFWWINDOWSHOULDCLOSEPROC( IntPtr window );
public delegate void PFNGLFWSETWINDOWSHOULDCLOSEPROC( IntPtr window, int value );
public delegate void PFNGLFWSETWINDOWTITLEPROC( IntPtr window, [In] [MarshalAs( UnmanagedType.LPStr )] string title );
public delegate void PFNGLFWSETWINDOWICONPROC( IntPtr window, int count, ref GLFWimage images );
public delegate void PFNGLFWGETWINDOWPOSPROC( IntPtr window, ref int xpos, ref int ypos );
public delegate void PFNGLFWSETWINDOWPOSPROC( IntPtr window, int xpos, int ypos );
public delegate void PFNGLFWGETWINDOWSIZEPROC( IntPtr window, ref int width, ref int height );
public delegate void PFNGLFWSETWINDOWSIZELIMITSPROC( IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight );
public delegate void PFNGLFWSETWINDOWASPECTRATIOPROC( IntPtr window, int numer, int denom );
public delegate void PFNGLFWSETWINDOWSIZEPROC( IntPtr window, int width, int height );
public delegate void PFNGLFWGETFRAMEBUFFERSIZEPROC( IntPtr window, ref int width, ref int height );
public delegate void PFNGLFWGETWINDOWFRAMESIZEPROC( IntPtr window, ref int left, ref int top, ref int right, ref int bottom );
public delegate void PFNGLFWICONIFYWINDOWPROC( IntPtr window );
public delegate void PFNGLFWRESTOREWINDOWPROC( IntPtr window );
public delegate void PFNGLFWMAXIMIZEWINDOWPROC( IntPtr window );
public delegate void PFNGLFWSHOWWINDOWPROC( IntPtr window );
public delegate void PFNGLFWHIDEWINDOWPROC( IntPtr window );
public delegate void PFNGLFWFOCUSWINDOWPROC( IntPtr window );
public delegate IntPtr PFNGLFWGETWINDOWMONITORPROC( IntPtr window );
public delegate void PFNGLFWSETWINDOWMONITORPROC( IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate );
public delegate int PFNGLFWGETWINDOWATTRIBPROC( IntPtr window, int attrib );
public delegate void PFNGLFWSETWINDOWUSERPOINTERPROC( IntPtr window, IntPtr pointer );
public delegate IntPtr PFNGLFWGETWINDOWUSERPOINTERPROC( IntPtr window );
public delegate GLFWwindowposfun PFNGLFWSETWINDOWPOSCALLBACKPROC( IntPtr window, GLFWwindowposfun cbfun );
public delegate GLFWwindowsizefun PFNGLFWSETWINDOWSIZECALLBACKPROC( IntPtr window, GLFWwindowsizefun cbfun );
public delegate GLFWwindowclosefun PFNGLFWSETWINDOWCLOSECALLBACKPROC( IntPtr window, GLFWwindowclosefun cbfun );
public delegate GLFWwindowrefreshfun PFNGLFWSETWINDOWREFRESHCALLBACKPROC( IntPtr window, GLFWwindowrefreshfun cbfun );
public delegate GLFWwindowfocusfun PFNGLFWSETWINDOWFOCUSCALLBACKPROC( IntPtr window, GLFWwindowfocusfun cbfun );
public delegate GLFWwindowiconifyfun PFNGLFWSETWINDOWICONIFYCALLBACKPROC( IntPtr window, GLFWwindowiconifyfun cbfun );
public delegate GLFWframebuffersizefun PFNGLFWSETFRAMEBUFFERSIZECALLBACKPROC( IntPtr window, GLFWframebuffersizefun cbfun );
public delegate void PFNGLFWPOLLEVENTSPROC();
public delegate void PFNGLFWWAITEVENTSPROC();
public delegate void PFNGLFWWAITEVENTSTIMEOUTPROC( double timeout );
public delegate void PFNGLFWPOSTEMPTYEVENTPROC();
public delegate int PFNGLFWGETINPUTMODEPROC( IntPtr window, int mode );
public delegate void PFNGLFWSETINPUTMODEPROC( IntPtr window, int mode, int value );
public delegate IntPtr PFNGLFWGETKEYNAMEPROC( int key, int scancode );
public delegate int PFNGLFWGETKEYPROC( IntPtr window, int key );
public delegate int PFNGLFWGETMOUSEBUTTONPROC( IntPtr window, int button );
public delegate void PFNGLFWGETCURSORPOSPROC( IntPtr window, ref double xpos, ref double ypos );
public delegate void PFNGLFWSETCURSORPOSPROC( IntPtr window, double xpos, double ypos );
public delegate IntPtr PFNGLFWCREATECURSORPROC( ref GLFWimage image, int xhot, int yhot );
public delegate IntPtr PFNGLFWCREATESTANDARDCURSORPROC( int shape );
public delegate void PFNGLFWDESTROYCURSORPROC( IntPtr cursor );
public delegate void PFNGLFWSETCURSORPROC( IntPtr window, IntPtr cursor );
public delegate GLFWkeyfun PFNGLFWSETKEYCALLBACKPROC( IntPtr window, GLFWkeyfun cbfun );
public delegate GLFWcharfun PFNGLFWSETCHARCALLBACKPROC( IntPtr window, GLFWcharfun cbfun );
public delegate GLFWcharmodsfun PFNGLFWSETCHARMODSCALLBACKPROC( IntPtr window, GLFWcharmodsfun cbfun );
public delegate GLFWmousebuttonfun PFNGLFWSETMOUSEBUTTONCALLBACKPROC( IntPtr window, GLFWmousebuttonfun cbfun );
public delegate GLFWcursorposfun PFNGLFWSETCURSORPOSCALLBACKPROC( IntPtr window, GLFWcursorposfun cbfun );
public delegate GLFWcursorenterfun PFNGLFWSETCURSORENTERCALLBACKPROC( IntPtr window, GLFWcursorenterfun cbfun );
public delegate GLFWscrollfun PFNGLFWSETSCROLLCALLBACKPROC( IntPtr window, GLFWscrollfun cbfun );
public delegate GLFWdropfun PFNGLFWSETDROPCALLBACKPROC( IntPtr window, GLFWdropfun cbfun );
public delegate int PFNGLFWJOYSTICKPRESENTPROC( int joy );
public delegate IntPtr PFNGLFWGETJOYSTICKAXESPROC( int joy, ref int count );
public delegate IntPtr PFNGLFWGETJOYSTICKBUTTONSPROC( int joy, ref int count );
public delegate IntPtr PFNGLFWGETJOYSTICKNAMEPROC( int joy );
public delegate GLFWjoystickfun PFNGLFWSETJOYSTICKCALLBACKPROC( GLFWjoystickfun cbfun );
public delegate void PFNGLFWSETCLIPBOARDSTRINGPROC( IntPtr window, [In] [MarshalAs( UnmanagedType.LPStr )] string @string );
public delegate IntPtr PFNGLFWGETCLIPBOARDSTRINGPROC( IntPtr window );
public delegate double PFNGLFWGETTIMEPROC();
public delegate void PFNGLFWSETTIMEPROC( double time );
public delegate uint PFNGLFWGETTIMERVALUEPROC();
public delegate uint PFNGLFWGETTIMERFREQUENCYPROC();
public delegate void PFNGLFWMAKECONTEXTCURRENTPROC( IntPtr window );
public delegate IntPtr PFNGLFWGETCURRENTCONTEXTPROC();
public delegate void PFNGLFWSWAPBUFFERSPROC( IntPtr window );
public delegate void PFNGLFWSWAPINTERVALPROC( int interval );
public delegate int PFNGLFWEXTENSIONSUPPORTEDPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string extension );
public delegate IntPtr PFNGLFWGETPROCADDRESSPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string procname );
public delegate int PFNGLFWVULKANSUPPORTEDPROC();
public delegate IntPtr PFNGLFWGETREQUIREDINSTANCEEXTENSIONSPROC( ref uint count );
#endregion
#region Structures
[StructLayout( LayoutKind.Sequential )]
public struct GLFWvidmode
{
public int width;
public int height;
public int redBits;
public int greenBits;
public int blueBits;
public int refreshRate;
}
[StructLayout( LayoutKind.Sequential )]
public struct GLFWgammaramp
{
public IntPtr red;
public IntPtr green;
public IntPtr blue;
public uint size;
}
[StructLayout( LayoutKind.Sequential )]
public struct GLFWimage
{
public int width;
public int height;
[MarshalAs(UnmanagedType.LPStr)]
public string pixels;
}
#endregion
#region Methods
public static void csglLoadGlfw()
{
if ( __linux__ )
_glfwHnd = csglDllLoad( GLFWLinux );
else
_glfwHnd = csglDllLoad( GLFWWindows );
csglDllLinkAllDelegates( typeof( Glfw3 ), _glfwHnd );
}
public static PFNGLFWINITPROC glfwInit;
public static PFNGLFWTERMINATEPROC glfwTerminate;
public static PFNGLFWGETVERSIONPROC glfwGetVersion;
public static PFNGLFWGETVERSIONSTRINGPROC glfwGetVersionString;
public static PFNGLFWSETERRORCALLBACKPROC glfwSetErrorCallback;
public static PFNGLFWGETMONITORSPROC glfwGetMonitors;
public static PFNGLFWGETPRIMARYMONITORPROC glfwGetPrimaryMonitor;
public static PFNGLFWGETMONITORPOSPROC glfwGetMonitorPos;
public static PFNGLFWGETMONITORPHYSICALSIZEPROC glfwGetMonitorPhysicalSize;
public static PFNGLFWGETMONITORNAMEPROC glfwGetMonitorName;
public static PFNGLFWSETMONITORCALLBACKPROC glfwSetMonitorCallback;
public static PFNGLFWGETVIDEOMODESPROC glfwGetVideoModes;
public static PFNGLFWGETVIDEOMODEPROC glfwGetVideoMode;
public static PFNGLFWSETGAMMAPROC glfwSetGamma;
public static PFNGLFWGETGAMMARAMPPROC glfwGetGammaRamp;
public static PFNGLFWSETGAMMARAMPPROC glfwSetGammaRamp;
public static PFNGLFWDEFAULTWINDOWHINTSPROC glfwDefaultWindowHints;
public static PFNGLFWWINDOWHINTPROC glfwWindowHint;
public static PFNGLFWCREATEWINDOWPROC glfwCreateWindow;
public static PFNGLFWDESTROYWINDOWPROC glfwDestroyWindow;
public static PFNGLFWWINDOWSHOULDCLOSEPROC glfwWindowShouldClose;
public static PFNGLFWSETWINDOWSHOULDCLOSEPROC glfwSetWindowShouldClose;
public static PFNGLFWSETWINDOWTITLEPROC glfwSetWindowTitle;
public static PFNGLFWSETWINDOWICONPROC glfwSetWindowIcon;
public static PFNGLFWGETWINDOWPOSPROC glfwGetWindowPos;
public static PFNGLFWSETWINDOWPOSPROC glfwSetWindowPos;
public static PFNGLFWGETWINDOWSIZEPROC glfwGetWindowSize;
public static PFNGLFWSETWINDOWSIZELIMITSPROC glfwSetWindowSizeLimits;
public static PFNGLFWSETWINDOWASPECTRATIOPROC glfwSetWindowAspectRatio;
public static PFNGLFWSETWINDOWSIZEPROC glfwSetWindowSize;
public static PFNGLFWGETFRAMEBUFFERSIZEPROC glfwGetFramebufferSize;
public static PFNGLFWGETWINDOWFRAMESIZEPROC glfwGetWindowFrameSize;
public static PFNGLFWICONIFYWINDOWPROC glfwIconifyWindow;
public static PFNGLFWRESTOREWINDOWPROC glfwRestoreWindow;
public static PFNGLFWMAXIMIZEWINDOWPROC glfwMaximizeWindow;
public static PFNGLFWSHOWWINDOWPROC glfwShowWindow;
public static PFNGLFWHIDEWINDOWPROC glfwHideWindow;
public static PFNGLFWFOCUSWINDOWPROC glfwFocusWindow;
public static PFNGLFWGETWINDOWMONITORPROC glfwGetWindowMonitor;
public static PFNGLFWSETWINDOWMONITORPROC glfwSetWindowMonitor;
public static PFNGLFWGETWINDOWATTRIBPROC glfwGetWindowAttrib;
public static PFNGLFWSETWINDOWUSERPOINTERPROC glfwSetWindowUserPointer;
public static PFNGLFWGETWINDOWUSERPOINTERPROC glfwGetWindowUserPointer;
public static PFNGLFWSETWINDOWPOSCALLBACKPROC glfwSetWindowPosCallback;
public static PFNGLFWSETWINDOWSIZECALLBACKPROC glfwSetWindowSizeCallback;
public static PFNGLFWSETWINDOWCLOSECALLBACKPROC glfwSetWindowCloseCallback;
public static PFNGLFWSETWINDOWREFRESHCALLBACKPROC glfwSetWindowRefreshCallback;
public static PFNGLFWSETWINDOWFOCUSCALLBACKPROC glfwSetWindowFocusCallback;
public static PFNGLFWSETWINDOWICONIFYCALLBACKPROC glfwSetWindowIconifyCallback;
public static PFNGLFWSETFRAMEBUFFERSIZECALLBACKPROC glfwSetFramebufferSizeCallback;
public static PFNGLFWPOLLEVENTSPROC glfwPollEvents;
public static PFNGLFWWAITEVENTSPROC glfwWaitEvents;
public static PFNGLFWWAITEVENTSTIMEOUTPROC glfwWaitEventsTimeout;
public static PFNGLFWPOSTEMPTYEVENTPROC glfwPostEmptyEvent;
public static PFNGLFWGETINPUTMODEPROC glfwGetInputMode;
public static PFNGLFWSETINPUTMODEPROC glfwSetInputMode;
public static PFNGLFWGETKEYNAMEPROC glfwGetKeyName;
public static PFNGLFWGETKEYPROC glfwGetKey;
public static PFNGLFWGETMOUSEBUTTONPROC glfwGetMouseButton;
public static PFNGLFWGETCURSORPOSPROC glfwGetCursorPos;
public static PFNGLFWSETCURSORPOSPROC glfwSetCursorPos;
public static PFNGLFWCREATECURSORPROC glfwCreateCursor;
public static PFNGLFWCREATESTANDARDCURSORPROC glfwCreateStandardCursor;
public static PFNGLFWDESTROYCURSORPROC glfwDestroyCursor;
public static PFNGLFWSETCURSORPROC glfwSetCursor;
public static PFNGLFWSETKEYCALLBACKPROC glfwSetKeyCallback;
public static PFNGLFWSETCHARCALLBACKPROC glfwSetCharCallback;
public static PFNGLFWSETCHARMODSCALLBACKPROC glfwSetCharModsCallback;
public static PFNGLFWSETMOUSEBUTTONCALLBACKPROC glfwSetMouseButtonCallback;
public static PFNGLFWSETCURSORPOSCALLBACKPROC glfwSetCursorPosCallback;
public static PFNGLFWSETCURSORENTERCALLBACKPROC glfwSetCursorEnterCallback;
public static PFNGLFWSETSCROLLCALLBACKPROC glfwSetScrollCallback;
public static PFNGLFWSETDROPCALLBACKPROC glfwSetDropCallback;
public static PFNGLFWJOYSTICKPRESENTPROC glfwJoystickPresent;
public static PFNGLFWGETJOYSTICKAXESPROC glfwGetJoystickAxes;
public static PFNGLFWGETJOYSTICKBUTTONSPROC glfwGetJoystickButtons;
public static PFNGLFWGETJOYSTICKNAMEPROC glfwGetJoystickName;
public static PFNGLFWSETJOYSTICKCALLBACKPROC glfwSetJoystickCallback;
public static PFNGLFWSETCLIPBOARDSTRINGPROC glfwSetClipboardString;
public static PFNGLFWGETCLIPBOARDSTRINGPROC glfwGetClipboardString;
public static PFNGLFWGETTIMEPROC glfwGetTime;
public static PFNGLFWSETTIMEPROC glfwSetTime;
public static PFNGLFWGETTIMERVALUEPROC glfwGetTimerValue;
public static PFNGLFWGETTIMERFREQUENCYPROC glfwGetTimerFrequency;
public static PFNGLFWMAKECONTEXTCURRENTPROC glfwMakeContextCurrent;
public static PFNGLFWGETCURRENTCONTEXTPROC glfwGetCurrentContext;
public static PFNGLFWSWAPBUFFERSPROC glfwSwapBuffers;
public static PFNGLFWSWAPINTERVALPROC glfwSwapInterval;
public static PFNGLFWEXTENSIONSUPPORTEDPROC glfwExtensionSupported;
public static PFNGLFWGETPROCADDRESSPROC glfwGetProcAddress;
public static PFNGLFWVULKANSUPPORTEDPROC glfwVulkanSupported;
public static PFNGLFWGETREQUIREDINSTANCEEXTENSIONSPROC glfwGetRequiredInstanceExtensions;
#endregion
}
public static class OpenGL
{
#region OpenGL 1.0 + OpenGL 1.1
#region Constants
public const uint GL_ACCUM = 256;
public const uint GL_LOAD = 257;
public const uint GL_RETURN = 258;
public const uint GL_MULT = 259;
public const uint GL_ADD = 260;
public const uint GL_NEVER = 512;
public const uint GL_LESS = 513;
public const uint GL_EQUAL = 514;
public const uint GL_LEQUAL = 515;
public const uint GL_GREATER = 516;
public const uint GL_NOTEQUAL = 517;
public const uint GL_GEQUAL = 518;
public const uint GL_ALWAYS = 519;
public const int GL_CURRENT_BIT = 1;
public const int GL_POINT_BIT = 2;
public const int GL_LINE_BIT = 4;
public const int GL_POLYGON_BIT = 8;
public const int GL_POLYGON_STIPPLE_BIT = 16;
public const int GL_PIXEL_MODE_BIT = 32;
public const int GL_LIGHTING_BIT = 64;
public const int GL_FOG_BIT = 128;
public const int GL_DEPTH_BUFFER_BIT = 256;
public const int GL_ACCUM_BUFFER_BIT = 512;
public const int GL_STENCIL_BUFFER_BIT = 1024;
public const int GL_VIEWPORT_BIT = 2048;
public const int GL_TRANSFORM_BIT = 4096;
public const int GL_ENABLE_BIT = 8192;
public const int GL_COLOR_BUFFER_BIT = 16384;
public const int GL_HINT_BIT = 32768;
public const int GL_EVAL_BIT = 65536;
public const int GL_LIST_BIT = 131072;
public const int GL_TEXTURE_BIT = 262144;
public const int GL_SCISSOR_BIT = 524288;
public const uint GL_ALL_ATTRIB_BITS = 1048575;
public const uint GL_POINTS = 0;
public const uint GL_LINES = 1;
public const uint GL_LINE_LOOP = 2;
public const uint GL_LINE_STRIP = 3;
public const uint GL_TRIANGLES = 4;
public const uint GL_TRIANGLE_STRIP = 5;
public const uint GL_TRIANGLE_FAN = 6;
public const uint GL_QUADS = 7;
public const uint GL_QUAD_STRIP = 8;
public const uint GL_POLYGON = 9;
public const uint GL_ZERO = 0;
public const uint GL_ONE = 1;
public const uint GL_SRC_COLOR = 768;
public const uint GL_ONE_MINUS_SRC_COLOR = 769;
public const uint GL_SRC_ALPHA = 770;
public const uint GL_ONE_MINUS_SRC_ALPHA = 771;
public const uint GL_DST_ALPHA = 772;
public const uint GL_ONE_MINUS_DST_ALPHA = 773;
public const uint GL_DST_COLOR = 774;
public const uint GL_ONE_MINUS_DST_COLOR = 775;
public const uint GL_SRC_ALPHA_SATURATE = 776;
public const byte GL_TRUE = 1;
public const byte GL_FALSE = 0;
public const uint GL_CLIP_PLANE0 = 12288;
public const uint GL_CLIP_PLANE1 = 12289;
public const uint GL_CLIP_PLANE2 = 12290;
public const uint GL_CLIP_PLANE3 = 12291;
public const uint GL_CLIP_PLANE4 = 12292;
public const uint GL_CLIP_PLANE5 = 12293;
public const uint GL_BYTE = 5120;
public const uint GL_UNSIGNED_BYTE = 5121;
public const uint GL_SHORT = 5122;
public const uint GL_UNSIGNED_SHORT = 5123;
public const uint GL_INT = 5124;
public const uint GL_UNSIGNED_INT = 5125;
public const uint GL_FLOAT = 5126;
public const uint GL_2_BYTES = 5127;
public const uint GL_3_BYTES = 5128;
public const uint GL_4_BYTES = 5129;
public const uint GL_DOUBLE = 5130;
public const uint GL_NONE = 0;
public const uint GL_FRONT_LEFT = 1024;
public const uint GL_FRONT_RIGHT = 1025;
public const uint GL_BACK_LEFT = 1026;
public const uint GL_BACK_RIGHT = 1027;
public const uint GL_FRONT = 1028;
public const uint GL_BACK = 1029;
public const uint GL_LEFT = 1030;
public const uint GL_RIGHT = 1031;
public const uint GL_FRONT_AND_BACK = 1032;
public const uint GL_AUX0 = 1033;
public const uint GL_AUX1 = 1034;
public const uint GL_AUX2 = 1035;
public const uint GL_AUX3 = 1036;
public const uint GL_NO_ERROR = 0;
public const uint GL_INVALID_ENUM = 1280;
public const uint GL_INVALID_VALUE = 1281;
public const uint GL_INVALID_OPERATION = 1282;
public const uint GL_STACK_OVERFLOW = 1283;
public const uint GL_STACK_UNDERFLOW = 1284;
public const uint GL_OUT_OF_MEMORY = 1285;
public const uint GL_2D = 1536;
public const uint GL_3D = 1537;
public const uint GL_3D_COLOR = 1538;
public const uint GL_3D_COLOR_TEXTURE = 1539;
public const uint GL_4D_COLOR_TEXTURE = 1540;
public const uint GL_PASS_THROUGH_TOKEN = 1792;
public const uint GL_POINT_TOKEN = 1793;
public const uint GL_LINE_TOKEN = 1794;
public const uint GL_POLYGON_TOKEN = 1795;
public const uint GL_BITMAP_TOKEN = 1796;
public const uint GL_DRAW_PIXEL_TOKEN = 1797;
public const uint GL_COPY_PIXEL_TOKEN = 1798;
public const uint GL_LINE_RESET_TOKEN = 1799;
public const uint GL_EXP = 2048;
public const uint GL_EXP2 = 2049;
public const uint GL_CW = 2304;
public const uint GL_CCW = 2305;
public const uint GL_COEFF = 2560;
public const uint GL_ORDER = 2561;
public const uint GL_DOMAIN = 2562;
public const uint GL_CURRENT_COLOR = 2816;
public const uint GL_CURRENT_INDEX = 2817;
public const uint GL_CURRENT_NORMAL = 2818;
public const uint GL_CURRENT_TEXTURE_COORDS = 2819;
public const uint GL_CURRENT_RASTER_COLOR = 2820;
public const uint GL_CURRENT_RASTER_INDEX = 2821;
public const uint GL_CURRENT_RASTER_TEXTURE_COORDS = 2822;
public const uint GL_CURRENT_RASTER_POSITION = 2823;
public const uint GL_CURRENT_RASTER_POSITION_VALID = 2824;
public const uint GL_CURRENT_RASTER_DISTANCE = 2825;
public const uint GL_POINT_SMOOTH = 2832;
public const uint GL_POINT_SIZE = 2833;
public const uint GL_POINT_SIZE_RANGE = 2834;
public const uint GL_POINT_SIZE_GRANULARITY = 2835;
public const uint GL_LINE_SMOOTH = 2848;
public const uint GL_LINE_WIDTH = 2849;
public const uint GL_LINE_WIDTH_RANGE = 2850;
public const uint GL_LINE_WIDTH_GRANULARITY = 2851;
public const uint GL_LINE_STIPPLE = 2852;
public const uint GL_LINE_STIPPLE_PATTERN = 2853;
public const uint GL_LINE_STIPPLE_REPEAT = 2854;
public const uint GL_LIST_MODE = 2864;
public const uint GL_MAX_LIST_NESTING = 2865;
public const uint GL_LIST_BASE = 2866;
public const uint GL_LIST_INDEX = 2867;
public const uint GL_POLYGON_MODE = 2880;
public const uint GL_POLYGON_SMOOTH = 2881;
public const uint GL_POLYGON_STIPPLE = 2882;
public const uint GL_EDGE_FLAG = 2883;
public const uint GL_CULL_FACE = 2884;
public const uint GL_CULL_FACE_MODE = 2885;
public const uint GL_FRONT_FACE = 2886;
public const uint GL_LIGHTING = 2896;
public const uint GL_LIGHT_MODEL_LOCAL_VIEWER = 2897;
public const uint GL_LIGHT_MODEL_TWO_SIDE = 2898;
public const uint GL_LIGHT_MODEL_AMBIENT = 2899;
public const uint GL_SHADE_MODEL = 2900;
public const uint GL_COLOR_MATERIAL_FACE = 2901;
public const uint GL_COLOR_MATERIAL_PARAMETER = 2902;
public const uint GL_COLOR_MATERIAL = 2903;
public const uint GL_FOG = 2912;
public const uint GL_FOG_INDEX = 2913;
public const uint GL_FOG_DENSITY = 2914;
public const uint GL_FOG_START = 2915;
public const uint GL_FOG_END = 2916;
public const uint GL_FOG_MODE = 2917;
public const uint GL_FOG_COLOR = 2918;
public const uint GL_DEPTH_RANGE = 2928;
public const uint GL_DEPTH_TEST = 2929;
public const uint GL_DEPTH_WRITEMASK = 2930;
public const uint GL_DEPTH_CLEAR_VALUE = 2931;
public const uint GL_DEPTH_FUNC = 2932;
public const uint GL_ACCUM_CLEAR_VALUE = 2944;
public const uint GL_STENCIL_TEST = 2960;
public const uint GL_STENCIL_CLEAR_VALUE = 2961;
public const uint GL_STENCIL_FUNC = 2962;
public const uint GL_STENCIL_VALUE_MASK = 2963;
public const uint GL_STENCIL_FAIL = 2964;
public const uint GL_STENCIL_PASS_DEPTH_FAIL = 2965;
public const uint GL_STENCIL_PASS_DEPTH_PASS = 2966;
public const uint GL_STENCIL_REF = 2967;
public const uint GL_STENCIL_WRITEMASK = 2968;
public const uint GL_MATRIX_MODE = 2976;
public const uint GL_NORMALIZE = 2977;
public const uint GL_VIEWPORT = 2978;
public const uint GL_MODELVIEW_STACK_DEPTH = 2979;
public const uint GL_PROJECTION_STACK_DEPTH = 2980;
public const uint GL_TEXTURE_STACK_DEPTH = 2981;
public const uint GL_MODELVIEW_MATRIX = 2982;
public const uint GL_PROJECTION_MATRIX = 2983;
public const uint GL_TEXTURE_MATRIX = 2984;
public const uint GL_ATTRIB_STACK_DEPTH = 2992;
public const uint GL_CLIENT_ATTRIB_STACK_DEPTH = 2993;
public const uint GL_ALPHA_TEST = 3008;
public const uint GL_ALPHA_TEST_FUNC = 3009;
public const uint GL_ALPHA_TEST_REF = 3010;
public const uint GL_DITHER = 3024;
public const uint GL_BLEND_DST = 3040;
public const uint GL_BLEND_SRC = 3041;
public const uint GL_BLEND = 3042;
public const uint GL_LOGIC_OP_MODE = 3056;
public const uint GL_INDEX_LOGIC_OP = 3057;
public const uint GL_COLOR_LOGIC_OP = 3058;
public const uint GL_AUX_BUFFERS = 3072;
public const uint GL_DRAW_BUFFER = 3073;
public const uint GL_READ_BUFFER = 3074;
public const uint GL_SCISSOR_BOX = 3088;
public const uint GL_SCISSOR_TEST = 3089;
public const uint GL_INDEX_CLEAR_VALUE = 3104;
public const uint GL_INDEX_WRITEMASK = 3105;
public const uint GL_COLOR_CLEAR_VALUE = 3106;
public const uint GL_COLOR_WRITEMASK = 3107;
public const uint GL_INDEX_MODE = 3120;
public const uint GL_RGBA_MODE = 3121;
public const uint GL_DOUBLEBUFFER = 3122;
public const uint GL_STEREO = 3123;
public const uint GL_RENDER_MODE = 3136;
public const uint GL_PERSPECTIVE_CORRECTION_HINT = 3152;
public const uint GL_POINT_SMOOTH_HINT = 3153;
public const uint GL_LINE_SMOOTH_HINT = 3154;
public const uint GL_POLYGON_SMOOTH_HINT = 3155;
public const uint GL_FOG_HINT = 3156;
public const uint GL_TEXTURE_GEN_S = 3168;
public const uint GL_TEXTURE_GEN_T = 3169;
public const uint GL_TEXTURE_GEN_R = 3170;
public const uint GL_TEXTURE_GEN_Q = 3171;
public const uint GL_PIXEL_MAP_I_TO_I = 3184;
public const uint GL_PIXEL_MAP_S_TO_S = 3185;
public const uint GL_PIXEL_MAP_I_TO_R = 3186;
public const uint GL_PIXEL_MAP_I_TO_G = 3187;
public const uint GL_PIXEL_MAP_I_TO_B = 3188;
public const uint GL_PIXEL_MAP_I_TO_A = 3189;
public const uint GL_PIXEL_MAP_R_TO_R = 3190;
public const uint GL_PIXEL_MAP_G_TO_G = 3191;
public const uint GL_PIXEL_MAP_B_TO_B = 3192;
public const uint GL_PIXEL_MAP_A_TO_A = 3193;
public const uint GL_PIXEL_MAP_I_TO_I_SIZE = 3248;
public const uint GL_PIXEL_MAP_S_TO_S_SIZE = 3249;
public const uint GL_PIXEL_MAP_I_TO_R_SIZE = 3250;
public const uint GL_PIXEL_MAP_I_TO_G_SIZE = 3251;
public const uint GL_PIXEL_MAP_I_TO_B_SIZE = 3252;
public const uint GL_PIXEL_MAP_I_TO_A_SIZE = 3253;
public const uint GL_PIXEL_MAP_R_TO_R_SIZE = 3254;
public const uint GL_PIXEL_MAP_G_TO_G_SIZE = 3255;
public const uint GL_PIXEL_MAP_B_TO_B_SIZE = 3256;
public const uint GL_PIXEL_MAP_A_TO_A_SIZE = 3257;
public const uint GL_UNPACK_SWAP_BYTES = 3312;
public const uint GL_UNPACK_LSB_FIRST = 3313;
public const uint GL_UNPACK_ROW_LENGTH = 3314;
public const uint GL_UNPACK_SKIP_ROWS = 3315;
public const uint GL_UNPACK_SKIP_PIXELS = 3316;
public const uint GL_UNPACK_ALIGNMENT = 3317;
public const uint GL_PACK_SWAP_BYTES = 3328;
public const uint GL_PACK_LSB_FIRST = 3329;
public const uint GL_PACK_ROW_LENGTH = 3330;
public const uint GL_PACK_SKIP_ROWS = 3331;
public const uint GL_PACK_SKIP_PIXELS = 3332;
public const uint GL_PACK_ALIGNMENT = 3333;
public const uint GL_MAP_COLOR = 3344;
public const uint GL_MAP_STENCIL = 3345;
public const uint GL_INDEX_SHIFT = 3346;
public const uint GL_INDEX_OFFSET = 3347;
public const uint GL_RED_SCALE = 3348;
public const uint GL_RED_BIAS = 3349;
public const uint GL_ZOOM_X = 3350;
public const uint GL_ZOOM_Y = 3351;
public const uint GL_GREEN_SCALE = 3352;
public const uint GL_GREEN_BIAS = 3353;
public const uint GL_BLUE_SCALE = 3354;
public const uint GL_BLUE_BIAS = 3355;
public const uint GL_ALPHA_SCALE = 3356;
public const uint GL_ALPHA_BIAS = 3357;
public const uint GL_DEPTH_SCALE = 3358;
public const uint GL_DEPTH_BIAS = 3359;
public const uint GL_MAX_EVAL_ORDER = 3376;
public const uint GL_MAX_LIGHTS = 3377;
public const uint GL_MAX_CLIP_PLANES = 3378;
public const uint GL_MAX_TEXTURE_SIZE = 3379;
public const uint GL_MAX_PIXEL_MAP_TABLE = 3380;
public const uint GL_MAX_ATTRIB_STACK_DEPTH = 3381;
public const uint GL_MAX_MODELVIEW_STACK_DEPTH = 3382;
public const uint GL_MAX_NAME_STACK_DEPTH = 3383;
public const uint GL_MAX_PROJECTION_STACK_DEPTH = 3384;
public const uint GL_MAX_TEXTURE_STACK_DEPTH = 3385;
public const uint GL_MAX_VIEWPORT_DIMS = 3386;
public const uint GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 3387;
public const uint GL_SUBPIXEL_BITS = 3408;
public const uint GL_INDEX_BITS = 3409;
public const uint GL_RED_BITS = 3410;
public const uint GL_GREEN_BITS = 3411;
public const uint GL_BLUE_BITS = 3412;
public const uint GL_ALPHA_BITS = 3413;
public const uint GL_DEPTH_BITS = 3414;
public const uint GL_STENCIL_BITS = 3415;
public const uint GL_ACCUM_RED_BITS = 3416;
public const uint GL_ACCUM_GREEN_BITS = 3417;
public const uint GL_ACCUM_BLUE_BITS = 3418;
public const uint GL_ACCUM_ALPHA_BITS = 3419;
public const uint GL_NAME_STACK_DEPTH = 3440;
public const uint GL_AUTO_NORMAL = 3456;
public const uint GL_MAP1_COLOR_4 = 3472;
public const uint GL_MAP1_INDEX = 3473;
public const uint GL_MAP1_NORMAL = 3474;
public const uint GL_MAP1_TEXTURE_COORD_1 = 3475;
public const uint GL_MAP1_TEXTURE_COORD_2 = 3476;
public const uint GL_MAP1_TEXTURE_COORD_3 = 3477;
public const uint GL_MAP1_TEXTURE_COORD_4 = 3478;
public const uint GL_MAP1_VERTEX_3 = 3479;
public const uint GL_MAP1_VERTEX_4 = 3480;
public const uint GL_MAP2_COLOR_4 = 3504;
public const uint GL_MAP2_INDEX = 3505;
public const uint GL_MAP2_NORMAL = 3506;
public const uint GL_MAP2_TEXTURE_COORD_1 = 3507;
public const uint GL_MAP2_TEXTURE_COORD_2 = 3508;
public const uint GL_MAP2_TEXTURE_COORD_3 = 3509;
public const uint GL_MAP2_TEXTURE_COORD_4 = 3510;
public const uint GL_MAP2_VERTEX_3 = 3511;
public const uint GL_MAP2_VERTEX_4 = 3512;
public const uint GL_MAP1_GRID_DOMAIN = 3536;
public const uint GL_MAP1_GRID_SEGMENTS = 3537;
public const uint GL_MAP2_GRID_DOMAIN = 3538;
public const uint GL_MAP2_GRID_SEGMENTS = 3539;
public const uint GL_TEXTURE_1D = 3552;
public const uint GL_TEXTURE_2D = 3553;
public const uint GL_FEEDBACK_BUFFER_POINTER = 3568;
public const uint GL_FEEDBACK_BUFFER_SIZE = 3569;
public const uint GL_FEEDBACK_BUFFER_TYPE = 3570;
public const uint GL_SELECTION_BUFFER_POINTER = 3571;
public const uint GL_SELECTION_BUFFER_SIZE = 3572;
public const uint GL_TEXTURE_WIDTH = 4096;
public const uint GL_TEXTURE_HEIGHT = 4097;
public const uint GL_TEXTURE_INTERNAL_FORMAT = 4099;
public const uint GL_TEXTURE_BORDER_COLOR = 4100;
public const uint GL_TEXTURE_BORDER = 4101;
public const uint GL_DONT_CARE = 4352;
public const uint GL_FASTEST = 4353;
public const uint GL_NICEST = 4354;
public const uint GL_LIGHT0 = 16384;
public const uint GL_LIGHT1 = 16385;
public const uint GL_LIGHT2 = 16386;
public const uint GL_LIGHT3 = 16387;
public const uint GL_LIGHT4 = 16388;
public const uint GL_LIGHT5 = 16389;
public const uint GL_LIGHT6 = 16390;
public const uint GL_LIGHT7 = 16391;
public const uint GL_AMBIENT = 4608;
public const uint GL_DIFFUSE = 4609;
public const uint GL_SPECULAR = 4610;
public const uint GL_POSITION = 4611;
public const uint GL_SPOT_DIRECTION = 4612;
public const uint GL_SPOT_EXPONENT = 4613;
public const uint GL_SPOT_CUTOFF = 4614;
public const uint GL_CONSTANT_ATTENUATION = 4615;
public const uint GL_LINEAR_ATTENUATION = 4616;
public const uint GL_QUADRATIC_ATTENUATION = 4617;
public const uint GL_COMPILE = 4864;
public const uint GL_COMPILE_AND_EXECUTE = 4865;
public const uint GL_CLEAR = 5376;
public const uint GL_AND = 5377;
public const uint GL_AND_REVERSE = 5378;
public const uint GL_COPY = 5379;
public const uint GL_AND_INVERTED = 5380;
public const uint GL_NOOP = 5381;
public const uint GL_XOR = 5382;
public const uint GL_OR = 5383;
public const uint GL_NOR = 5384;
public const uint GL_EQUIV = 5385;
public const uint GL_INVERT = 5386;
public const uint GL_OR_REVERSE = 5387;
public const uint GL_COPY_INVERTED = 5388;
public const uint GL_OR_INVERTED = 5389;
public const uint GL_NAND = 5390;
public const uint GL_SET = 5391;
public const uint GL_EMISSION = 5632;
public const uint GL_SHININESS = 5633;
public const uint GL_AMBIENT_AND_DIFFUSE = 5634;
public const uint GL_COLOR_INDEXES = 5635;
public const uint GL_MODELVIEW = 5888;
public const uint GL_PROJECTION = 5889;
public const uint GL_TEXTURE = 5890;
public const uint GL_COLOR = 6144;
public const uint GL_DEPTH = 6145;
public const uint GL_STENCIL = 6146;
public const uint GL_COLOR_INDEX = 6400;
public const uint GL_STENCIL_INDEX = 6401;
public const uint GL_DEPTH_COMPONENT = 6402;
public const uint GL_RED = 6403;
public const uint GL_GREEN = 6404;
public const uint GL_BLUE = 6405;
public const uint GL_ALPHA = 6406;
public const uint GL_RGB = 6407;
public const uint GL_RGBA = 6408;
public const uint GL_LUMINANCE = 6409;
public const uint GL_LUMINANCE_ALPHA = 6410;
public const uint GL_BITMAP = 6656;
public const uint GL_POINT = 6912;
public const uint GL_LINE = 6913;
public const uint GL_FILL = 6914;
public const uint GL_RENDER = 7168;
public const uint GL_FEEDBACK = 7169;
public const uint GL_SELECT = 7170;
public const uint GL_FLAT = 7424;
public const uint GL_SMOOTH = 7425;
public const uint GL_KEEP = 7680;
public const uint GL_REPLACE = 7681;
public const uint GL_INCR = 7682;
public const uint GL_DECR = 7683;
public const uint GL_VENDOR = 7936;
public const uint GL_RENDERER = 7937;
public const uint GL_VERSION = 7938;
public const uint GL_EXTENSIONS = 7939;
public const uint GL_S = 8192;
public const uint GL_T = 8193;
public const uint GL_R = 8194;
public const uint GL_Q = 8195;
public const uint GL_MODULATE = 8448;
public const uint GL_DECAL = 8449;
public const uint GL_TEXTURE_ENV_MODE = 8704;
public const uint GL_TEXTURE_ENV_COLOR = 8705;
public const uint GL_TEXTURE_ENV = 8960;
public const uint GL_EYE_LINEAR = 9216;
public const uint GL_OBJECT_LINEAR = 9217;
public const uint GL_SPHERE_MAP = 9218;
public const uint GL_TEXTURE_GEN_MODE = 9472;
public const uint GL_OBJECT_PLANE = 9473;
public const uint GL_EYE_PLANE = 9474;
public const uint GL_NEAREST = 9728;
public const uint GL_LINEAR = 9729;
public const uint GL_NEAREST_MIPMAP_NEAREST = 9984;
public const uint GL_LINEAR_MIPMAP_NEAREST = 9985;
public const uint GL_NEAREST_MIPMAP_LINEAR = 9986;
public const uint GL_LINEAR_MIPMAP_LINEAR = 9987;
public const uint GL_TEXTURE_MAG_FILTER = 10240;
public const uint GL_TEXTURE_MIN_FILTER = 10241;
public const uint GL_TEXTURE_WRAP_S = 10242;
public const uint GL_TEXTURE_WRAP_T = 10243;
public const uint GL_CLAMP = 10496;
public const uint GL_REPEAT = 10497;
public const int GL_CLIENT_PIXEL_STORE_BIT = 1;
public const int GL_CLIENT_VERTEX_ARRAY_BIT = 2;
public const int GL_CLIENT_ALL_ATTRIB_BITS = -1;
public const uint GL_POLYGON_OFFSET_FACTOR = 32824;
public const uint GL_POLYGON_OFFSET_UNITS = 10752;
public const uint GL_POLYGON_OFFSET_POINT = 10753;
public const uint GL_POLYGON_OFFSET_LINE = 10754;
public const uint GL_POLYGON_OFFSET_FILL = 32823;
public const uint GL_ALPHA4 = 32827;
public const uint GL_ALPHA8 = 32828;
public const uint GL_ALPHA12 = 32829;
public const uint GL_ALPHA16 = 32830;
public const uint GL_LUMINANCE4 = 32831;
public const uint GL_LUMINANCE8 = 32832;
public const uint GL_LUMINANCE12 = 32833;
public const uint GL_LUMINANCE16 = 32834;
public const uint GL_LUMINANCE4_ALPHA4 = 32835;
public const uint GL_LUMINANCE6_ALPHA2 = 32836;
public const uint GL_LUMINANCE8_ALPHA8 = 32837;
public const uint GL_LUMINANCE12_ALPHA4 = 32838;
public const uint GL_LUMINANCE12_ALPHA12 = 32839;
public const uint GL_LUMINANCE16_ALPHA16 = 32840;
public const uint GL_INTENSITY = 32841;
public const uint GL_INTENSITY4 = 32842;
public const uint GL_INTENSITY8 = 32843;
public const uint GL_INTENSITY12 = 32844;
public const uint GL_INTENSITY16 = 32845;
public const uint GL_R3_G3_B2 = 10768;
public const uint GL_RGB4 = 32847;
public const uint GL_RGB5 = 32848;
public const uint GL_RGB8 = 32849;
public const uint GL_RGB10 = 32850;
public const uint GL_RGB12 = 32851;
public const uint GL_RGB16 = 32852;
public const uint GL_RGBA2 = 32853;
public const uint GL_RGBA4 = 32854;
public const uint GL_RGB5_A1 = 32855;
public const uint GL_RGBA8 = 32856;
public const uint GL_RGB10_A2 = 32857;
public const uint GL_RGBA12 = 32858;
public const uint GL_RGBA16 = 32859;
public const uint GL_TEXTURE_RED_SIZE = 32860;
public const uint GL_TEXTURE_GREEN_SIZE = 32861;
public const uint GL_TEXTURE_BLUE_SIZE = 32862;
public const uint GL_TEXTURE_ALPHA_SIZE = 32863;
public const uint GL_TEXTURE_LUMINANCE_SIZE = 32864;
public const uint GL_TEXTURE_INTENSITY_SIZE = 32865;
public const uint GL_PROXY_TEXTURE_1D = 32867;
public const uint GL_PROXY_TEXTURE_2D = 32868;
public const uint GL_TEXTURE_PRIORITY = 32870;
public const uint GL_TEXTURE_RESIDENT = 32871;
public const uint GL_TEXTURE_BINDING_1D = 32872;
public const uint GL_TEXTURE_BINDING_2D = 32873;
public const uint GL_VERTEX_ARRAY = 32884;
public const uint GL_NORMAL_ARRAY = 32885;
public const uint GL_COLOR_ARRAY = 32886;
public const uint GL_INDEX_ARRAY = 32887;
public const uint GL_TEXTURE_COORD_ARRAY = 32888;
public const uint GL_EDGE_FLAG_ARRAY = 32889;
public const uint GL_VERTEX_ARRAY_SIZE = 32890;
public const uint GL_VERTEX_ARRAY_TYPE = 32891;
public const uint GL_VERTEX_ARRAY_STRIDE = 32892;
public const uint GL_NORMAL_ARRAY_TYPE = 32894;
public const uint GL_NORMAL_ARRAY_STRIDE = 32895;
public const uint GL_COLOR_ARRAY_SIZE = 32897;
public const uint GL_COLOR_ARRAY_TYPE = 32898;
public const uint GL_COLOR_ARRAY_STRIDE = 32899;
public const uint GL_INDEX_ARRAY_TYPE = 32901;
public const uint GL_INDEX_ARRAY_STRIDE = 32902;
public const uint GL_TEXTURE_COORD_ARRAY_SIZE = 32904;
public const uint GL_TEXTURE_COORD_ARRAY_TYPE = 32905;
public const uint GL_TEXTURE_COORD_ARRAY_STRIDE = 32906;
public const uint GL_EDGE_FLAG_ARRAY_STRIDE = 32908;
public const uint GL_VERTEX_ARRAY_POINTER = 32910;
public const uint GL_NORMAL_ARRAY_POINTER = 32911;
public const uint GL_COLOR_ARRAY_POINTER = 32912;
public const uint GL_INDEX_ARRAY_POINTER = 32913;
public const uint GL_TEXTURE_COORD_ARRAY_POINTER = 32914;
public const uint GL_EDGE_FLAG_ARRAY_POINTER = 32915;
public const uint GL_V2F = 10784;
public const uint GL_V3F = 10785;
public const uint GL_C4UB_V2F = 10786;
public const uint GL_C4UB_V3F = 10787;
public const uint GL_C3F_V3F = 10788;
public const uint GL_N3F_V3F = 10789;
public const uint GL_C4F_N3F_V3F = 10790;
public const uint GL_T2F_V3F = 10791;
public const uint GL_T4F_V4F = 10792;
public const uint GL_T2F_C4UB_V3F = 10793;
public const uint GL_T2F_C3F_V3F = 10794;
public const uint GL_T2F_N3F_V3F = 10795;
public const uint GL_T2F_C4F_N3F_V3F = 10796;
public const uint GL_T4F_C4F_N3F_V4F = 10797;
public const uint GL_EXT_vertex_array = 1;
public const uint GL_EXT_bgra = 1;
public const uint GL_EXT_paletted_texture = 1;
public const uint GL_WIN_swap_hint = 1;
public const uint GL_WIN_draw_range_elements = 1;
public const uint GL_VERTEX_ARRAY_EXT = 32884;
public const uint GL_NORMAL_ARRAY_EXT = 32885;
public const uint GL_COLOR_ARRAY_EXT = 32886;
public const uint GL_INDEX_ARRAY_EXT = 32887;
public const uint GL_TEXTURE_COORD_ARRAY_EXT = 32888;
public const uint GL_EDGE_FLAG_ARRAY_EXT = 32889;
public const uint GL_VERTEX_ARRAY_SIZE_EXT = 32890;
public const uint GL_VERTEX_ARRAY_TYPE_EXT = 32891;
public const uint GL_VERTEX_ARRAY_STRIDE_EXT = 32892;
public const uint GL_VERTEX_ARRAY_COUNT_EXT = 32893;
public const uint GL_NORMAL_ARRAY_TYPE_EXT = 32894;
public const uint GL_NORMAL_ARRAY_STRIDE_EXT = 32895;
public const uint GL_NORMAL_ARRAY_COUNT_EXT = 32896;
public const uint GL_COLOR_ARRAY_SIZE_EXT = 32897;
public const uint GL_COLOR_ARRAY_TYPE_EXT = 32898;
public const uint GL_COLOR_ARRAY_STRIDE_EXT = 32899;
public const uint GL_COLOR_ARRAY_COUNT_EXT = 32900;
public const uint GL_INDEX_ARRAY_TYPE_EXT = 32901;
public const uint GL_INDEX_ARRAY_STRIDE_EXT = 32902;
public const uint GL_INDEX_ARRAY_COUNT_EXT = 32903;
public const uint GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 32904;
public const uint GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 32905;
public const uint GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 32906;
public const uint GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 32907;
public const uint GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 32908;
public const uint GL_EDGE_FLAG_ARRAY_COUNT_EXT = 32909;
public const uint GL_VERTEX_ARRAY_POINTER_EXT = 32910;
public const uint GL_NORMAL_ARRAY_POINTER_EXT = 32911;
public const uint GL_COLOR_ARRAY_POINTER_EXT = 32912;
public const uint GL_INDEX_ARRAY_POINTER_EXT = 32913;
public const uint GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 32914;
public const uint GL_EDGE_FLAG_ARRAY_POINTER_EXT = 32915;
public const uint GL_DOUBLE_EXT = GL_DOUBLE;
public const uint GL_BGR_EXT = 32992;
public const uint GL_BGRA_EXT = 32993;
public const uint GL_COLOR_TABLE_FORMAT_EXT = 32984;
public const uint GL_COLOR_TABLE_WIDTH_EXT = 32985;
public const uint GL_COLOR_TABLE_RED_SIZE_EXT = 32986;
public const uint GL_COLOR_TABLE_GREEN_SIZE_EXT = 32987;
public const uint GL_COLOR_TABLE_BLUE_SIZE_EXT = 32988;
public const uint GL_COLOR_TABLE_ALPHA_SIZE_EXT = 32989;
public const uint GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 32990;
public const uint GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 32991;
public const uint GL_COLOR_INDEX1_EXT = 32994;
public const uint GL_COLOR_INDEX2_EXT = 32995;
public const uint GL_COLOR_INDEX4_EXT = 32996;
public const uint GL_COLOR_INDEX8_EXT = 32997;
public const uint GL_COLOR_INDEX12_EXT = 32998;
public const uint GL_COLOR_INDEX16_EXT = 32999;
public const uint GL_MAX_ELEMENTS_VERTICES_WIN = 33000;
public const uint GL_MAX_ELEMENTS_INDICES_WIN = 33001;
public const uint GL_PHONG_WIN = 33002;
public const uint GL_PHONG_HINT_WIN = 33003;
public const uint GL_FOG_SPECULAR_TEXTURE_WIN = 33004;
public const uint GL_LOGIC_OP = GL_INDEX_LOGIC_OP;
public const uint GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT;
#endregion
#region Delegates
public delegate void PFNGLARRAYELEMENTEXTPROC( int i );
public delegate void PFNGLDRAWARRAYSEXTPROC( uint mode, int first, int count );
public delegate void PFNGLVERTEXPOINTEREXTPROC( int size, uint type, int stride, int count, IntPtr pointer );
public delegate void PFNGLNORMALPOINTEREXTPROC( uint type, int stride, int count, IntPtr pointer );
public delegate void PFNGLCOLORPOINTEREXTPROC( int size, uint type, int stride, int count, IntPtr pointer );
public delegate void PFNGLINDEXPOINTEREXTPROC( uint type, int stride, int count, IntPtr pointer );
public delegate void PFNGLTEXCOORDPOINTEREXTPROC( int size, uint type, int stride, int count, IntPtr pointer );
public delegate void PFNGLEDGEFLAGPOINTEREXTPROC( int stride, int count, [In] [MarshalAs( UnmanagedType.LPStr )] string pointer );
public delegate void PFNGLGETPOINTERVEXTPROC( uint pname, IntPtr[] parameters );
public delegate void PFNGLARRAYELEMENTARRAYEXTPROC( uint mode, int count, IntPtr pi );
public delegate void PFNGLDRAWRANGEELEMENTSWINPROC( uint mode, uint start, uint end, int count, uint type, IntPtr indices );
public delegate void PFNGLADDSWAPHINTRECTWINPROC( int x, int y, int width, int height );
public delegate void PFNGLCOLORTABLEEXTPROC( uint target, uint internalFormat, int width, uint format, uint type, IntPtr data );
public delegate void PFNGLCOLORSUBTABLEEXTPROC( uint target, int start, int count, uint format, uint type, IntPtr data );
public delegate void PFNGLGETCOLORTABLEEXTPROC( uint target, uint format, uint type, IntPtr data );
public delegate void PFNGLGETCOLORTABLEPARAMETERIVEXTPROC( uint target, uint pname, int[] parameters );
public delegate void PFNGLGETCOLORTABLEPARAMETERFVEXTPROC( uint target, uint pname, float[] parameters );
public delegate void PFNGLACCUMPROC( uint op, float value );
public delegate void PFNGLALPHAFUNCPROC( uint func, float alpha );
public delegate byte PFNGLARETEXTURESRESIDENTPROC( int n, uint[] textures, IntPtr residences );
public delegate void PFNGLARRAYELEMENTPROC( int i );
public delegate void PFNGLBEGINPROC( uint mode );
public delegate void PFNGLBINDTEXTUREPROC( uint target, uint texture );
public delegate void PFNGLBITMAPPROC( int width, int height, float xorig, float yorig, float xmove, float ymove, [In] [MarshalAs( UnmanagedType.LPStr )] string bitmap );
public delegate void PFNGLBLENDFUNCPROC( uint sfactor, uint dfactor );
public delegate void PFNGLCALLLISTPROC( uint list );
public delegate void PFNGLCALLLISTSPROC( int n, uint type, IntPtr lists );
public delegate void PFNGLCLEARPROC( uint mask );
public delegate void PFNGLCLEARACCUMPROC( float red, float green, float blue, float alpha );
public delegate void PFNGLCLEARCOLORPROC( float red, float green, float blue, float alpha );
public delegate void PFNGLCLEARDEPTHPROC( double depth );
public delegate void PFNGLCLEARINDEXPROC( float c );
public delegate void PFNGLCLEARSTENCILPROC( int s );
public delegate void PFNGLCLIPPLANEPROC( uint plane, double[] equation );
public delegate void PFNGLCOLOR3BPROC( byte red, byte green, byte blue );
public delegate void PFNGLCOLOR3BVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLCOLOR3DPROC( double red, double green, double blue );
public delegate void PFNGLCOLOR3DVPROC( double[] v );
public delegate void PFNGLCOLOR3FPROC( float red, float green, float blue );
public delegate void PFNGLCOLOR3FVPROC( float[] v );
public delegate void PFNGLCOLOR3IPROC( int red, int green, int blue );
public delegate void PFNGLCOLOR3IVPROC( int[] v );
public delegate void PFNGLCOLOR3SPROC( short red, short green, short blue );
public delegate void PFNGLCOLOR3SVPROC( short[] v );
public delegate void PFNGLCOLOR3UBPROC( byte red, byte green, byte blue );
public delegate void PFNGLCOLOR3UBVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLCOLOR3UIPROC( uint red, uint green, uint blue );
public delegate void PFNGLCOLOR3UIVPROC( uint[] v );
public delegate void PFNGLCOLOR3USPROC( ushort red, ushort green, ushort blue );
public delegate void PFNGLCOLOR3USVPROC( ushort[] v );
public delegate void PFNGLCOLOR4BPROC( byte red, byte green, byte blue, byte alpha );
public delegate void PFNGLCOLOR4BVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLCOLOR4DPROC( double red, double green, double blue, double alpha );
public delegate void PFNGLCOLOR4DVPROC( double[] v );
public delegate void PFNGLCOLOR4FPROC( float red, float green, float blue, float alpha );
public delegate void PFNGLCOLOR4FVPROC( float[] v );
public delegate void PFNGLCOLOR4IPROC( int red, int green, int blue, int alpha );
public delegate void PFNGLCOLOR4IVPROC( int[] v );
public delegate void PFNGLCOLOR4SPROC( short red, short green, short blue, short alpha );
public delegate void PFNGLCOLOR4SVPROC( short[] v );
public delegate void PFNGLCOLOR4UBPROC( byte red, byte green, byte blue, byte alpha );
public delegate void PFNGLCOLOR4UBVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLCOLOR4UIPROC( uint red, uint green, uint blue, uint alpha );
public delegate void PFNGLCOLOR4UIVPROC( uint[] v );
public delegate void PFNGLCOLOR4USPROC( ushort red, ushort green, ushort blue, ushort alpha );
public delegate void PFNGLCOLOR4USVPROC( ushort[] v );
public delegate void PFNGLCOLORMASKPROC( byte red, byte green, byte blue, byte alpha );
public delegate void PFNGLCOLORMATERIALPROC( uint face, uint mode );
public delegate void PFNGLCOLORPOINTERPROC( int size, uint type, int stride, IntPtr pointer );
public delegate void PFNGLCOPYPIXELSPROC( int x, int y, int width, int height, uint type );
public delegate void PFNGLCOPYTEXIMAGE1DPROC( uint target, int level, uint internalFormat, int x, int y, int width, int border );
public delegate void PFNGLCOPYTEXIMAGE2DPROC( uint target, int level, uint internalFormat, int x, int y, int width, int height, int border );
public delegate void PFNGLCOPYTEXSUBIMAGE1DPROC( uint target, int level, int xoffset, int x, int y, int width );
public delegate void PFNGLCOPYTEXSUBIMAGE2DPROC( uint target, int level, int xoffset, int yoffset, int x, int y, int width, int height );
public delegate void PFNGLCULLFACEPROC( uint mode );
public delegate void PFNGLDELETELISTSPROC( uint list, int range );
public delegate void PFNGLDELETETEXTURESPROC( int n, uint[] textures );
public delegate void PFNGLDEPTHFUNCPROC( uint func );
public delegate void PFNGLDEPTHMASKPROC( byte flag );
public delegate void PFNGLDEPTHRANGEPROC( double zNear, double zFar );
public delegate void PFNGLDISABLEPROC( uint cap );
public delegate void PFNGLDISABLECLIENTSTATEPROC( uint array );
public delegate void PFNGLDRAWARRAYSPROC( uint mode, int first, int count );
public delegate void PFNGLDRAWBUFFERPROC( uint mode );
public delegate void PFNGLDRAWELEMENTSPROC( uint mode, int count, uint type, IntPtr indices );
public delegate void PFNGLDRAWPIXELSPROC( int width, int height, uint format, uint type, IntPtr pixels );
public delegate void PFNGLEDGEFLAGPROC( byte flag );
public delegate void PFNGLEDGEFLAGPOINTERPROC( int stride, IntPtr pointer );
public delegate void PFNGLEDGEFLAGVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string flag );
public delegate void PFNGLENABLEPROC( uint cap );
public delegate void PFNGLENABLECLIENTSTATEPROC( uint array );
public delegate void PFNGLENDPROC();
public delegate void PFNGLENDLISTPROC();
public delegate void PFNGLEVALCOORD1DPROC( double u );
public delegate void PFNGLEVALCOORD1DVPROC( double[] u );
public delegate void PFNGLEVALCOORD1FPROC( float u );
public delegate void PFNGLEVALCOORD1FVPROC( float[] u );
public delegate void PFNGLEVALCOORD2DPROC( double u, double v );
public delegate void PFNGLEVALCOORD2DVPROC( double[] u );
public delegate void PFNGLEVALCOORD2FPROC( float u, float v );
public delegate void PFNGLEVALCOORD2FVPROC( float[] u );
public delegate void PFNGLEVALMESH1PROC( uint mode, int i1, int i2 );
public delegate void PFNGLEVALMESH2PROC( uint mode, int i1, int i2, int j1, int j2 );
public delegate void PFNGLEVALPOINT1PROC( int i );
public delegate void PFNGLEVALPOINT2PROC( int i, int j );
public delegate void PFNGLFEEDBACKBUFFERPROC( int size, uint type, float[] buffer );
public delegate void PFNGLFINISHPROC();
public delegate void PFNGLFLUSHPROC();
public delegate void PFNGLFOGFPROC( uint pname, float param );
public delegate void PFNGLFOGFVPROC( uint pname, float[] parameters );
public delegate void PFNGLFOGIPROC( uint pname, int param );
public delegate void PFNGLFOGIVPROC( uint pname, int[] parameters );
public delegate void PFNGLFRONTFACEPROC( uint mode );
public delegate void PFNGLFRUSTUMPROC( double left, double right, double bottom, double top, double zNear, double zFar );
public delegate uint PFNGLGENLISTSPROC( int range );
public delegate void PFNGLGENTEXTURESPROC( int n, ref uint textures );
public delegate void PFNGLGETBOOLEANVPROC( uint pname, IntPtr parameters );
public delegate void PFNGLGETCLIPPLANEPROC( uint plane, double[] equation );
public delegate void PFNGLGETDOUBLEVPROC( uint pname, double[] parameters );
public delegate uint PFNGLGETERRORPROC();
public delegate void PFNGLGETFLOATVPROC( uint pname, float[] parameters );
public delegate void PFNGLGETINTEGERVPROC( uint pname, int[] parameters );
public delegate void PFNGLGETLIGHTFVPROC( uint light, uint pname, float[] parameters );
public delegate void PFNGLGETLIGHTIVPROC( uint light, uint pname, int[] parameters );
public delegate void PFNGLGETMAPDVPROC( uint target, uint query, double[] v );
public delegate void PFNGLGETMAPFVPROC( uint target, uint query, float[] v );
public delegate void PFNGLGETMAPIVPROC( uint target, uint query, int[] v );
public delegate void PFNGLGETMATERIALFVPROC( uint face, uint pname, float[] parameters );
public delegate void PFNGLGETMATERIALIVPROC( uint face, uint pname, int[] parameters );
public delegate void PFNGLGETPIXELMAPFVPROC( uint map, float[] values );
public delegate void PFNGLGETPIXELMAPUIVPROC( uint map, uint[] values );
public delegate void PFNGLGETPIXELMAPUSVPROC( uint map, ushort[] values );
public delegate void PFNGLGETPOINTERVPROC( uint pname, ref IntPtr parameters );
public delegate void PFNGLGETPOLYGONSTIPPLEPROC( IntPtr mask );
public delegate void PFNGLGETTEXENVFVPROC( uint target, uint pname, float[] parameters );
public delegate void PFNGLGETTEXENVIVPROC( uint target, uint pname, int[] parameters );
public delegate void PFNGLGETTEXGENDVPROC( uint coord, uint pname, double[] parameters );
public delegate void PFNGLGETTEXGENFVPROC( uint coord, uint pname, float[] parameters );
public delegate void PFNGLGETTEXGENIVPROC( uint coord, uint pname, int[] parameters );
public delegate void PFNGLGETTEXIMAGEPROC( uint target, int level, uint format, uint type, IntPtr pixels );
public delegate void PFNGLGETTEXLEVELPARAMETERFVPROC( uint target, int level, uint pname, float[] parameters );
public delegate void PFNGLGETTEXLEVELPARAMETERIVPROC( uint target, int level, uint pname, int[] parameters );
public delegate void PFNGLGETTEXPARAMETERFVPROC( uint target, uint pname, float[] parameters );
public delegate void PFNGLGETTEXPARAMETERIVPROC( uint target, uint pname, int[] parameters );
public delegate void PFNGLHINTPROC( uint target, uint mode );
public delegate void PFNGLINDEXMASKPROC( uint mask );
public delegate void PFNGLINDEXPOINTERPROC( uint type, int stride, IntPtr pointer );
public delegate void PFNGLINDEXDPROC( double c );
public delegate void PFNGLINDEXDVPROC( double[] c );
public delegate void PFNGLINDEXFPROC( float c );
public delegate void PFNGLINDEXFVPROC( float[] c );
public delegate void PFNGLINDEXIPROC( int c );
public delegate void PFNGLINDEXIVPROC( int[] c );
public delegate void PFNGLINDEXSPROC( short c );
public delegate void PFNGLINDEXSVPROC( short[] c );
public delegate void PFNGLINDEXUBPROC( byte c );
public delegate void PFNGLINDEXUBVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string c );
public delegate void PFNGLINITNAMESPROC();
public delegate void PFNGLINTERLEAVEDARRAYSPROC( uint format, int stride, IntPtr pointer );
public delegate byte PFNGLISENABLEDPROC( uint cap );
public delegate byte PFNGLISLISTPROC( uint list );
public delegate byte PFNGLISTEXTUREPROC( uint texture );
public delegate void PFNGLLIGHTMODELFPROC( uint pname, float param );
public delegate void PFNGLLIGHTMODELFVPROC( uint pname, float[] parameters );
public delegate void PFNGLLIGHTMODELIPROC( uint pname, int param );
public delegate void PFNGLLIGHTMODELIVPROC( uint pname, int[] parameters );
public delegate void PFNGLLIGHTFPROC( uint light, uint pname, float param );
public delegate void PFNGLLIGHTFVPROC( uint light, uint pname, float[] parameters );
public delegate void PFNGLLIGHTIPROC( uint light, uint pname, int param );
public delegate void PFNGLLIGHTIVPROC( uint light, uint pname, int[] parameters );
public delegate void PFNGLLINESTIPPLEPROC( int factor, ushort pattern );
public delegate void PFNGLLINEWIDTHPROC( float width );
public delegate void PFNGLLISTBASEPROC( uint b );
public delegate void PFNGLLOADIDENTITYPROC();
public delegate void PFNGLLOADMATRIXDPROC( double[] m );
public delegate void PFNGLLOADMATRIXFPROC( float[] m );
public delegate void PFNGLLOADNAMEPROC( uint name );
public delegate void PFNGLLOGICOPPROC( uint opcode );
public delegate void PFNGLMAP1DPROC( uint target, double u1, double u2, int stride, int order, double[] points );
public delegate void PFNGLMAP1FPROC( uint target, float u1, float u2, int stride, int order, float[] points );
public delegate void PFNGLMAP2DPROC( uint target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, double[] points );
public delegate void PFNGLMAP2FPROC( uint target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, float[] points );
public delegate void PFNGLMAPGRID1DPROC( int un, double u1, double u2 );
public delegate void PFNGLMAPGRID1FPROC( int un, float u1, float u2 );
public delegate void PFNGLMAPGRID2DPROC( int un, double u1, double u2, int vn, double v1, double v2 );
public delegate void PFNGLMAPGRID2FPROC( int un, float u1, float u2, int vn, float v1, float v2 );
public delegate void PFNGLMATERIALFPROC( uint face, uint pname, float param );
public delegate void PFNGLMATERIALFVPROC( uint face, uint pname, float[] parameters );
public delegate void PFNGLMATERIALIPROC( uint face, uint pname, int param );
public delegate void PFNGLMATERIALIVPROC( uint face, uint pname, int[] parameters );
public delegate void PFNGLMATRIXMODEPROC( uint mode );
public delegate void PFNGLMULTMATRIXDPROC( double[] m );
public delegate void PFNGLMULTMATRIXFPROC( float[] m );
public delegate void PFNGLNEWLISTPROC( uint list, uint mode );
public delegate void PFNGLNORMAL3BPROC( byte nx, byte ny, byte nz );
public delegate void PFNGLNORMAL3BVPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLNORMAL3DPROC( double nx, double ny, double nz );
public delegate void PFNGLNORMAL3DVPROC( double[] v );
public delegate void PFNGLNORMAL3FPROC( float nx, float ny, float nz );
public delegate void PFNGLNORMAL3FVPROC( float[] v );
public delegate void PFNGLNORMAL3IPROC( int nx, int ny, int nz );
public delegate void PFNGLNORMAL3IVPROC( int[] v );
public delegate void PFNGLNORMAL3SPROC( short nx, short ny, short nz );
public delegate void PFNGLNORMAL3SVPROC( short[] v );
public delegate void PFNGLNORMALPOINTERPROC( uint type, int stride, IntPtr pointer );
public delegate void PFNGLORTHOPROC( double left, double right, double bottom, double top, double zNear, double zFar );
public delegate void PFNGLPASSTHROUGHPROC( float token );
public delegate void PFNGLPIXELMAPFVPROC( uint map, int mapsize, float[] values );
public delegate void PFNGLPIXELMAPUIVPROC( uint map, int mapsize, uint[] values );
public delegate void PFNGLPIXELMAPUSVPROC( uint map, int mapsize, ushort[] values );
public delegate void PFNGLPIXELSTOREFPROC( uint pname, float param );
public delegate void PFNGLPIXELSTOREIPROC( uint pname, int param );
public delegate void PFNGLPIXELTRANSFERFPROC( uint pname, float param );
public delegate void PFNGLPIXELTRANSFERIPROC( uint pname, int param );
public delegate void PFNGLPIXELZOOMPROC( float xfactor, float yfactor );
public delegate void PFNGLPOINTSIZEPROC( float size );
public delegate void PFNGLPOLYGONMODEPROC( uint face, uint mode );
public delegate void PFNGLPOLYGONOFFSETPROC( float factor, float units );
public delegate void PFNGLPOLYGONSTIPPLEPROC( [In] [MarshalAs( UnmanagedType.LPStr )] string mask );
public delegate void PFNGLPOPATTRIBPROC();
public delegate void PFNGLPOPCLIENTATTRIBPROC();
public delegate void PFNGLPOPMATRIXPROC();
public delegate void PFNGLPOPNAMEPROC();
public delegate void PFNGLPRIORITIZETEXTURESPROC( int n, uint[] textures, float[] priorities );
public delegate void PFNGLPUSHATTRIBPROC( uint mask );
public delegate void PFNGLPUSHCLIENTATTRIBPROC( uint mask );
public delegate void PFNGLPUSHMATRIXPROC();
public delegate void PFNGLPUSHNAMEPROC( uint name );
public delegate void PFNGLRASTERPOS2DPROC( double x, double y );
public delegate void PFNGLRASTERPOS2DVPROC( double[] v );
public delegate void PFNGLRASTERPOS2FPROC( float x, float y );
public delegate void PFNGLRASTERPOS2FVPROC( float[] v );
public delegate void PFNGLRASTERPOS2IPROC( int x, int y );
public delegate void PFNGLRASTERPOS2IVPROC( int[] v );
public delegate void PFNGLRASTERPOS2SPROC( short x, short y );
public delegate void PFNGLRASTERPOS2SVPROC( short[] v );
public delegate void PFNGLRASTERPOS3DPROC( double x, double y, double z );
public delegate void PFNGLRASTERPOS3DVPROC( double[] v );
public delegate void PFNGLRASTERPOS3FPROC( float x, float y, float z );
public delegate void PFNGLRASTERPOS3FVPROC( float[] v );
public delegate void PFNGLRASTERPOS3IPROC( int x, int y, int z );
public delegate void PFNGLRASTERPOS3IVPROC( int[] v );
public delegate void PFNGLRASTERPOS3SPROC( short x, short y, short z );
public delegate void PFNGLRASTERPOS3SVPROC( short[] v );
public delegate void PFNGLRASTERPOS4DPROC( double x, double y, double z, double w );
public delegate void PFNGLRASTERPOS4DVPROC( double[] v );
public delegate void PFNGLRASTERPOS4FPROC( float x, float y, float z, float w );
public delegate void PFNGLRASTERPOS4FVPROC( float[] v );
public delegate void PFNGLRASTERPOS4IPROC( int x, int y, int z, int w );
public delegate void PFNGLRASTERPOS4IVPROC( int[] v );
public delegate void PFNGLRASTERPOS4SPROC( short x, short y, short z, short w );
public delegate void PFNGLRASTERPOS4SVPROC( short[] v );
public delegate void PFNGLREADBUFFERPROC( uint mode );
public delegate void PFNGLREADPIXELSPROC( int x, int y, int width, int height, uint format, uint type, IntPtr pixels );
public delegate void PFNGLRECTDPROC( double x1, double y1, double x2, double y2 );
public delegate void PFNGLRECTDVPROC( double[] v1, double[] v2 );
public delegate void PFNGLRECTFPROC( float x1, float y1, float x2, float y2 );
public delegate void PFNGLRECTFVPROC( float[] v1, float[] v2 );
public delegate void PFNGLRECTIPROC( int x1, int y1, int x2, int y2 );
public delegate void PFNGLRECTIVPROC( int[] v1, int[] v2 );
public delegate void PFNGLRECTSPROC( short x1, short y1, short x2, short y2 );
public delegate void PFNGLRECTSVPROC( short[] v1, short[] v2 );
public delegate int PFNGLRENDERMODEPROC( uint mode );
public delegate void PFNGLROTATEDPROC( double angle, double x, double y, double z );
public delegate void PFNGLROTATEFPROC( float angle, float x, float y, float z );
public delegate void PFNGLSCALEDPROC( double x, double y, double z );
public delegate void PFNGLSCALEFPROC( float x, float y, float z );
public delegate void PFNGLSCISSORPROC( int x, int y, int width, int height );
public delegate void PFNGLSELECTBUFFERPROC( int size, uint[] buffer );
public delegate void PFNGLSHADEMODELPROC( uint mode );
public delegate void PFNGLSTENCILFUNCPROC( uint func, int refer, uint mask );
public delegate void PFNGLSTENCILMASKPROC( uint mask );
public delegate void PFNGLSTENCILOPPROC( uint fail, uint zfail, uint zpass );
public delegate void PFNGLTEXCOORD1DPROC( double s );
public delegate void PFNGLTEXCOORD1DVPROC( double[] v );
public delegate void PFNGLTEXCOORD1FPROC( float s );
public delegate void PFNGLTEXCOORD1FVPROC( float[] v );
public delegate void PFNGLTEXCOORD1IPROC( int s );
public delegate void PFNGLTEXCOORD1IVPROC( int[] v );
public delegate void PFNGLTEXCOORD1SPROC( short s );
public delegate void PFNGLTEXCOORD1SVPROC( short[] v );
public delegate void PFNGLTEXCOORD2DPROC( double s, double t );
public delegate void PFNGLTEXCOORD2DVPROC( double[] v );
public delegate void PFNGLTEXCOORD2FPROC( float s, float t );
public delegate void PFNGLTEXCOORD2FVPROC( float[] v );
public delegate void PFNGLTEXCOORD2IPROC( int s, int t );
public delegate void PFNGLTEXCOORD2IVPROC( int[] v );
public delegate void PFNGLTEXCOORD2SPROC( short s, short t );
public delegate void PFNGLTEXCOORD2SVPROC( short[] v );
public delegate void PFNGLTEXCOORD3DPROC( double s, double t, double r );
public delegate void PFNGLTEXCOORD3DVPROC( double[] v );
public delegate void PFNGLTEXCOORD3FPROC( float s, float t, float r );
public delegate void PFNGLTEXCOORD3FVPROC( float[] v );
public delegate void PFNGLTEXCOORD3IPROC( int s, int t, int r );
public delegate void PFNGLTEXCOORD3IVPROC( int[] v );
public delegate void PFNGLTEXCOORD3SPROC( short s, short t, short r );
public delegate void PFNGLTEXCOORD3SVPROC( short[] v );
public delegate void PFNGLTEXCOORD4DPROC( double s, double t, double r, double q );
public delegate void PFNGLTEXCOORD4DVPROC( double[] v );
public delegate void PFNGLTEXCOORD4FPROC( float s, float t, float r, float q );
public delegate void PFNGLTEXCOORD4FVPROC( float[] v );
public delegate void PFNGLTEXCOORD4IPROC( int s, int t, int r, int q );
public delegate void PFNGLTEXCOORD4IVPROC( int[] v );
public delegate void PFNGLTEXCOORD4SPROC( short s, short t, short r, short q );
public delegate void PFNGLTEXCOORD4SVPROC( short[] v );
public delegate void PFNGLTEXCOORDPOINTERPROC( int size, uint type, int stride, IntPtr pointer );
public delegate void PFNGLTEXENVFPROC( uint target, uint pname, float param );
public delegate void PFNGLTEXENVFVPROC( uint target, uint pname, float[] parameters );
public delegate void PFNGLTEXENVIPROC( uint target, uint pname, int param );
public delegate void PFNGLTEXENVIVPROC( uint target, uint pname, int[] parameters );
public delegate void PFNGLTEXGENDPROC( uint coord, uint pname, double param );
public delegate void PFNGLTEXGENDVPROC( uint coord, uint pname, double[] parameters );
public delegate void PFNGLTEXGENFPROC( uint coord, uint pname, float param );
public delegate void PFNGLTEXGENFVPROC( uint coord, uint pname, float[] parameters );
public delegate void PFNGLTEXGENIPROC( uint coord, uint pname, int param );
public delegate void PFNGLTEXGENIVPROC( uint coord, uint pname, int[] parameters );
public delegate void PFNGLTEXIMAGE1DPROC( uint target, int level, int internalformat, int width, int border, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXIMAGE2DPROC( uint target, int level, int internalformat, int width, int height, int border, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXPARAMETERFPROC( uint target, uint pname, float param );
public delegate void PFNGLTEXPARAMETERFVPROC( uint target, uint pname, float[] parameters );
public delegate void PFNGLTEXPARAMETERIPROC( uint target, uint pname, int param );
public delegate void PFNGLTEXPARAMETERIVPROC( uint target, uint pname, int[] parameters );
public delegate void PFNGLTEXSUBIMAGE1DPROC( uint target, int level, int xoffset, int width, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXSUBIMAGE2DPROC( uint target, int level, int xoffset, int yoffset, int width, int height, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTRANSLATEDPROC( double x, double y, double z );
public delegate void PFNGLTRANSLATEFPROC( float x, float y, float z );
public delegate void PFNGLVERTEX2DPROC( double x, double y );
public delegate void PFNGLVERTEX2DVPROC( double[] v );
public delegate void PFNGLVERTEX2FPROC( float x, float y );
public delegate void PFNGLVERTEX2FVPROC( float[] v );
public delegate void PFNGLVERTEX2IPROC( int x, int y );
public delegate void PFNGLVERTEX2IVPROC( int[] v );
public delegate void PFNGLVERTEX2SPROC( short x, short y );
public delegate void PFNGLVERTEX2SVPROC( short[] v );
public delegate void PFNGLVERTEX3DPROC( double x, double y, double z );
public delegate void PFNGLVERTEX3DVPROC( double[] v );
public delegate void PFNGLVERTEX3FPROC( float x, float y, float z );
public delegate void PFNGLVERTEX3FVPROC( float[] v );
public delegate void PFNGLVERTEX3IPROC( int x, int y, int z );
public delegate void PFNGLVERTEX3IVPROC( int[] v );
public delegate void PFNGLVERTEX3SPROC( short x, short y, short z );
public delegate void PFNGLVERTEX3SVPROC( short[] v );
public delegate void PFNGLVERTEX4DPROC( double x, double y, double z, double w );
public delegate void PFNGLVERTEX4DVPROC( double[] v );
public delegate void PFNGLVERTEX4FPROC( float x, float y, float z, float w );
public delegate void PFNGLVERTEX4FVPROC( float[] v );
public delegate void PFNGLVERTEX4IPROC( int x, int y, int z, int w );
public delegate void PFNGLVERTEX4IVPROC( int[] v );
public delegate void PFNGLVERTEX4SPROC( short x, short y, short z, short w );
public delegate void PFNGLVERTEX4SVPROC( short[] v );
public delegate void PFNGLVERTEXPOINTERPROC( int size, uint type, int stride, IntPtr pointer );
public delegate void PFNGLVIEWPORTPROC( int x, int y, int width, int height );
public delegate IntPtr PFNGLGETSTRINGPROC( uint name );
#endregion
#region Methods
public static PFNGLACCUMPROC glAccum;
public static PFNGLALPHAFUNCPROC glAlphaFunc;
public static PFNGLARETEXTURESRESIDENTPROC glAreTexturesResident;
public static PFNGLARRAYELEMENTPROC glArrayElement;
public static PFNGLBEGINPROC glBegin;
public static PFNGLBINDTEXTUREPROC glBindTexture;
public static PFNGLBITMAPPROC glBitmap;
public static PFNGLBLENDFUNCPROC glBlendFunc;
public static PFNGLCALLLISTPROC glCallList;
public static PFNGLCALLLISTSPROC glCallLists;
public static PFNGLCLEARPROC glClear;
public static PFNGLCLEARACCUMPROC glClearAccum;
public static PFNGLCLEARCOLORPROC glClearColor;
public static PFNGLCLEARDEPTHPROC glClearDepth;
public static PFNGLCLEARINDEXPROC glClearIndex;
public static PFNGLCLEARSTENCILPROC glClearStencil;
public static PFNGLCLIPPLANEPROC glClipPlane;
public static PFNGLCOLOR3BPROC glColor3b;
public static PFNGLCOLOR3BVPROC glColor3bv;
public static PFNGLCOLOR3DPROC glColor3d;
public static PFNGLCOLOR3DVPROC glColor3dv;
public static PFNGLCOLOR3FPROC glColor3f;
public static PFNGLCOLOR3FVPROC glColor3fv;
public static PFNGLCOLOR3IPROC glColor3i;
public static PFNGLCOLOR3IVPROC glColor3iv;
public static PFNGLCOLOR3SPROC glColor3s;
public static PFNGLCOLOR3SVPROC glColor3sv;
public static PFNGLCOLOR3UBPROC glColor3ub;
public static PFNGLCOLOR3UBVPROC glColor3ubv;
public static PFNGLCOLOR3UIPROC glColor3ui;
public static PFNGLCOLOR3UIVPROC glColor3uiv;
public static PFNGLCOLOR3USPROC glColor3us;
public static PFNGLCOLOR3USVPROC glColor3usv;
public static PFNGLCOLOR4BPROC glColor4b;
public static PFNGLCOLOR4BVPROC glColor4bv;
public static PFNGLCOLOR4DPROC glColor4d;
public static PFNGLCOLOR4DVPROC glColor4dv;
public static PFNGLCOLOR4FPROC glColor4f;
public static PFNGLCOLOR4FVPROC glColor4fv;
public static PFNGLCOLOR4IPROC glColor4i;
public static PFNGLCOLOR4IVPROC glColor4iv;
public static PFNGLCOLOR4SPROC glColor4s;
public static PFNGLCOLOR4SVPROC glColor4sv;
public static PFNGLCOLOR4UBPROC glColor4ub;
public static PFNGLCOLOR4UBVPROC glColor4ubv;
public static PFNGLCOLOR4UIPROC glColor4ui;
public static PFNGLCOLOR4UIVPROC glColor4uiv;
public static PFNGLCOLOR4USPROC glColor4us;
public static PFNGLCOLOR4USVPROC glColor4usv;
public static PFNGLCOLORMASKPROC glColorMask;
public static PFNGLCOLORMATERIALPROC glColorMaterial;
public static PFNGLCOLORPOINTERPROC glColorPointer;
public static PFNGLCOPYPIXELSPROC glCopyPixels;
public static PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D;
public static PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D;
public static PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D;
public static PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D;
public static PFNGLCULLFACEPROC glCullFace;
public static PFNGLDELETELISTSPROC glDeleteLists;
public static PFNGLDELETETEXTURESPROC glDeleteTextures;
public static PFNGLDEPTHFUNCPROC glDepthFunc;
public static PFNGLDEPTHMASKPROC glDepthMask;
public static PFNGLDEPTHRANGEPROC glDepthRange;
public static PFNGLDISABLEPROC glDisable;
public static PFNGLDISABLECLIENTSTATEPROC glDisableClientState;
public static PFNGLDRAWARRAYSPROC glDrawArrays;
public static PFNGLDRAWBUFFERPROC glDrawBuffer;
public static PFNGLDRAWELEMENTSPROC glDrawElements;
public static PFNGLDRAWPIXELSPROC glDrawPixels;
public static PFNGLEDGEFLAGPROC glEdgeFlag;
public static PFNGLEDGEFLAGPOINTERPROC glEdgeFlagPointer;
public static PFNGLEDGEFLAGVPROC glEdgeFlagv;
public static PFNGLENABLEPROC glEnable;
public static PFNGLENABLECLIENTSTATEPROC glEnableClientState;
public static PFNGLENDPROC glEnd;
public static PFNGLENDLISTPROC glEndList;
public static PFNGLEVALCOORD1DPROC glEvalCoord1d;
public static PFNGLEVALCOORD1DVPROC glEvalCoord1dv;
public static PFNGLEVALCOORD1FPROC glEvalCoord1f;
public static PFNGLEVALCOORD1FVPROC glEvalCoord1fv;
public static PFNGLEVALCOORD2DPROC glEvalCoord2d;
public static PFNGLEVALCOORD2DVPROC glEvalCoord2dv;
public static PFNGLEVALCOORD2FPROC glEvalCoord2f;
public static PFNGLEVALCOORD2FVPROC glEvalCoord2fv;
public static PFNGLEVALMESH1PROC glEvalMesh1;
public static PFNGLEVALMESH2PROC glEvalMesh2;
public static PFNGLEVALPOINT1PROC glEvalPoint1;
public static PFNGLEVALPOINT2PROC glEvalPoint2;
public static PFNGLFEEDBACKBUFFERPROC glFeedbackBuffer;
public static PFNGLFINISHPROC glFinish;
public static PFNGLFLUSHPROC glFlush;
public static PFNGLFOGFPROC glFogf;
public static PFNGLFOGFVPROC glFogfv;
public static PFNGLFOGIPROC glFogi;
public static PFNGLFOGIVPROC glFogiv;
public static PFNGLFRONTFACEPROC glFrontFace;
public static PFNGLFRUSTUMPROC glFrustum;
public static PFNGLGENLISTSPROC glGenLists;
public static PFNGLGENTEXTURESPROC glGenTextures;
public static PFNGLGETBOOLEANVPROC glGetBooleanv;
public static PFNGLGETCLIPPLANEPROC glGetClipPlane;
public static PFNGLGETDOUBLEVPROC glGetDoublev;
public static PFNGLGETERRORPROC glGetError;
public static PFNGLGETFLOATVPROC glGetFloatv;
public static PFNGLGETINTEGERVPROC glGetIntegerv;
public static PFNGLGETLIGHTFVPROC glGetLightfv;
public static PFNGLGETLIGHTIVPROC glGetLightiv;
public static PFNGLGETMAPDVPROC glGetMapdv;
public static PFNGLGETMAPFVPROC glGetMapfv;
public static PFNGLGETMAPIVPROC glGetMapiv;
public static PFNGLGETMATERIALFVPROC glGetMaterialfv;
public static PFNGLGETMATERIALIVPROC glGetMaterialiv;
public static PFNGLGETPIXELMAPFVPROC glGetPixelMapfv;
public static PFNGLGETPIXELMAPUIVPROC glGetPixelMapuiv;
public static PFNGLGETPIXELMAPUSVPROC glGetPixelMapusv;
public static PFNGLGETPOINTERVPROC glGetPointerv;
public static PFNGLGETPOLYGONSTIPPLEPROC glGetPolygonStipple;
public static PFNGLGETSTRINGPROC glGetString;
public static PFNGLGETTEXENVFVPROC glGetTexEnvfv;
public static PFNGLGETTEXENVIVPROC glGetTexEnviv;
public static PFNGLGETTEXGENDVPROC glGetTexGendv;
public static PFNGLGETTEXGENFVPROC glGetTexGenfv;
public static PFNGLGETTEXGENIVPROC glGetTexGeniv;
public static PFNGLGETTEXIMAGEPROC glGetTexImage;
public static PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv;
public static PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv;
public static PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv;
public static PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv;
public static PFNGLHINTPROC glHint;
public static PFNGLINDEXMASKPROC glIndexMask;
public static PFNGLINDEXPOINTERPROC glIndexPointer;
public static PFNGLINDEXDPROC glIndexd;
public static PFNGLINDEXDVPROC glIndexdv;
public static PFNGLINDEXFPROC glIndexf;
public static PFNGLINDEXFVPROC glIndexfv;
public static PFNGLINDEXIPROC glIndexi;
public static PFNGLINDEXIVPROC glIndexiv;
public static PFNGLINDEXSPROC glIndexs;
public static PFNGLINDEXSVPROC glIndexsv;
public static PFNGLINDEXUBPROC glIndexub;
public static PFNGLINDEXUBVPROC glIndexubv;
public static PFNGLINITNAMESPROC glInitNames;
public static PFNGLINTERLEAVEDARRAYSPROC glInterleavedArrays;
public static PFNGLISENABLEDPROC glIsEnabled;
public static PFNGLISLISTPROC glIsList;
public static PFNGLISTEXTUREPROC glIsTexture;
public static PFNGLLIGHTMODELFPROC glLightModelf;
public static PFNGLLIGHTMODELFVPROC glLightModelfv;
public static PFNGLLIGHTMODELIPROC glLightModeli;
public static PFNGLLIGHTMODELIVPROC glLightModeliv;
public static PFNGLLIGHTFPROC glLightf;
public static PFNGLLIGHTFVPROC glLightfv;
public static PFNGLLIGHTIPROC glLighti;
public static PFNGLLIGHTIVPROC glLightiv;
public static PFNGLLINESTIPPLEPROC glLineStipple;
public static PFNGLLINEWIDTHPROC glLineWidth;
public static PFNGLLISTBASEPROC glListBase;
public static PFNGLLOADIDENTITYPROC glLoadIdentity;
public static PFNGLLOADMATRIXDPROC glLoadMatrixd;
public static PFNGLLOADMATRIXFPROC glLoadMatrixf;
public static PFNGLLOADNAMEPROC glLoadName;
public static PFNGLLOGICOPPROC glLogicOp;
public static PFNGLMAP1DPROC glMap1d;
public static PFNGLMAP1FPROC glMap1f;
public static PFNGLMAP2DPROC glMap2d;
public static PFNGLMAP2FPROC glMap2f;
public static PFNGLMAPGRID1DPROC glMapGrid1d;
public static PFNGLMAPGRID1FPROC glMapGrid1f;
public static PFNGLMAPGRID2DPROC glMapGrid2d;
public static PFNGLMAPGRID2FPROC glMapGrid2f;
public static PFNGLMATERIALFPROC glMaterialf;
public static PFNGLMATERIALFVPROC glMaterialfv;
public static PFNGLMATERIALIPROC glMateriali;
public static PFNGLMATERIALIVPROC glMaterialiv;
public static PFNGLMATRIXMODEPROC glMatrixMode;
public static PFNGLMULTMATRIXDPROC glMultMatrixd;
public static PFNGLMULTMATRIXFPROC glMultMatrixf;
public static PFNGLNEWLISTPROC glNewList;
public static PFNGLNORMAL3BPROC glNormal3b;
public static PFNGLNORMAL3BVPROC glNormal3bv;
public static PFNGLNORMAL3DPROC glNormal3d;
public static PFNGLNORMAL3DVPROC glNormal3dv;
public static PFNGLNORMAL3FPROC glNormal3f;
public static PFNGLNORMAL3FVPROC glNormal3fv;
public static PFNGLNORMAL3IPROC glNormal3i;
public static PFNGLNORMAL3IVPROC glNormal3iv;
public static PFNGLNORMAL3SPROC glNormal3s;
public static PFNGLNORMAL3SVPROC glNormal3sv;
public static PFNGLNORMALPOINTERPROC glNormalPointer;
public static PFNGLORTHOPROC glOrtho;
public static PFNGLPASSTHROUGHPROC glPassThrough;
public static PFNGLPIXELMAPFVPROC glPixelMapfv;
public static PFNGLPIXELMAPUIVPROC glPixelMapuiv;
public static PFNGLPIXELMAPUSVPROC glPixelMapusv;
public static PFNGLPIXELSTOREFPROC glPixelStoref;
public static PFNGLPIXELSTOREIPROC glPixelStorei;
public static PFNGLPIXELTRANSFERFPROC glPixelTransferf;
public static PFNGLPIXELTRANSFERIPROC glPixelTransferi;
public static PFNGLPIXELZOOMPROC glPixelZoom;
public static PFNGLPOINTSIZEPROC glPointSize;
public static PFNGLPOLYGONMODEPROC glPolygonMode;
public static PFNGLPOLYGONOFFSETPROC glPolygonOffset;
public static PFNGLPOLYGONSTIPPLEPROC glPolygonStipple;
public static PFNGLPOPATTRIBPROC glPopAttrib;
public static PFNGLPOPCLIENTATTRIBPROC glPopClientAttrib;
public static PFNGLPOPMATRIXPROC glPopMatrix;
public static PFNGLPOPNAMEPROC glPopName;
public static PFNGLPRIORITIZETEXTURESPROC glPrioritizeTextures;
public static PFNGLPUSHATTRIBPROC glPushAttrib;
public static PFNGLPUSHCLIENTATTRIBPROC glPushClientAttrib;
public static PFNGLPUSHMATRIXPROC glPushMatrix;
public static PFNGLPUSHNAMEPROC glPushName;
public static PFNGLRASTERPOS2DPROC glRasterPos2d;
public static PFNGLRASTERPOS2DVPROC glRasterPos2dv;
public static PFNGLRASTERPOS2FPROC glRasterPos2f;
public static PFNGLRASTERPOS2FVPROC glRasterPos2fv;
public static PFNGLRASTERPOS2IPROC glRasterPos2i;
public static PFNGLRASTERPOS2IVPROC glRasterPos2iv;
public static PFNGLRASTERPOS2SPROC glRasterPos2s;
public static PFNGLRASTERPOS2SVPROC glRasterPos2sv;
public static PFNGLRASTERPOS3DPROC glRasterPos3d;
public static PFNGLRASTERPOS3DVPROC glRasterPos3dv;
public static PFNGLRASTERPOS3FPROC glRasterPos3f;
public static PFNGLRASTERPOS3FVPROC glRasterPos3fv;
public static PFNGLRASTERPOS3IPROC glRasterPos3i;
public static PFNGLRASTERPOS3IVPROC glRasterPos3iv;
public static PFNGLRASTERPOS3SPROC glRasterPos3s;
public static PFNGLRASTERPOS3SVPROC glRasterPos3sv;
public static PFNGLRASTERPOS4DPROC glRasterPos4d;
public static PFNGLRASTERPOS4DVPROC glRasterPos4dv;
public static PFNGLRASTERPOS4FPROC glRasterPos4f;
public static PFNGLRASTERPOS4FVPROC glRasterPos4fv;
public static PFNGLRASTERPOS4IPROC glRasterPos4i;
public static PFNGLRASTERPOS4IVPROC glRasterPos4iv;
public static PFNGLRASTERPOS4SPROC glRasterPos4s;
public static PFNGLRASTERPOS4SVPROC glRasterPos4sv;
public static PFNGLREADBUFFERPROC glReadBuffer;
public static PFNGLREADPIXELSPROC glReadPixels;
public static PFNGLRECTDPROC glRectd;
public static PFNGLRECTDVPROC glRectdv;
public static PFNGLRECTFPROC glRectf;
public static PFNGLRECTFVPROC glRectfv;
public static PFNGLRECTIPROC glRecti;
public static PFNGLRECTIVPROC glRectiv;
public static PFNGLRECTSPROC glRects;
public static PFNGLRECTSVPROC glRectsv;
public static PFNGLRENDERMODEPROC glRenderMode;
public static PFNGLROTATEDPROC glRotated;
public static PFNGLROTATEFPROC glRotatef;
public static PFNGLSCALEDPROC glScaled;
public static PFNGLSCALEFPROC glScalef;
public static PFNGLSCISSORPROC glScissor;
public static PFNGLSELECTBUFFERPROC glSelectBuffer;
public static PFNGLSHADEMODELPROC glShadeModel;
public static PFNGLSTENCILFUNCPROC glStencilFunc;
public static PFNGLSTENCILMASKPROC glStencilMask;
public static PFNGLSTENCILOPPROC glStencilOp;
public static PFNGLTEXCOORD1DPROC glTexCoord1d;
public static PFNGLTEXCOORD1DVPROC glTexCoord1dv;
public static PFNGLTEXCOORD1FPROC glTexCoord1f;
public static PFNGLTEXCOORD1FVPROC glTexCoord1fv;
public static PFNGLTEXCOORD1IPROC glTexCoord1i;
public static PFNGLTEXCOORD1IVPROC glTexCoord1iv;
public static PFNGLTEXCOORD1SPROC glTexCoord1s;
public static PFNGLTEXCOORD1SVPROC glTexCoord1sv;
public static PFNGLTEXCOORD2DPROC glTexCoord2d;
public static PFNGLTEXCOORD2DVPROC glTexCoord2dv;
public static PFNGLTEXCOORD2FPROC glTexCoord2f;
public static PFNGLTEXCOORD2FVPROC glTexCoord2fv;
public static PFNGLTEXCOORD2IPROC glTexCoord2i;
public static PFNGLTEXCOORD2IVPROC glTexCoord2iv;
public static PFNGLTEXCOORD2SPROC glTexCoord2s;
public static PFNGLTEXCOORD2SVPROC glTexCoord2sv;
public static PFNGLTEXCOORD3DPROC glTexCoord3d;
public static PFNGLTEXCOORD3DVPROC glTexCoord3dv;
public static PFNGLTEXCOORD3FPROC glTexCoord3f;
public static PFNGLTEXCOORD3FVPROC glTexCoord3fv;
public static PFNGLTEXCOORD3IPROC glTexCoord3i;
public static PFNGLTEXCOORD3IVPROC glTexCoord3iv;
public static PFNGLTEXCOORD3SPROC glTexCoord3s;
public static PFNGLTEXCOORD3SVPROC glTexCoord3sv;
public static PFNGLTEXCOORD4DPROC glTexCoord4d;
public static PFNGLTEXCOORD4DVPROC glTexCoord4dv;
public static PFNGLTEXCOORD4FPROC glTexCoord4f;
public static PFNGLTEXCOORD4FVPROC glTexCoord4fv;
public static PFNGLTEXCOORD4IPROC glTexCoord4i;
public static PFNGLTEXCOORD4IVPROC glTexCoord4iv;
public static PFNGLTEXCOORD4SPROC glTexCoord4s;
public static PFNGLTEXCOORD4SVPROC glTexCoord4sv;
public static PFNGLTEXCOORDPOINTERPROC glTexCoordPointer;
public static PFNGLTEXENVFPROC glTexEnvf;
public static PFNGLTEXENVFVPROC glTexEnvfv;
public static PFNGLTEXENVIPROC glTexEnvi;
public static PFNGLTEXENVIVPROC glTexEnviv;
public static PFNGLTEXGENDPROC glTexGend;
public static PFNGLTEXGENDVPROC glTexGendv;
public static PFNGLTEXGENFPROC glTexGenf;
public static PFNGLTEXGENFVPROC glTexGenfv;
public static PFNGLTEXGENIPROC glTexGeni;
public static PFNGLTEXGENIVPROC glTexGeniv;
public static PFNGLTEXIMAGE1DPROC glTexImage1D;
public static PFNGLTEXIMAGE2DPROC glTexImage2D;
public static PFNGLTEXPARAMETERFPROC glTexParameterf;
public static PFNGLTEXPARAMETERFVPROC glTexParameterfv;
public static PFNGLTEXPARAMETERIPROC glTexParameteri;
public static PFNGLTEXPARAMETERIVPROC glTexParameteriv;
public static PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D;
public static PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D;
public static PFNGLTRANSLATEDPROC glTranslated;
public static PFNGLTRANSLATEFPROC glTranslatef;
public static PFNGLVERTEX2DPROC glVertex2d;
public static PFNGLVERTEX2DVPROC glVertex2dv;
public static PFNGLVERTEX2FPROC glVertex2f;
public static PFNGLVERTEX2FVPROC glVertex2fv;
public static PFNGLVERTEX2IPROC glVertex2i;
public static PFNGLVERTEX2IVPROC glVertex2iv;
public static PFNGLVERTEX2SPROC glVertex2s;
public static PFNGLVERTEX2SVPROC glVertex2sv;
public static PFNGLVERTEX3DPROC glVertex3d;
public static PFNGLVERTEX3DVPROC glVertex3dv;
public static PFNGLVERTEX3FPROC glVertex3f;
public static PFNGLVERTEX3FVPROC glVertex3fv;
public static PFNGLVERTEX3IPROC glVertex3i;
public static PFNGLVERTEX3IVPROC glVertex3iv;
public static PFNGLVERTEX3SPROC glVertex3s;
public static PFNGLVERTEX3SVPROC glVertex3sv;
public static PFNGLVERTEX4DPROC glVertex4d;
public static PFNGLVERTEX4DVPROC glVertex4dv;
public static PFNGLVERTEX4FPROC glVertex4f;
public static PFNGLVERTEX4FVPROC glVertex4fv;
public static PFNGLVERTEX4IPROC glVertex4i;
public static PFNGLVERTEX4IVPROC glVertex4iv;
public static PFNGLVERTEX4SPROC glVertex4s;
public static PFNGLVERTEX4SVPROC glVertex4sv;
public static PFNGLVERTEXPOINTERPROC glVertexPointer;
public static PFNGLVIEWPORTPROC glViewport;
#endregion
#endregion
#region OpenGL 1.2
#region Constants
public const uint GL_UNSIGNED_BYTE_3_3_2 = 32818;
public const uint GL_UNSIGNED_SHORT_4_4_4_4 = 32819;
public const uint GL_UNSIGNED_SHORT_5_5_5_1 = 32820;
public const uint GL_UNSIGNED_INT_8_8_8_8 = 32821;
public const uint GL_UNSIGNED_INT_10_10_10_2 = 32822;
public const uint GL_TEXTURE_BINDING_3D = 32874;
public const uint GL_PACK_SKIP_IMAGES = 32875;
public const uint GL_PACK_IMAGE_HEIGHT = 32876;
public const uint GL_UNPACK_SKIP_IMAGES = 32877;
public const uint GL_UNPACK_IMAGE_HEIGHT = 32878;
public const uint GL_TEXTURE_3D = 32879;
public const uint GL_PROXY_TEXTURE_3D = 32880;
public const uint GL_TEXTURE_DEPTH = 32881;
public const uint GL_TEXTURE_WRAP_R = 32882;
public const uint GL_MAX_3D_TEXTURE_SIZE = 32883;
public const uint GL_UNSIGNED_BYTE_2_3_3_REV = 33634;
public const uint GL_UNSIGNED_SHORT_5_6_5 = 33635;
public const uint GL_UNSIGNED_SHORT_5_6_5_REV = 33636;
public const uint GL_UNSIGNED_SHORT_4_4_4_4_REV = 33637;
public const uint GL_UNSIGNED_SHORT_1_5_5_5_REV = 33638;
public const uint GL_UNSIGNED_INT_8_8_8_8_REV = 33639;
public const uint GL_UNSIGNED_INT_2_10_10_10_REV = 33640;
public const uint GL_BGR = 32992;
public const uint GL_BGRA = 32993;
public const uint GL_MAX_ELEMENTS_VERTICES = 33000;
public const uint GL_MAX_ELEMENTS_INDICES = 33001;
public const uint GL_CLAMP_TO_EDGE = 33071;
public const uint GL_TEXTURE_MIN_LOD = 33082;
public const uint GL_TEXTURE_MAX_LOD = 33083;
public const uint GL_TEXTURE_BASE_LEVEL = 33084;
public const uint GL_TEXTURE_MAX_LEVEL = 33085;
public const uint GL_SMOOTH_POINT_SIZE_RANGE = 2834;
public const uint GL_SMOOTH_POINT_SIZE_GRANULARITY = 2835;
public const uint GL_SMOOTH_LINE_WIDTH_RANGE = 2850;
public const uint GL_SMOOTH_LINE_WIDTH_GRANULARITY = 2851;
public const uint GL_ALIASED_LINE_WIDTH_RANGE = 33902;
#endregion
#region Delegates
public delegate void PFNGLDRAWRANGEELEMENTSPROC( uint mode, uint start, uint end, int count, uint type, IntPtr indices );
public delegate void PFNGLTEXIMAGE3DPROC( uint target, int level, int internalformat, int width, int height, int depth, int border, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXSUBIMAGE3DPROC( uint target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, uint type, IntPtr pixels );
public delegate void PFNGLCOPYTEXSUBIMAGE3DPROC( uint target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height );
#endregion
#region Methods
public static PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements;
public static PFNGLTEXIMAGE3DPROC glTexImage3D;
public static PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D;
public static PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D;
#endregion
#endregion
#region OpenGL 1.3
#region Constants
public const uint GL_TEXTURE0 = 33984;
public const uint GL_TEXTURE1 = 33985;
public const uint GL_TEXTURE2 = 33986;
public const uint GL_TEXTURE3 = 33987;
public const uint GL_TEXTURE4 = 33988;
public const uint GL_TEXTURE5 = 33989;
public const uint GL_TEXTURE6 = 33990;
public const uint GL_TEXTURE7 = 33991;
public const uint GL_TEXTURE8 = 33992;
public const uint GL_TEXTURE9 = 33993;
public const uint GL_TEXTURE10 = 33994;
public const uint GL_TEXTURE11 = 33995;
public const uint GL_TEXTURE12 = 33996;
public const uint GL_TEXTURE13 = 33997;
public const uint GL_TEXTURE14 = 33998;
public const uint GL_TEXTURE15 = 33999;
public const uint GL_TEXTURE16 = 34000;
public const uint GL_TEXTURE17 = 34001;
public const uint GL_TEXTURE18 = 34002;
public const uint GL_TEXTURE19 = 34003;
public const uint GL_TEXTURE20 = 34004;
public const uint GL_TEXTURE21 = 34005;
public const uint GL_TEXTURE22 = 34006;
public const uint GL_TEXTURE23 = 34007;
public const uint GL_TEXTURE24 = 34008;
public const uint GL_TEXTURE25 = 34009;
public const uint GL_TEXTURE26 = 34010;
public const uint GL_TEXTURE27 = 34011;
public const uint GL_TEXTURE28 = 34012;
public const uint GL_TEXTURE29 = 34013;
public const uint GL_TEXTURE30 = 34014;
public const uint GL_TEXTURE31 = 34015;
public const uint GL_ACTIVE_TEXTURE = 34016;
public const uint GL_MULTISAMPLE = 32925;
public const uint GL_SAMPLE_ALPHA_TO_COVERAGE = 32926;
public const uint GL_SAMPLE_ALPHA_TO_ONE = 32927;
public const uint GL_SAMPLE_COVERAGE = 32928;
public const uint GL_SAMPLE_BUFFERS = 32936;
public const uint GL_SAMPLES = 32937;
public const uint GL_SAMPLE_COVERAGE_VALUE = 32938;
public const uint GL_SAMPLE_COVERAGE_INVERT = 32939;
public const uint GL_TEXTURE_CUBE_MAP = 34067;
public const uint GL_TEXTURE_BINDING_CUBE_MAP = 34068;
public const uint GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
public const uint GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
public const uint GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
public const uint GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
public const uint GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
public const uint GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
public const uint GL_PROXY_TEXTURE_CUBE_MAP = 34075;
public const uint GL_MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
public const uint GL_COMPRESSED_RGB = 34029;
public const uint GL_COMPRESSED_RGBA = 34030;
public const uint GL_TEXTURE_COMPRESSION_HINT = 34031;
public const uint GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 34464;
public const uint GL_TEXTURE_COMPRESSED = 34465;
public const uint GL_NUM_COMPRESSED_TEXTURE_FORMATS = 34466;
public const uint GL_COMPRESSED_TEXTURE_FORMATS = 34467;
public const uint GL_CLAMP_TO_BORDER = 33069;
#endregion
#region Delegates
public delegate void PFNGLACTIVETEXTUREPROC( uint texture );
public delegate void PFNGLSAMPLECOVERAGEPROC( float value, byte invert );
public delegate void PFNGLCOMPRESSEDTEXIMAGE3DPROC( uint target, int level, uint internalformat, int width, int height, int depth, int border, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXIMAGE2DPROC( uint target, int level, uint internalformat, int width, int height, int border, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXIMAGE1DPROC( uint target, int level, uint internalformat, int width, int border, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC( uint target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC( uint target, int level, int xoffset, int yoffset, int width, int height, uint format, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC( uint target, int level, int xoffset, int width, uint format, int imageSize, IntPtr data );
public delegate void PFNGLGETCOMPRESSEDTEXIMAGEPROC( uint target, int level, IntPtr img );
#endregion
#region Methods
public static PFNGLACTIVETEXTUREPROC glActiveTexture;
public static PFNGLSAMPLECOVERAGEPROC glSampleCoverage;
public static PFNGLCOMPRESSEDTEXIMAGE3DPROC glCompressedTexImage3D;
public static PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D;
public static PFNGLCOMPRESSEDTEXIMAGE1DPROC glCompressedTexImage1D;
public static PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D;
public static PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D;
public static PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D;
public static PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage;
#endregion
#endregion
#region OpenGL 1.4
#region Constants
public const uint GL_VERSION_1_4 = 1;
public const uint GL_BLEND_DST_RGB = 32968;
public const uint GL_BLEND_SRC_RGB = 32969;
public const uint GL_BLEND_DST_ALPHA = 32970;
public const uint GL_BLEND_SRC_ALPHA = 32971;
public const uint GL_POINT_FADE_THRESHOLD_SIZE = 33064;
public const uint GL_DEPTH_COMPONENT16 = 33189;
public const uint GL_DEPTH_COMPONENT24 = 33190;
public const uint GL_DEPTH_COMPONENT32 = 33191;
public const uint GL_MIRRORED_REPEAT = 33648;
public const uint GL_MAX_TEXTURE_LOD_BIAS = 34045;
public const uint GL_TEXTURE_LOD_BIAS = 34049;
public const uint GL_INCR_WRAP = 34055;
public const uint GL_DECR_WRAP = 34056;
public const uint GL_TEXTURE_DEPTH_SIZE = 34890;
public const uint GL_TEXTURE_COMPARE_MODE = 34892;
public const uint GL_TEXTURE_COMPARE_FUNC = 34893;
public const uint GL_FUNC_ADD = 32774;
public const uint GL_FUNC_SUBTRACT = 32778;
public const uint GL_FUNC_REVERSE_SUBTRACT = 32779;
public const uint GL_MIN = 32775;
public const uint GL_MAX = 32776;
public const uint GL_CONSTANT_COLOR = 32769;
public const uint GL_ONE_MINUS_CONSTANT_COLOR = 32770;
public const uint GL_CONSTANT_ALPHA = 32771;
public const uint GL_ONE_MINUS_CONSTANT_ALPHA = 32772;
#endregion
#region
public delegate void PFNGLBLENDFUNCSEPARATEPROC( uint sfactorRGB, uint dfactorRGB, uint sfactorAlpha, uint dfactorAlpha );
public delegate void PFNGLMULTIDRAWARRAYSPROC( uint mode, ref int first, ref int count, int drawcount );
public delegate void PFNGLMULTIDRAWELEMENTSPROC( uint mode, ref int count, uint type, IntPtr indices, int drawcount );
public delegate void PFNGLPOINTPARAMETERFPROC( uint pname, float param );
public delegate void PFNGLPOINTPARAMETERFVPROC( uint pname, ref float parameters );
public delegate void PFNGLPOINTPARAMETERIPROC( uint pname, int param );
public delegate void PFNGLPOINTPARAMETERIVPROC( uint pname, ref int parameters );
public delegate void PFNGLBLENDCOLORPROC( float red, float green, float blue, float alpha );
public delegate void PFNGLBLENDEQUATIONPROC( uint mode );
#endregion
#region Methods
public static PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate;
public static PFNGLMULTIDRAWARRAYSPROC glMultiDrawArrays;
public static PFNGLMULTIDRAWELEMENTSPROC glMultiDrawElements;
public static PFNGLPOINTPARAMETERFPROC glPointParameterf;
public static PFNGLPOINTPARAMETERFVPROC glPointParameterfv;
public static PFNGLPOINTPARAMETERIPROC glPointParameteri;
public static PFNGLPOINTPARAMETERIVPROC glPointParameteriv;
public static PFNGLBLENDCOLORPROC glBlendColor;
public static PFNGLBLENDEQUATIONPROC glBlendEquation;
#endregion
#endregion
#region OpenGL 1.5
#region Constants
public const uint GL_BUFFER_SIZE = 34660;
public const uint GL_BUFFER_USAGE = 34661;
public const uint GL_QUERY_COUNTER_BITS = 34916;
public const uint GL_CURRENT_QUERY = 34917;
public const uint GL_QUERY_RESULT = 34918;
public const uint GL_QUERY_RESULT_AVAILABLE = 34919;
public const uint GL_ARRAY_BUFFER = 34962;
public const uint GL_ELEMENT_ARRAY_BUFFER = 34963;
public const uint GL_ARRAY_BUFFER_BINDING = 34964;
public const uint GL_ELEMENT_ARRAY_BUFFER_BINDING = 34965;
public const uint GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975;
public const uint GL_READ_ONLY = 35000;
public const uint GL_WRITE_ONLY = 35001;
public const uint GL_READ_WRITE = 35002;
public const uint GL_BUFFER_ACCESS = 35003;
public const uint GL_BUFFER_MAPPED = 35004;
public const uint GL_BUFFER_MAP_POINTER = 35005;
public const uint GL_STREAM_DRAW = 35040;
public const uint GL_STREAM_READ = 35041;
public const uint GL_STREAM_COPY = 35042;
public const uint GL_STATIC_DRAW = 35044;
public const uint GL_STATIC_READ = 35045;
public const uint GL_STATIC_COPY = 35046;
public const uint GL_DYNAMIC_DRAW = 35048;
public const uint GL_DYNAMIC_READ = 35049;
public const uint GL_DYNAMIC_COPY = 35050;
public const uint GL_SAMPLES_PASSED = 35092;
public const uint GL_SRC1_ALPHA = 34185;
#endregion
#region Delegates
public delegate void PFNGLGENQUERIESPROC( int n, ref uint ids );
public delegate void PFNGLDELETEQUERIESPROC( int n, ref uint ids );
public delegate byte PFNGLISQUERYPROC( uint id );
public delegate void PFNGLBEGINQUERYPROC( uint target, uint id );
public delegate void PFNGLENDQUERYPROC( uint target );
public delegate void PFNGLGETQUERYIVPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLGETQUERYOBJECTIVPROC( uint id, uint pname, ref int parameters );
public delegate void PFNGLGETQUERYOBJECTUIVPROC( uint id, uint pname, ref uint parameters );
public delegate void PFNGLBINDBUFFERPROC( uint target, uint buffer );
public delegate void PFNGLDELETEBUFFERSPROC( int n, ref uint buffers );
public delegate void PFNGLGENBUFFERSPROC( int n, ref uint buffers );
public delegate byte PFNGLISBUFFERPROC( uint buffer );
public delegate void PFNGLBUFFERDATAPROC( uint target, int size, IntPtr data, uint usage );
public delegate void PFNGLBUFFERSUBDATAPROC( uint target, int offset, int size, IntPtr data );
public delegate void PFNGLGETBUFFERSUBDATAPROC( uint target, int offset, int size, IntPtr data );
public delegate IntPtr PFNGLMAPBUFFERPROC( uint target, uint access );
public delegate byte PFNGLUNMAPBUFFERPROC( uint target );
public delegate void PFNGLGETBUFFERPARAMETERIVPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLGETBUFFERPOINTERVPROC( uint target, uint pname, ref IntPtr parameters );
#endregion
#region Methods
public static PFNGLGENQUERIESPROC glGenQueries;
public static PFNGLDELETEQUERIESPROC glDeleteQueries;
public static PFNGLISQUERYPROC glIsQuery;
public static PFNGLBEGINQUERYPROC glBeginQuery;
public static PFNGLENDQUERYPROC glEndQuery;
public static PFNGLGETQUERYIVPROC glGetQueryiv;
public static PFNGLGETQUERYOBJECTIVPROC glGetQueryObjectiv;
public static PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv;
public static PFNGLBINDBUFFERPROC glBindBuffer;
public static PFNGLDELETEBUFFERSPROC glDeleteBuffers;
public static PFNGLGENBUFFERSPROC glGenBuffers;
public static PFNGLISBUFFERPROC glIsBuffer;
public static PFNGLBUFFERDATAPROC glBufferData;
public static PFNGLBUFFERSUBDATAPROC glBufferSubData;
public static PFNGLGETBUFFERSUBDATAPROC glGetBufferSubData;
public static PFNGLMAPBUFFERPROC glMapBuffer;
public static PFNGLUNMAPBUFFERPROC glUnmapBuffer;
public static PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv;
public static PFNGLGETBUFFERPOINTERVPROC glGetBufferPointerv;
#endregion
#endregion
#region OpenGL 2.0
#region Constants
public const uint GL_BLEND_EQUATION_RGB = 32777;
public const uint GL_VERTEX_ATTRIB_ARRAY_ENABLED = 34338;
public const uint GL_VERTEX_ATTRIB_ARRAY_SIZE = 34339;
public const uint GL_VERTEX_ATTRIB_ARRAY_STRIDE = 34340;
public const uint GL_VERTEX_ATTRIB_ARRAY_TYPE = 34341;
public const uint GL_CURRENT_VERTEX_ATTRIB = 34342;
public const uint GL_VERTEX_PROGRAM_POINT_SIZE = 34370;
public const uint GL_VERTEX_ATTRIB_ARRAY_POINTER = 34373;
public const uint GL_STENCIL_BACK_FUNC = 34816;
public const uint GL_STENCIL_BACK_FAIL = 34817;
public const uint GL_STENCIL_BACK_PASS_DEPTH_FAIL = 34818;
public const uint GL_STENCIL_BACK_PASS_DEPTH_PASS = 34819;
public const uint GL_MAX_DRAW_BUFFERS = 34852;
public const uint GL_DRAW_BUFFER0 = 34853;
public const uint GL_DRAW_BUFFER1 = 34854;
public const uint GL_DRAW_BUFFER2 = 34855;
public const uint GL_DRAW_BUFFER3 = 34856;
public const uint GL_DRAW_BUFFER4 = 34857;
public const uint GL_DRAW_BUFFER5 = 34858;
public const uint GL_DRAW_BUFFER6 = 34859;
public const uint GL_DRAW_BUFFER7 = 34860;
public const uint GL_DRAW_BUFFER8 = 34861;
public const uint GL_DRAW_BUFFER9 = 34862;
public const uint GL_DRAW_BUFFER10 = 34863;
public const uint GL_DRAW_BUFFER11 = 34864;
public const uint GL_DRAW_BUFFER12 = 34865;
public const uint GL_DRAW_BUFFER13 = 34866;
public const uint GL_DRAW_BUFFER14 = 34867;
public const uint GL_DRAW_BUFFER15 = 34868;
public const uint GL_BLEND_EQUATION_ALPHA = 34877;
public const uint GL_MAX_VERTEX_ATTRIBS = 34921;
public const uint GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922;
public const uint GL_MAX_TEXTURE_IMAGE_UNITS = 34930;
public const uint GL_FRAGMENT_SHADER = 35632;
public const uint GL_VERTEX_SHADER = 35633;
public const uint GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657;
public const uint GL_MAX_VERTEX_UNIFORM_COMPONENTS = 35658;
public const uint GL_MAX_VARYING_FLOATS = 35659;
public const uint GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
public const uint GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
public const uint GL_SHADER_TYPE = 35663;
public const uint GL_FLOAT_VEC2 = 35664;
public const uint GL_FLOAT_VEC3 = 35665;
public const uint GL_FLOAT_VEC4 = 35666;
public const uint GL_INT_VEC2 = 35667;
public const uint GL_INT_VEC3 = 35668;
public const uint GL_INT_VEC4 = 35669;
public const uint GL_BOOL = 35670;
public const uint GL_BOOL_VEC2 = 35671;
public const uint GL_BOOL_VEC3 = 35672;
public const uint GL_BOOL_VEC4 = 35673;
public const uint GL_FLOAT_MAT2 = 35674;
public const uint GL_FLOAT_MAT3 = 35675;
public const uint GL_FLOAT_MAT4 = 35676;
public const uint GL_SAMPLER_1D = 35677;
public const uint GL_SAMPLER_2D = 35678;
public const uint GL_SAMPLER_3D = 35679;
public const uint GL_SAMPLER_CUBE = 35680;
public const uint GL_SAMPLER_1D_SHADOW = 35681;
public const uint GL_SAMPLER_2D_SHADOW = 35682;
public const uint GL_DELETE_STATUS = 35712;
public const uint GL_COMPILE_STATUS = 35713;
public const uint GL_LINK_STATUS = 35714;
public const uint GL_VALIDATE_STATUS = 35715;
public const uint GL_INFO_LOG_LENGTH = 35716;
public const uint GL_ATTACHED_SHADERS = 35717;
public const uint GL_ACTIVE_UNIFORMS = 35718;
public const uint GL_ACTIVE_UNIFORM_MAX_LENGTH = 35719;
public const uint GL_SHADER_SOURCE_LENGTH = 35720;
public const uint GL_ACTIVE_ATTRIBUTES = 35721;
public const uint GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 35722;
public const uint GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 35723;
public const uint GL_SHADING_LANGUAGE_VERSION = 35724;
public const uint GL_CURRENT_PROGRAM = 35725;
public const uint GL_POINT_SPRITE_COORD_ORIGIN = 36000;
public const uint GL_LOWER_LEFT = 36001;
public const uint GL_UPPER_LEFT = 36002;
public const uint GL_STENCIL_BACK_REF = 36003;
public const uint GL_STENCIL_BACK_VALUE_MASK = 36004;
public const uint GL_STENCIL_BACK_WRITEMASK = 36005;
#endregion
#region Delegates
public delegate void PFNGLBLENDEQUATIONSEPARATEPROC( uint modeRGB, uint modeAlpha );
public delegate void PFNGLDRAWBUFFERSPROC( int n, ref uint bufs );
public delegate void PFNGLSTENCILOPSEPARATEPROC( uint face, uint sfail, uint dpfail, uint dppass );
public delegate void PFNGLSTENCILFUNCSEPARATEPROC( uint face, uint func, int refer, uint mask );
public delegate void PFNGLSTENCILMASKSEPARATEPROC( uint face, uint mask );
public delegate void PFNGLATTACHSHADERPROC( uint program, uint shader );
public delegate void PFNGLBINDATTRIBLOCATIONPROC( uint program, uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLCOMPILESHADERPROC( uint shader );
public delegate uint PFNGLCREATEPROGRAMPROC();
public delegate uint PFNGLCREATESHADERPROC( uint type );
public delegate void PFNGLDELETEPROGRAMPROC( uint program );
public delegate void PFNGLDELETESHADERPROC( uint shader );
public delegate void PFNGLDETACHSHADERPROC( uint program, uint shader );
public delegate void PFNGLDISABLEVERTEXATTRIBARRAYPROC( uint index );
public delegate void PFNGLENABLEVERTEXATTRIBARRAYPROC( uint index );
public delegate void PFNGLGETACTIVEATTRIBPROC( uint program, uint index, int bufSize, ref int length, ref int size, ref uint type, IntPtr name );
public delegate void PFNGLGETACTIVEUNIFORMPROC( uint program, uint index, int bufSize, ref int length, ref int size, ref uint type, IntPtr name );
public delegate void PFNGLGETATTACHEDSHADERSPROC( uint program, int maxCount, ref int count, ref uint shaders );
public delegate int PFNGLGETATTRIBLOCATIONPROC( uint program, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLGETPROGRAMIVPROC( uint program, uint pname, ref int parameters );
public delegate void PFNGLGETPROGRAMINFOLOGPROC( uint program, int bufSize, ref int length, IntPtr infoLog );
public delegate void PFNGLGETSHADERIVPROC( uint shader, uint pname, ref int parameters );
public delegate void PFNGLGETSHADERINFOLOGPROC( uint shader, int bufSize, ref int length, IntPtr infoLog );
public delegate void PFNGLGETSHADERSOURCEPROC( uint shader, int bufSize, ref int length, IntPtr source );
public delegate int PFNGLGETUNIFORMLOCATIONPROC( uint program, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLGETUNIFORMFVPROC( uint program, int location, ref float parameters );
public delegate void PFNGLGETUNIFORMIVPROC( uint program, int location, ref int parameters );
public delegate void PFNGLGETVERTEXATTRIBDVPROC( uint index, uint pname, ref double parameters );
public delegate void PFNGLGETVERTEXATTRIBFVPROC( uint index, uint pname, ref float parameters );
public delegate void PFNGLGETVERTEXATTRIBIVPROC( uint index, uint pname, ref int parameters );
public delegate void PFNGLGETVERTEXATTRIBPOINTERVPROC( uint index, uint pname, ref IntPtr pointer );
public delegate byte PFNGLISPROGRAMPROC( uint program );
public delegate byte PFNGLISSHADERPROC( uint shader );
public delegate void PFNGLLINKPROGRAMPROC( uint program );
public delegate void PFNGLSHADERSOURCEPROC( uint shader, int count, ref IntPtr str, ref int length );
public delegate void PFNGLUSEPROGRAMPROC( uint program );
public delegate void PFNGLUNIFORM1FPROC( int location, float v0 );
public delegate void PFNGLUNIFORM2FPROC( int location, float v0, float v1 );
public delegate void PFNGLUNIFORM3FPROC( int location, float v0, float v1, float v2 );
public delegate void PFNGLUNIFORM4FPROC( int location, float v0, float v1, float v2, float v3 );
public delegate void PFNGLUNIFORM1IPROC( int location, int v0 );
public delegate void PFNGLUNIFORM2IPROC( int location, int v0, int v1 );
public delegate void PFNGLUNIFORM3IPROC( int location, int v0, int v1, int v2 );
public delegate void PFNGLUNIFORM4IPROC( int location, int v0, int v1, int v2, int v3 );
public delegate void PFNGLUNIFORM1FVPROC( int location, int count, ref float value );
public delegate void PFNGLUNIFORM2FVPROC( int location, int count, ref float value );
public delegate void PFNGLUNIFORM3FVPROC( int location, int count, ref float value );
public delegate void PFNGLUNIFORM4FVPROC( int location, int count, ref float value );
public delegate void PFNGLUNIFORM1IVPROC( int location, int count, ref int value );
public delegate void PFNGLUNIFORM2IVPROC( int location, int count, ref int value );
public delegate void PFNGLUNIFORM3IVPROC( int location, int count, ref int value );
public delegate void PFNGLUNIFORM4IVPROC( int location, int count, ref int value );
public delegate void PFNGLUNIFORMMATRIX2FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX3FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX4FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLVALIDATEPROGRAMPROC( uint program );
public delegate void PFNGLVERTEXATTRIB1DPROC( uint index, double x );
public delegate void PFNGLVERTEXATTRIB1DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIB1FPROC( uint index, float x );
public delegate void PFNGLVERTEXATTRIB1FVPROC( uint index, ref float v );
public delegate void PFNGLVERTEXATTRIB1SPROC( uint index, short x );
public delegate void PFNGLVERTEXATTRIB1SVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIB2DPROC( uint index, double x, double y );
public delegate void PFNGLVERTEXATTRIB2DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIB2FPROC( uint index, float x, float y );
public delegate void PFNGLVERTEXATTRIB2FVPROC( uint index, ref float v );
public delegate void PFNGLVERTEXATTRIB2SPROC( uint index, short x, short y );
public delegate void PFNGLVERTEXATTRIB2SVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIB3DPROC( uint index, double x, double y, double z );
public delegate void PFNGLVERTEXATTRIB3DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIB3FPROC( uint index, float x, float y, float z );
public delegate void PFNGLVERTEXATTRIB3FVPROC( uint index, ref float v );
public delegate void PFNGLVERTEXATTRIB3SPROC( uint index, short x, short y, short z );
public delegate void PFNGLVERTEXATTRIB3SVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIB4NBVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIB4NIVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIB4NSVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIB4NUBPROC( uint index, byte x, byte y, byte z, byte w );
public delegate void PFNGLVERTEXATTRIB4NUBVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIB4NUIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIB4NUSVPROC( uint index, ref ushort v );
public delegate void PFNGLVERTEXATTRIB4BVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIB4DPROC( uint index, double x, double y, double z, double w );
public delegate void PFNGLVERTEXATTRIB4DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIB4FPROC( uint index, float x, float y, float z, float w );
public delegate void PFNGLVERTEXATTRIB4FVPROC( uint index, ref float v );
public delegate void PFNGLVERTEXATTRIB4IVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIB4SPROC( uint index, short x, short y, short z, short w );
public delegate void PFNGLVERTEXATTRIB4SVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIB4UBVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIB4UIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIB4USVPROC( uint index, ref ushort v );
public delegate void PFNGLVERTEXATTRIBPOINTERPROC( uint index, int size, uint type, byte normalized, int stride, IntPtr pointer );
#endregion
#region Methods
public static PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate;
public static PFNGLDRAWBUFFERSPROC glDrawBuffers;
public static PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate;
public static PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate;
public static PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate;
public static PFNGLATTACHSHADERPROC glAttachShader;
public static PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation;
public static PFNGLCOMPILESHADERPROC glCompileShader;
public static PFNGLCREATEPROGRAMPROC glCreateProgram;
public static PFNGLCREATESHADERPROC glCreateShader;
public static PFNGLDELETEPROGRAMPROC glDeleteProgram;
public static PFNGLDELETESHADERPROC glDeleteShader;
public static PFNGLDETACHSHADERPROC glDetachShader;
public static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray;
public static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
public static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib;
public static PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform;
public static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders;
public static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation;
public static PFNGLGETPROGRAMIVPROC glGetProgramiv;
public static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
public static PFNGLGETSHADERIVPROC glGetShaderiv;
public static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
public static PFNGLGETSHADERSOURCEPROC glGetShaderSource;
public static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
public static PFNGLGETUNIFORMFVPROC glGetUniformfv;
public static PFNGLGETUNIFORMIVPROC glGetUniformiv;
public static PFNGLGETVERTEXATTRIBDVPROC glGetVertexAttribdv;
public static PFNGLGETVERTEXATTRIBFVPROC glGetVertexAttribfv;
public static PFNGLGETVERTEXATTRIBIVPROC glGetVertexAttribiv;
public static PFNGLGETVERTEXATTRIBPOINTERVPROC glGetVertexAttribPointerv;
public static PFNGLISPROGRAMPROC glIsProgram;
public static PFNGLISSHADERPROC glIsShader;
public static PFNGLLINKPROGRAMPROC glLinkProgram;
public static PFNGLSHADERSOURCEPROC glShaderSource;
public static PFNGLUSEPROGRAMPROC glUseProgram;
public static PFNGLUNIFORM1FPROC glUniform1f;
public static PFNGLUNIFORM2FPROC glUniform2f;
public static PFNGLUNIFORM3FPROC glUniform3f;
public static PFNGLUNIFORM4FPROC glUniform4f;
public static PFNGLUNIFORM1IPROC glUniform1i;
public static PFNGLUNIFORM2IPROC glUniform2i;
public static PFNGLUNIFORM3IPROC glUniform3i;
public static PFNGLUNIFORM4IPROC glUniform4i;
public static PFNGLUNIFORM1FVPROC glUniform1fv;
public static PFNGLUNIFORM2FVPROC glUniform2fv;
public static PFNGLUNIFORM3FVPROC glUniform3fv;
public static PFNGLUNIFORM4FVPROC glUniform4fv;
public static PFNGLUNIFORM1IVPROC glUniform1iv;
public static PFNGLUNIFORM2IVPROC glUniform2iv;
public static PFNGLUNIFORM3IVPROC glUniform3iv;
public static PFNGLUNIFORM4IVPROC glUniform4iv;
public static PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv;
public static PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv;
public static PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv;
public static PFNGLVALIDATEPROGRAMPROC glValidateProgram;
public static PFNGLVERTEXATTRIB1DPROC glVertexAttrib1d;
public static PFNGLVERTEXATTRIB1DVPROC glVertexAttrib1dv;
public static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f;
public static PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv;
public static PFNGLVERTEXATTRIB1SPROC glVertexAttrib1s;
public static PFNGLVERTEXATTRIB1SVPROC glVertexAttrib1sv;
public static PFNGLVERTEXATTRIB2DPROC glVertexAttrib2d;
public static PFNGLVERTEXATTRIB2DVPROC glVertexAttrib2dv;
public static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f;
public static PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv;
public static PFNGLVERTEXATTRIB2SPROC glVertexAttrib2s;
public static PFNGLVERTEXATTRIB2SVPROC glVertexAttrib2sv;
public static PFNGLVERTEXATTRIB3DPROC glVertexAttrib3d;
public static PFNGLVERTEXATTRIB3DVPROC glVertexAttrib3dv;
public static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f;
public static PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv;
public static PFNGLVERTEXATTRIB3SPROC glVertexAttrib3s;
public static PFNGLVERTEXATTRIB3SVPROC glVertexAttrib3sv;
public static PFNGLVERTEXATTRIB4NBVPROC glVertexAttrib4Nbv;
public static PFNGLVERTEXATTRIB4NIVPROC glVertexAttrib4Niv;
public static PFNGLVERTEXATTRIB4NSVPROC glVertexAttrib4Nsv;
public static PFNGLVERTEXATTRIB4NUBPROC glVertexAttrib4Nub;
public static PFNGLVERTEXATTRIB4NUBVPROC glVertexAttrib4Nubv;
public static PFNGLVERTEXATTRIB4NUIVPROC glVertexAttrib4Nuiv;
public static PFNGLVERTEXATTRIB4NUSVPROC glVertexAttrib4Nusv;
public static PFNGLVERTEXATTRIB4BVPROC glVertexAttrib4bv;
public static PFNGLVERTEXATTRIB4DPROC glVertexAttrib4d;
public static PFNGLVERTEXATTRIB4DVPROC glVertexAttrib4dv;
public static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f;
public static PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv;
public static PFNGLVERTEXATTRIB4IVPROC glVertexAttrib4iv;
public static PFNGLVERTEXATTRIB4SPROC glVertexAttrib4s;
public static PFNGLVERTEXATTRIB4SVPROC glVertexAttrib4sv;
public static PFNGLVERTEXATTRIB4UBVPROC glVertexAttrib4ubv;
public static PFNGLVERTEXATTRIB4UIVPROC glVertexAttrib4uiv;
public static PFNGLVERTEXATTRIB4USVPROC glVertexAttrib4usv;
public static PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
#endregion
#endregion
#region OpenGL 2.1
#region Constants
public const uint GL_PIXEL_PACK_BUFFER = 35051;
public const uint GL_PIXEL_UNPACK_BUFFER = 35052;
public const uint GL_PIXEL_PACK_BUFFER_BINDING = 35053;
public const uint GL_PIXEL_UNPACK_BUFFER_BINDING = 35055;
public const uint GL_FLOAT_MAT2x3 = 35685;
public const uint GL_FLOAT_MAT2x4 = 35686;
public const uint GL_FLOAT_MAT3x2 = 35687;
public const uint GL_FLOAT_MAT3x4 = 35688;
public const uint GL_FLOAT_MAT4x2 = 35689;
public const uint GL_FLOAT_MAT4x3 = 35690;
public const uint GL_SRGB = 35904;
public const uint GL_SRGB8 = 35905;
public const uint GL_SRGB_ALPHA = 35906;
public const uint GL_SRGB8_ALPHA8 = 35907;
public const uint GL_COMPRESSED_SRGB = 35912;
public const uint GL_COMPRESSED_SRGB_ALPHA = 35913;
#endregion
#region Delegates
public delegate void PFNGLUNIFORMMATRIX2X3FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX3X2FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX2X4FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX4X2FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX3X4FVPROC( int location, int count, byte transpose, ref float value );
public delegate void PFNGLUNIFORMMATRIX4X3FVPROC( int location, int count, byte transpose, ref float value );
#endregion
#region Methods
public static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv;
public static PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv;
public static PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv;
public static PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv;
public static PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv;
public static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv;
#endregion
#endregion
#region OpenGL 3.0
#region Constants
public const uint GL_COMPARE_REF_TO_TEXTURE = 34894;
public const uint GL_CLIP_DISTANCE0 = 12288;
public const uint GL_CLIP_DISTANCE1 = 12289;
public const uint GL_CLIP_DISTANCE2 = 12290;
public const uint GL_CLIP_DISTANCE3 = 12291;
public const uint GL_CLIP_DISTANCE4 = 12292;
public const uint GL_CLIP_DISTANCE5 = 12293;
public const uint GL_CLIP_DISTANCE6 = 12294;
public const uint GL_CLIP_DISTANCE7 = 12295;
public const uint GL_MAX_CLIP_DISTANCES = 3378;
public const uint GL_MAJOR_VERSION = 33307;
public const uint GL_MINOR_VERSION = 33308;
public const uint GL_NUM_EXTENSIONS = 33309;
public const uint GL_CONTEXT_FLAGS = 33310;
public const uint GL_COMPRESSED_RED = 33317;
public const uint GL_COMPRESSED_RG = 33318;
public const uint GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 1;
public const uint GL_RGBA32F = 34836;
public const uint GL_RGB32F = 34837;
public const uint GL_RGBA16F = 34842;
public const uint GL_RGB16F = 34843;
public const uint GL_VERTEX_ATTRIB_ARRAY_INTEGER = 35069;
public const uint GL_MAX_ARRAY_TEXTURE_LAYERS = 35071;
public const uint GL_MIN_PROGRAM_TEXEL_OFFSET = 35076;
public const uint GL_MAX_PROGRAM_TEXEL_OFFSET = 35077;
public const uint GL_CLAMP_READ_COLOR = 35100;
public const uint GL_FIXED_ONLY = 35101;
public const uint GL_MAX_VARYING_COMPONENTS = 35659;
public const uint GL_TEXTURE_1D_ARRAY = 35864;
public const uint GL_PROXY_TEXTURE_1D_ARRAY = 35865;
public const uint GL_TEXTURE_2D_ARRAY = 35866;
public const uint GL_PROXY_TEXTURE_2D_ARRAY = 35867;
public const uint GL_TEXTURE_BINDING_1D_ARRAY = 35868;
public const uint GL_TEXTURE_BINDING_2D_ARRAY = 35869;
public const uint GL_R11F_G11F_B10F = 35898;
public const uint GL_UNSIGNED_INT_10F_11F_11F_REV = 35899;
public const uint GL_RGB9_E5 = 35901;
public const uint GL_UNSIGNED_INT_5_9_9_9_REV = 35902;
public const uint GL_TEXTURE_SHARED_SIZE = 35903;
public const uint GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 35958;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 35967;
public const uint GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968;
public const uint GL_TRANSFORM_FEEDBACK_VARYINGS = 35971;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_START = 35972;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973;
public const uint GL_PRIMITIVES_GENERATED = 35975;
public const uint GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976;
public const uint GL_RASTERIZER_DISCARD = 35977;
public const uint GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978;
public const uint GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979;
public const uint GL_INTERLEAVED_ATTRIBS = 35980;
public const uint GL_SEPARATE_ATTRIBS = 35981;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER = 35982;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983;
public const uint GL_RGBA32UI = 36208;
public const uint GL_RGB32UI = 36209;
public const uint GL_RGBA16UI = 36214;
public const uint GL_RGB16UI = 36215;
public const uint GL_RGBA8UI = 36220;
public const uint GL_RGB8UI = 36221;
public const uint GL_RGBA32I = 36226;
public const uint GL_RGB32I = 36227;
public const uint GL_RGBA16I = 36232;
public const uint GL_RGB16I = 36233;
public const uint GL_RGBA8I = 36238;
public const uint GL_RGB8I = 36239;
public const uint GL_RED_INTEGER = 36244;
public const uint GL_GREEN_INTEGER = 36245;
public const uint GL_BLUE_INTEGER = 36246;
public const uint GL_RGB_INTEGER = 36248;
public const uint GL_RGBA_INTEGER = 36249;
public const uint GL_BGR_INTEGER = 36250;
public const uint GL_BGRA_INTEGER = 36251;
public const uint GL_SAMPLER_1D_ARRAY = 36288;
public const uint GL_SAMPLER_2D_ARRAY = 36289;
public const uint GL_SAMPLER_1D_ARRAY_SHADOW = 36291;
public const uint GL_SAMPLER_2D_ARRAY_SHADOW = 36292;
public const uint GL_SAMPLER_CUBE_SHADOW = 36293;
public const uint GL_UNSIGNED_INT_VEC2 = 36294;
public const uint GL_UNSIGNED_INT_VEC3 = 36295;
public const uint GL_UNSIGNED_INT_VEC4 = 36296;
public const uint GL_INT_SAMPLER_1D = 36297;
public const uint GL_INT_SAMPLER_2D = 36298;
public const uint GL_INT_SAMPLER_3D = 36299;
public const uint GL_INT_SAMPLER_CUBE = 36300;
public const uint GL_INT_SAMPLER_1D_ARRAY = 36302;
public const uint GL_INT_SAMPLER_2D_ARRAY = 36303;
public const uint GL_UNSIGNED_INT_SAMPLER_1D = 36305;
public const uint GL_UNSIGNED_INT_SAMPLER_2D = 36306;
public const uint GL_UNSIGNED_INT_SAMPLER_3D = 36307;
public const uint GL_UNSIGNED_INT_SAMPLER_CUBE = 36308;
public const uint GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 36310;
public const uint GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311;
public const uint GL_QUERY_WAIT = 36371;
public const uint GL_QUERY_NO_WAIT = 36372;
public const uint GL_QUERY_BY_REGION_WAIT = 36373;
public const uint GL_QUERY_BY_REGION_NO_WAIT = 36374;
public const uint GL_BUFFER_ACCESS_FLAGS = 37151;
public const uint GL_BUFFER_MAP_LENGTH = 37152;
public const uint GL_BUFFER_MAP_OFFSET = 37153;
public const uint GL_DEPTH_COMPONENT32F = 36012;
public const uint GL_DEPTH32F_STENCIL8 = 36013;
public const uint GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 36269;
public const uint GL_INVALID_FRAMEBUFFER_OPERATION = 1286;
public const uint GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296;
public const uint GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297;
public const uint GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298;
public const uint GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299;
public const uint GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300;
public const uint GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301;
public const uint GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302;
public const uint GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303;
public const uint GL_FRAMEBUFFER_DEFAULT = 33304;
public const uint GL_FRAMEBUFFER_UNDEFINED = 33305;
public const uint GL_DEPTH_STENCIL_ATTACHMENT = 33306;
public const uint GL_MAX_RENDERBUFFER_SIZE = 34024;
public const uint GL_DEPTH_STENCIL = 34041;
public const uint GL_UNSIGNED_INT_24_8 = 34042;
public const uint GL_DEPTH24_STENCIL8 = 35056;
public const uint GL_TEXTURE_STENCIL_SIZE = 35057;
public const uint GL_TEXTURE_RED_TYPE = 35856;
public const uint GL_TEXTURE_GREEN_TYPE = 35857;
public const uint GL_TEXTURE_BLUE_TYPE = 35858;
public const uint GL_TEXTURE_ALPHA_TYPE = 35859;
public const uint GL_TEXTURE_DEPTH_TYPE = 35862;
public const uint GL_UNSIGNED_NORMALIZED = 35863;
public const uint GL_FRAMEBUFFER_BINDING = 36006;
public const uint GL_DRAW_FRAMEBUFFER_BINDING = 36006;
public const uint GL_RENDERBUFFER_BINDING = 36007;
public const uint GL_READ_FRAMEBUFFER = 36008;
public const uint GL_DRAW_FRAMEBUFFER = 36009;
public const uint GL_READ_FRAMEBUFFER_BINDING = 36010;
public const uint GL_RENDERBUFFER_SAMPLES = 36011;
public const uint GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048;
public const uint GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049;
public const uint GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050;
public const uint GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051;
public const uint GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052;
public const uint GL_FRAMEBUFFER_COMPLETE = 36053;
public const uint GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
public const uint GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
public const uint GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 36059;
public const uint GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 36060;
public const uint GL_FRAMEBUFFER_UNSUPPORTED = 36061;
public const uint GL_MAX_COLOR_ATTACHMENTS = 36063;
public const uint GL_COLOR_ATTACHMENT0 = 36064;
public const uint GL_COLOR_ATTACHMENT1 = 36065;
public const uint GL_COLOR_ATTACHMENT2 = 36066;
public const uint GL_COLOR_ATTACHMENT3 = 36067;
public const uint GL_COLOR_ATTACHMENT4 = 36068;
public const uint GL_COLOR_ATTACHMENT5 = 36069;
public const uint GL_COLOR_ATTACHMENT6 = 36070;
public const uint GL_COLOR_ATTACHMENT7 = 36071;
public const uint GL_COLOR_ATTACHMENT8 = 36072;
public const uint GL_COLOR_ATTACHMENT9 = 36073;
public const uint GL_COLOR_ATTACHMENT10 = 36074;
public const uint GL_COLOR_ATTACHMENT11 = 36075;
public const uint GL_COLOR_ATTACHMENT12 = 36076;
public const uint GL_COLOR_ATTACHMENT13 = 36077;
public const uint GL_COLOR_ATTACHMENT14 = 36078;
public const uint GL_COLOR_ATTACHMENT15 = 36079;
public const uint GL_COLOR_ATTACHMENT16 = 36080;
public const uint GL_COLOR_ATTACHMENT17 = 36081;
public const uint GL_COLOR_ATTACHMENT18 = 36082;
public const uint GL_COLOR_ATTACHMENT19 = 36083;
public const uint GL_COLOR_ATTACHMENT20 = 36084;
public const uint GL_COLOR_ATTACHMENT21 = 36085;
public const uint GL_COLOR_ATTACHMENT22 = 36086;
public const uint GL_COLOR_ATTACHMENT23 = 36087;
public const uint GL_COLOR_ATTACHMENT24 = 36088;
public const uint GL_COLOR_ATTACHMENT25 = 36089;
public const uint GL_COLOR_ATTACHMENT26 = 36090;
public const uint GL_COLOR_ATTACHMENT27 = 36091;
public const uint GL_COLOR_ATTACHMENT28 = 36092;
public const uint GL_COLOR_ATTACHMENT29 = 36093;
public const uint GL_COLOR_ATTACHMENT30 = 36094;
public const uint GL_COLOR_ATTACHMENT31 = 36095;
public const uint GL_DEPTH_ATTACHMENT = 36096;
public const uint GL_STENCIL_ATTACHMENT = 36128;
public const uint GL_FRAMEBUFFER = 36160;
public const uint GL_RENDERBUFFER = 36161;
public const uint GL_RENDERBUFFER_WIDTH = 36162;
public const uint GL_RENDERBUFFER_HEIGHT = 36163;
public const uint GL_RENDERBUFFER_INTERNAL_FORMAT = 36164;
public const uint GL_STENCIL_INDEX1 = 36166;
public const uint GL_STENCIL_INDEX4 = 36167;
public const uint GL_STENCIL_INDEX8 = 36168;
public const uint GL_STENCIL_INDEX16 = 36169;
public const uint GL_RENDERBUFFER_RED_SIZE = 36176;
public const uint GL_RENDERBUFFER_GREEN_SIZE = 36177;
public const uint GL_RENDERBUFFER_BLUE_SIZE = 36178;
public const uint GL_RENDERBUFFER_ALPHA_SIZE = 36179;
public const uint GL_RENDERBUFFER_DEPTH_SIZE = 36180;
public const uint GL_RENDERBUFFER_STENCIL_SIZE = 36181;
public const uint GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182;
public const uint GL_MAX_SAMPLES = 36183;
public const uint GL_FRAMEBUFFER_SRGB = 36281;
public const uint GL_HALF_FLOAT = 5131;
public const uint GL_MAP_READ_BIT = 1;
public const uint GL_MAP_WRITE_BIT = 2;
public const uint GL_MAP_INVALIDATE_RANGE_BIT = 4;
public const uint GL_MAP_INVALIDATE_BUFFER_BIT = 8;
public const uint GL_MAP_FLUSH_EXPLICIT_BIT = 16;
public const uint GL_MAP_UNSYNCHRONIZED_BIT = 32;
public const uint GL_COMPRESSED_RED_RGTC1 = 36283;
public const uint GL_COMPRESSED_SIGNED_RED_RGTC1 = 36284;
public const uint GL_COMPRESSED_RG_RGTC2 = 36285;
public const uint GL_COMPRESSED_SIGNED_RG_RGTC2 = 36286;
public const uint GL_RG = 33319;
public const uint GL_RG_INTEGER = 33320;
public const uint GL_R8 = 33321;
public const uint GL_R16 = 33322;
public const uint GL_RG8 = 33323;
public const uint GL_RG16 = 33324;
public const uint GL_R16F = 33325;
public const uint GL_R32F = 33326;
public const uint GL_RG16F = 33327;
public const uint GL_RG32F = 33328;
public const uint GL_R8I = 33329;
public const uint GL_R8UI = 33330;
public const uint GL_R16I = 33331;
public const uint GL_R16UI = 33332;
public const uint GL_R32I = 33333;
public const uint GL_R32UI = 33334;
public const uint GL_RG8I = 33335;
public const uint GL_RG8UI = 33336;
public const uint GL_RG16I = 33337;
public const uint GL_RG16UI = 33338;
public const uint GL_RG32I = 33339;
public const uint GL_RG32UI = 33340;
public const uint GL_VERTEX_ARRAY_BINDING = 34229;
#endregion
#region Delegates
public delegate void PFNGLCOLORMASKIPROC( uint index, byte r, byte g, byte b, byte a );
public delegate void PFNGLGETBOOLEANI_VPROC( uint target, uint index, IntPtr data );
public delegate void PFNGLGETINTEGERI_VPROC( uint target, uint index, ref int data );
public delegate void PFNGLENABLEIPROC( uint target, uint index );
public delegate void PFNGLDISABLEIPROC( uint target, uint index );
public delegate byte PFNGLISENABLEDIPROC( uint target, uint index );
public delegate void PFNGLBEGINTRANSFORMFEEDBACKPROC( uint primitiveMode );
public delegate void PFNGLENDTRANSFORMFEEDBACKPROC();
public delegate void PFNGLBINDBUFFERRANGEPROC( uint target, uint index, uint buffer, int offset, int size );
public delegate void PFNGLBINDBUFFERBASEPROC( uint target, uint index, uint buffer );
public delegate void PFNGLTRANSFORMFEEDBACKVARYINGSPROC( uint program, int count, IntPtr varyings, uint bufferMode );
public delegate void PFNGLGETTRANSFORMFEEDBACKVARYINGPROC( uint program, uint index, int bufSize, ref int length, ref int size, ref uint type, IntPtr name );
public delegate void PFNGLCLAMPCOLORPROC( uint target, uint clamp );
public delegate void PFNGLBEGINCONDITIONALRENDERPROC( uint id, uint mode );
public delegate void PFNGLENDCONDITIONALRENDERPROC();
public delegate void PFNGLVERTEXATTRIBIPOINTERPROC( uint index, int size, uint type, int stride, IntPtr pointer );
public delegate void PFNGLGETVERTEXATTRIBIIVPROC( uint index, uint pname, ref int parameters );
public delegate void PFNGLGETVERTEXATTRIBIUIVPROC( uint index, uint pname, ref uint parameters );
public delegate void PFNGLVERTEXATTRIBI1IPROC( uint index, int x );
public delegate void PFNGLVERTEXATTRIBI2IPROC( uint index, int x, int y );
public delegate void PFNGLVERTEXATTRIBI3IPROC( uint index, int x, int y, int z );
public delegate void PFNGLVERTEXATTRIBI4IPROC( uint index, int x, int y, int z, int w );
public delegate void PFNGLVERTEXATTRIBI1UIPROC( uint index, uint x );
public delegate void PFNGLVERTEXATTRIBI2UIPROC( uint index, uint x, uint y );
public delegate void PFNGLVERTEXATTRIBI3UIPROC( uint index, uint x, uint y, uint z );
public delegate void PFNGLVERTEXATTRIBI4UIPROC( uint index, uint x, uint y, uint z, uint w );
public delegate void PFNGLVERTEXATTRIBI1IVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIBI2IVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIBI3IVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIBI4IVPROC( uint index, ref int v );
public delegate void PFNGLVERTEXATTRIBI1UIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIBI2UIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIBI3UIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIBI4UIVPROC( uint index, ref uint v );
public delegate void PFNGLVERTEXATTRIBI4BVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIBI4SVPROC( uint index, ref short v );
public delegate void PFNGLVERTEXATTRIBI4UBVPROC( uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string v );
public delegate void PFNGLVERTEXATTRIBI4USVPROC( uint index, ref ushort v );
public delegate void PFNGLGETUNIFORMUIVPROC( uint program, int location, ref uint parameters );
public delegate void PFNGLBINDFRAGDATALOCATIONPROC( uint program, uint color, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate int PFNGLGETFRAGDATALOCATIONPROC( uint program, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLUNIFORM1UIPROC( int location, uint v0 );
public delegate void PFNGLUNIFORM2UIPROC( int location, uint v0, uint v1 );
public delegate void PFNGLUNIFORM3UIPROC( int location, uint v0, uint v1, uint v2 );
public delegate void PFNGLUNIFORM4UIPROC( int location, uint v0, uint v1, uint v2, uint v3 );
public delegate void PFNGLUNIFORM1UIVPROC( int location, int count, ref uint value );
public delegate void PFNGLUNIFORM2UIVPROC( int location, int count, ref uint value );
public delegate void PFNGLUNIFORM3UIVPROC( int location, int count, ref uint value );
public delegate void PFNGLUNIFORM4UIVPROC( int location, int count, ref uint value );
public delegate void PFNGLTEXPARAMETERIIVPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLTEXPARAMETERIUIVPROC( uint target, uint pname, ref uint parameters );
public delegate void PFNGLGETTEXPARAMETERIIVPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLGETTEXPARAMETERIUIVPROC( uint target, uint pname, ref uint parameters );
public delegate void PFNGLCLEARBUFFERIVPROC( uint buffer, int drawbuffer, ref int value );
public delegate void PFNGLCLEARBUFFERUIVPROC( uint buffer, int drawbuffer, ref uint value );
public delegate void PFNGLCLEARBUFFERFVPROC( uint buffer, int drawbuffer, ref float value );
public delegate void PFNGLCLEARBUFFERFIPROC( uint buffer, int drawbuffer, float depth, int stencil );
public delegate IntPtr PFNGLGETSTRINGIPROC( uint name, uint index );
public delegate byte PFNGLISRENDERBUFFERPROC( uint renderbuffer );
public delegate void PFNGLBINDRENDERBUFFERPROC( uint target, uint renderbuffer );
public delegate void PFNGLDELETERENDERBUFFERSPROC( int n, ref uint renderbuffers );
public delegate void PFNGLGENRENDERBUFFERSPROC( int n, ref uint renderbuffers );
public delegate void PFNGLRENDERBUFFERSTORAGEPROC( uint target, uint internalformat, int width, int height );
public delegate void PFNGLGETRENDERBUFFERPARAMETERIVPROC( uint target, uint pname, ref int parameters );
public delegate byte PFNGLISFRAMEBUFFERPROC( uint framebuffer );
public delegate void PFNGLBINDFRAMEBUFFERPROC( uint target, uint framebuffer );
public delegate void PFNGLDELETEFRAMEBUFFERSPROC( int n, ref uint framebuffers );
public delegate void PFNGLGENFRAMEBUFFERSPROC( int n, ref uint framebuffers );
public delegate uint PFNGLCHECKFRAMEBUFFERSTATUSPROC( uint target );
public delegate void PFNGLFRAMEBUFFERTEXTURE1DPROC( uint target, uint attachment, uint textarget, uint texture, int level );
public delegate void PFNGLFRAMEBUFFERTEXTURE2DPROC( uint target, uint attachment, uint textarget, uint texture, int level );
public delegate void PFNGLFRAMEBUFFERTEXTURE3DPROC( uint target, uint attachment, uint textarget, uint texture, int level, int zoffset );
public delegate void PFNGLFRAMEBUFFERRENDERBUFFERPROC( uint target, uint attachment, uint renderbuffertarget, uint renderbuffer );
public delegate void PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC( uint target, uint attachment, uint pname, ref int parameters );
public delegate void PFNGLGENERATEMIPMAPPROC( uint target );
public delegate void PFNGLBLITFRAMEBUFFERPROC( int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, uint filter );
public delegate void PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC( uint target, int samples, uint internalformat, int width, int height );
public delegate void PFNGLFRAMEBUFFERTEXTURELAYERPROC( uint target, uint attachment, uint texture, int level, int layer );
public delegate IntPtr PFNGLMAPBUFFERRANGEPROC( uint target, int offset, int length, uint access );
public delegate void PFNGLFLUSHMAPPEDBUFFERRANGEPROC( uint target, int offset, int length );
public delegate void PFNGLBINDVERTEXARRAYPROC( uint array );
public delegate void PFNGLDELETEVERTEXARRAYSPROC( int n, ref uint arrays );
public delegate void PFNGLGENVERTEXARRAYSPROC( int n, ref uint arrays );
public delegate byte PFNGLISVERTEXARRAYPROC( uint array );
#endregion
#region Methods
public static PFNGLCOLORMASKIPROC glColorMaski;
public static PFNGLGETBOOLEANI_VPROC glGetBooleani_v;
public static PFNGLGETINTEGERI_VPROC glGetIntegeri_v;
public static PFNGLENABLEIPROC glEnablei;
public static PFNGLDISABLEIPROC glDisablei;
public static PFNGLISENABLEDIPROC glIsEnabledi;
public static PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback;
public static PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback;
public static PFNGLBINDBUFFERRANGEPROC glBindBufferRange;
public static PFNGLBINDBUFFERBASEPROC glBindBufferBase;
public static PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings;
public static PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glGetTransformFeedbackVarying;
public static PFNGLCLAMPCOLORPROC glClampColor;
public static PFNGLBEGINCONDITIONALRENDERPROC glBeginConditionalRender;
public static PFNGLENDCONDITIONALRENDERPROC glEndConditionalRender;
public static PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
public static PFNGLGETVERTEXATTRIBIIVPROC glGetVertexAttribIiv;
public static PFNGLGETVERTEXATTRIBIUIVPROC glGetVertexAttribIuiv;
public static PFNGLVERTEXATTRIBI1IPROC glVertexAttribI1i;
public static PFNGLVERTEXATTRIBI2IPROC glVertexAttribI2i;
public static PFNGLVERTEXATTRIBI3IPROC glVertexAttribI3i;
public static PFNGLVERTEXATTRIBI4IPROC glVertexAttribI4i;
public static PFNGLVERTEXATTRIBI1UIPROC glVertexAttribI1ui;
public static PFNGLVERTEXATTRIBI2UIPROC glVertexAttribI2ui;
public static PFNGLVERTEXATTRIBI3UIPROC glVertexAttribI3ui;
public static PFNGLVERTEXATTRIBI4UIPROC glVertexAttribI4ui;
public static PFNGLVERTEXATTRIBI1IVPROC glVertexAttribI1iv;
public static PFNGLVERTEXATTRIBI2IVPROC glVertexAttribI2iv;
public static PFNGLVERTEXATTRIBI3IVPROC glVertexAttribI3iv;
public static PFNGLVERTEXATTRIBI4IVPROC glVertexAttribI4iv;
public static PFNGLVERTEXATTRIBI1UIVPROC glVertexAttribI1uiv;
public static PFNGLVERTEXATTRIBI2UIVPROC glVertexAttribI2uiv;
public static PFNGLVERTEXATTRIBI3UIVPROC glVertexAttribI3uiv;
public static PFNGLVERTEXATTRIBI4UIVPROC glVertexAttribI4uiv;
public static PFNGLVERTEXATTRIBI4BVPROC glVertexAttribI4bv;
public static PFNGLVERTEXATTRIBI4SVPROC glVertexAttribI4sv;
public static PFNGLVERTEXATTRIBI4UBVPROC glVertexAttribI4ubv;
public static PFNGLVERTEXATTRIBI4USVPROC glVertexAttribI4usv;
public static PFNGLGETUNIFORMUIVPROC glGetUniformuiv;
public static PFNGLBINDFRAGDATALOCATIONPROC glBindFragDataLocation;
public static PFNGLGETFRAGDATALOCATIONPROC glGetFragDataLocation;
public static PFNGLUNIFORM1UIPROC glUniform1ui;
public static PFNGLUNIFORM2UIPROC glUniform2ui;
public static PFNGLUNIFORM3UIPROC glUniform3ui;
public static PFNGLUNIFORM4UIPROC glUniform4ui;
public static PFNGLUNIFORM1UIVPROC glUniform1uiv;
public static PFNGLUNIFORM2UIVPROC glUniform2uiv;
public static PFNGLUNIFORM3UIVPROC glUniform3uiv;
public static PFNGLUNIFORM4UIVPROC glUniform4uiv;
public static PFNGLTEXPARAMETERIIVPROC glTexParameterIiv;
public static PFNGLTEXPARAMETERIUIVPROC glTexParameterIuiv;
public static PFNGLGETTEXPARAMETERIIVPROC glGetTexParameterIiv;
public static PFNGLGETTEXPARAMETERIUIVPROC glGetTexParameterIuiv;
public static PFNGLCLEARBUFFERIVPROC glClearBufferiv;
public static PFNGLCLEARBUFFERUIVPROC glClearBufferuiv;
public static PFNGLCLEARBUFFERFVPROC glClearBufferfv;
public static PFNGLCLEARBUFFERFIPROC glClearBufferfi;
public static PFNGLGETSTRINGIPROC glGetStringi;
public static PFNGLISRENDERBUFFERPROC glIsRenderbuffer;
public static PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer;
public static PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers;
public static PFNGLGENRENDERBUFFERSPROC glGenRenderbuffers;
public static PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage;
public static PFNGLGETRENDERBUFFERPARAMETERIVPROC glGetRenderbufferParameteriv;
public static PFNGLISFRAMEBUFFERPROC glIsFramebuffer;
public static PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
public static PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
public static PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
public static PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
public static PFNGLFRAMEBUFFERTEXTURE1DPROC glFramebufferTexture1D;
public static PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
public static PFNGLFRAMEBUFFERTEXTURE3DPROC glFramebufferTexture3D;
public static PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
public static PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv;
public static PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
public static PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
public static PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
public static PFNGLFRAMEBUFFERTEXTURELAYERPROC glFramebufferTextureLayer;
public static PFNGLMAPBUFFERRANGEPROC glMapBufferRange;
public static PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange;
public static PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
public static PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
public static PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
public static PFNGLISVERTEXARRAYPROC glIsVertexArray;
#endregion
#endregion
#region OpenGL 3.1
#region Constants
public const uint GL_SAMPLER_2D_RECT = 35683;
public const uint GL_SAMPLER_2D_RECT_SHADOW = 35684;
public const uint GL_SAMPLER_BUFFER = 36290;
public const uint GL_INT_SAMPLER_2D_RECT = 36301;
public const uint GL_INT_SAMPLER_BUFFER = 36304;
public const uint GL_UNSIGNED_INT_SAMPLER_2D_RECT = 36309;
public const uint GL_UNSIGNED_INT_SAMPLER_BUFFER = 36312;
public const uint GL_TEXTURE_BUFFER = 35882;
public const uint GL_MAX_TEXTURE_BUFFER_SIZE = 35883;
public const uint GL_TEXTURE_BINDING_BUFFER = 35884;
public const uint GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 35885;
public const uint GL_TEXTURE_RECTANGLE = 34037;
public const uint GL_TEXTURE_BINDING_RECTANGLE = 34038;
public const uint GL_PROXY_TEXTURE_RECTANGLE = 34039;
public const uint GL_MAX_RECTANGLE_TEXTURE_SIZE = 34040;
public const uint GL_R8_SNORM = 36756;
public const uint GL_RG8_SNORM = 36757;
public const uint GL_RGB8_SNORM = 36758;
public const uint GL_RGBA8_SNORM = 36759;
public const uint GL_R16_SNORM = 36760;
public const uint GL_RG16_SNORM = 36761;
public const uint GL_RGB16_SNORM = 36762;
public const uint GL_RGBA16_SNORM = 36763;
public const uint GL_SIGNED_NORMALIZED = 36764;
public const uint GL_PRIMITIVE_RESTART = 36765;
public const uint GL_PRIMITIVE_RESTART_INDEX = 36766;
public const uint GL_COPY_READ_BUFFER = 36662;
public const uint GL_COPY_WRITE_BUFFER = 36663;
public const uint GL_UNIFORM_BUFFER = 35345;
public const uint GL_UNIFORM_BUFFER_BINDING = 35368;
public const uint GL_UNIFORM_BUFFER_START = 35369;
public const uint GL_UNIFORM_BUFFER_SIZE = 35370;
public const uint GL_MAX_VERTEX_UNIFORM_BLOCKS = 35371;
public const uint GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 35372;
public const uint GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 35373;
public const uint GL_MAX_COMBINED_UNIFORM_BLOCKS = 35374;
public const uint GL_MAX_UNIFORM_BUFFER_BINDINGS = 35375;
public const uint GL_MAX_UNIFORM_BLOCK_SIZE = 35376;
public const uint GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377;
public const uint GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 35378;
public const uint GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379;
public const uint GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380;
public const uint GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 35381;
public const uint GL_ACTIVE_UNIFORM_BLOCKS = 35382;
public const uint GL_UNIFORM_TYPE = 35383;
public const uint GL_UNIFORM_SIZE = 35384;
public const uint GL_UNIFORM_NAME_LENGTH = 35385;
public const uint GL_UNIFORM_BLOCK_INDEX = 35386;
public const uint GL_UNIFORM_OFFSET = 35387;
public const uint GL_UNIFORM_ARRAY_STRIDE = 35388;
public const uint GL_UNIFORM_MATRIX_STRIDE = 35389;
public const uint GL_UNIFORM_IS_ROW_MAJOR = 35390;
public const uint GL_UNIFORM_BLOCK_BINDING = 35391;
public const uint GL_UNIFORM_BLOCK_DATA_SIZE = 35392;
public const uint GL_UNIFORM_BLOCK_NAME_LENGTH = 35393;
public const uint GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394;
public const uint GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 35397;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398;
public const uint GL_INVALID_INDEX = 4294967295;
#endregion
#region Delegates
public delegate void PFNGLDRAWARRAYSINSTANCEDPROC( uint mode, int first, int count, int instancecount );
public delegate void PFNGLDRAWELEMENTSINSTANCEDPROC( uint mode, int count, uint type, IntPtr indices, int instancecount );
public delegate void PFNGLTEXBUFFERPROC( uint target, uint internalformat, uint buffer );
public delegate void PFNGLPRIMITIVERESTARTINDEXPROC( uint index );
public delegate void PFNGLCOPYBUFFERSUBDATAPROC( uint readTarget, uint writeTarget, int readOffset, int writeOffset, int size );
public delegate void PFNGLGETUNIFORMINDICESPROC( uint program, int uniformCount, IntPtr uniformNames, ref uint uniformIndices );
public delegate void PFNGLGETACTIVEUNIFORMSIVPROC( uint program, int uniformCount, ref uint uniformIndices, uint pname, ref int parameters );
public delegate void PFNGLGETACTIVEUNIFORMNAMEPROC( uint program, uint uniformIndex, int bufSize, ref int length, IntPtr uniformName );
public delegate uint PFNGLGETUNIFORMBLOCKINDEXPROC( uint program, [In] [MarshalAs( UnmanagedType.LPStr )] string uniformBlockName );
public delegate void PFNGLGETACTIVEUNIFORMBLOCKIVPROC( uint program, uint uniformBlockIndex, uint pname, ref int parameters );
public delegate void PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC( uint program, uint uniformBlockIndex, int bufSize, ref int length, IntPtr uniformBlockName );
public delegate void PFNGLUNIFORMBLOCKBINDINGPROC( uint program, uint uniformBlockIndex, uint uniformBlockBinding );
#endregion
#region Methods
public static PFNGLDRAWARRAYSINSTANCEDPROC glDrawArraysInstanced;
public static PFNGLDRAWELEMENTSINSTANCEDPROC glDrawElementsInstanced;
public static PFNGLTEXBUFFERPROC glTexBuffer;
public static PFNGLPRIMITIVERESTARTINDEXPROC glPrimitiveRestartIndex;
public static PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData;
public static PFNGLGETUNIFORMINDICESPROC glGetUniformIndices;
public static PFNGLGETACTIVEUNIFORMSIVPROC glGetActiveUniformsiv;
public static PFNGLGETACTIVEUNIFORMNAMEPROC glGetActiveUniformName;
public static PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex;
public static PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv;
public static PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName;
public static PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding;
#endregion
#endregion
#region OpenGL 3.2
#region Constants
public const uint GL_CONTEXT_CORE_PROFILE_BIT = 1;
public const uint GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 2;
public const uint GL_LINES_ADJACENCY = 10;
public const uint GL_LINE_STRIP_ADJACENCY = 11;
public const uint GL_TRIANGLES_ADJACENCY = 12;
public const uint GL_TRIANGLE_STRIP_ADJACENCY = 13;
public const uint GL_PROGRAM_POINT_SIZE = 34370;
public const uint GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 35881;
public const uint GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 36263;
public const uint GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 36264;
public const uint GL_GEOMETRY_SHADER = 36313;
public const uint GL_GEOMETRY_VERTICES_OUT = 35094;
public const uint GL_GEOMETRY_INPUT_TYPE = 35095;
public const uint GL_GEOMETRY_OUTPUT_TYPE = 35096;
public const uint GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 36319;
public const uint GL_MAX_GEOMETRY_OUTPUT_VERTICES = 36320;
public const uint GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 36321;
public const uint GL_MAX_VERTEX_OUTPUT_COMPONENTS = 37154;
public const uint GL_MAX_GEOMETRY_INPUT_COMPONENTS = 37155;
public const uint GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 37156;
public const uint GL_MAX_FRAGMENT_INPUT_COMPONENTS = 37157;
public const uint GL_CONTEXT_PROFILE_MASK = 37158;
public const uint GL_DEPTH_CLAMP = 34383;
public const uint GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 36428;
public const uint GL_FIRST_VERTEX_CONVENTION = 36429;
public const uint GL_LAST_VERTEX_CONVENTION = 36430;
public const uint GL_PROVOKING_VERTEX = 36431;
public const uint GL_TEXTURE_CUBE_MAP_SEAMLESS = 34895;
public const uint GL_MAX_SERVER_WAIT_TIMEOUT = 37137;
public const uint GL_OBJECT_TYPE = 37138;
public const uint GL_SYNC_CONDITION = 37139;
public const uint GL_SYNC_STATUS = 37140;
public const uint GL_SYNC_FLAGS = 37141;
public const uint GL_SYNC_FENCE = 37142;
public const uint GL_SYNC_GPU_COMMANDS_COMPLETE = 37143;
public const uint GL_UNSIGNALED = 37144;
public const uint GL_SIGNALED = 37145;
public const uint GL_ALREADY_SIGNALED = 37146;
public const uint GL_TIMEOUT_EXPIRED = 37147;
public const uint GL_CONDITION_SATISFIED = 37148;
public const uint GL_WAIT_FAILED = 37149;
public const ulong GL_TIMEOUT_IGNORED = 18446744073709551615ul;
public const uint GL_SYNC_FLUSH_COMMANDS_BIT = 1;
public const uint GL_SAMPLE_POSITION = 36432;
public const uint GL_SAMPLE_MASK = 36433;
public const uint GL_SAMPLE_MASK_VALUE = 36434;
public const uint GL_MAX_SAMPLE_MASK_WORDS = 36441;
public const uint GL_TEXTURE_2D_MULTISAMPLE = 37120;
public const uint GL_PROXY_TEXTURE_2D_MULTISAMPLE = 37121;
public const uint GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 37122;
public const uint GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 37123;
public const uint GL_TEXTURE_BINDING_2D_MULTISAMPLE = 37124;
public const uint GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 37125;
public const uint GL_TEXTURE_SAMPLES = 37126;
public const uint GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 37127;
public const uint GL_SAMPLER_2D_MULTISAMPLE = 37128;
public const uint GL_INT_SAMPLER_2D_MULTISAMPLE = 37129;
public const uint GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 37130;
public const uint GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 37131;
public const uint GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 37132;
public const uint GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 37133;
public const uint GL_MAX_COLOR_TEXTURE_SAMPLES = 37134;
public const uint GL_MAX_DEPTH_TEXTURE_SAMPLES = 37135;
public const uint GL_MAX_INTEGER_SAMPLES = 37136;
#endregion
#region Delegates
public delegate void PFNGLDRAWELEMENTSBASEVERTEXPROC( uint mode, int count, uint type, IntPtr indices, int basevertex );
public delegate void PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC( uint mode, uint start, uint end, int count, uint type, IntPtr indices, int basevertex );
public delegate void PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC( uint mode, int count, uint type, IntPtr indices, int instancecount, int basevertex );
public delegate void PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC( uint mode, ref int count, uint type, IntPtr indices, int drawcount, ref int basevertex );
public delegate void PFNGLPROVOKINGVERTEXPROC( uint mode );
public delegate IntPtr PFNGLFENCESYNCPROC( uint condition, uint flags );
public delegate byte PFNGLISSYNCPROC( IntPtr sync );
public delegate void PFNGLDELETESYNCPROC( IntPtr sync );
public delegate uint PFNGLCLIENTWAITSYNCPROC( IntPtr sync, uint flags, uint timeout );
public delegate void PFNGLWAITSYNCPROC( IntPtr sync, uint flags, uint timeout );
public delegate void PFNGLGETINTEGER64VPROC( uint pname, ref int data );
public delegate void PFNGLGETSYNCIVPROC( IntPtr sync, uint pname, int bufSize, ref int length, ref int values );
public delegate void PFNGLGETINTEGER64I_VPROC( uint target, uint index, ref int data );
public delegate void PFNGLGETBUFFERPARAMETERI64VPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLFRAMEBUFFERTEXTUREPROC( uint target, uint attachment, uint texture, int level );
public delegate void PFNGLTEXIMAGE2DMULTISAMPLEPROC( uint target, int samples, uint internalformat, int width, int height, byte fixedsamplelocations );
public delegate void PFNGLTEXIMAGE3DMULTISAMPLEPROC( uint target, int samples, uint internalformat, int width, int height, int depth, byte fixedsamplelocations );
public delegate void PFNGLGETMULTISAMPLEFVPROC( uint pname, uint index, ref float val );
public delegate void PFNGLSAMPLEMASKIPROC( uint maskNumber, uint mask );
#endregion
#region Methods
public static PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex;
public static PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glDrawRangeElementsBaseVertex;
public static PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glDrawElementsInstancedBaseVertex;
public static PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glMultiDrawElementsBaseVertex;
public static PFNGLPROVOKINGVERTEXPROC glProvokingVertex;
public static PFNGLFENCESYNCPROC glFenceSync;
public static PFNGLISSYNCPROC glIsSync;
public static PFNGLDELETESYNCPROC glDeleteSync;
public static PFNGLCLIENTWAITSYNCPROC glClientWaitSync;
public static PFNGLWAITSYNCPROC glWaitSync;
public static PFNGLGETINTEGER64VPROC glGetInteger64v;
public static PFNGLGETSYNCIVPROC glGetSynciv;
public static PFNGLGETINTEGER64I_VPROC glGetInteger64i_v;
public static PFNGLGETBUFFERPARAMETERI64VPROC glGetBufferParameteri64v;
public static PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture;
public static PFNGLTEXIMAGE2DMULTISAMPLEPROC glTexImage2DMultisample;
public static PFNGLTEXIMAGE3DMULTISAMPLEPROC glTexImage3DMultisample;
public static PFNGLGETMULTISAMPLEFVPROC glGetMultisamplefv;
public static PFNGLSAMPLEMASKIPROC glSampleMaski;
#endregion
#endregion
#region OpenGL 3.3
#region Constants
public const uint GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 35070;
public const uint GL_SRC1_COLOR = 35065;
public const uint GL_ONE_MINUS_SRC1_COLOR = 35066;
public const uint GL_ONE_MINUS_SRC1_ALPHA = 35067;
public const uint GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 35068;
public const uint GL_ANY_SAMPLES_PASSED = 35887;
public const uint GL_SAMPLER_BINDING = 35097;
public const uint GL_RGB10_A2UI = 36975;
public const uint GL_TEXTURE_SWIZZLE_R = 36418;
public const uint GL_TEXTURE_SWIZZLE_G = 36419;
public const uint GL_TEXTURE_SWIZZLE_B = 36420;
public const uint GL_TEXTURE_SWIZZLE_A = 36421;
public const uint GL_TEXTURE_SWIZZLE_RGBA = 36422;
public const uint GL_TIME_ELAPSED = 35007;
public const uint GL_TIMESTAMP = 36392;
public const uint GL_INT_2_10_10_10_REV = 36255;
#endregion
#region Delegates
public delegate void PFNGLBINDFRAGDATALOCATIONINDEXEDPROC( uint program, uint colorNumber, uint index, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate int PFNGLGETFRAGDATAINDEXPROC( uint program, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLGENSAMPLERSPROC( int count, ref uint samplers );
public delegate void PFNGLDELETESAMPLERSPROC( int count, ref uint samplers );
public delegate byte PFNGLISSAMPLERPROC( uint sampler );
public delegate void PFNGLBINDSAMPLERPROC( uint unit, uint sampler );
public delegate void PFNGLSAMPLERPARAMETERIPROC( uint sampler, uint pname, int param );
public delegate void PFNGLSAMPLERPARAMETERIVPROC( uint sampler, uint pname, ref int param );
public delegate void PFNGLSAMPLERPARAMETERFPROC( uint sampler, uint pname, float param );
public delegate void PFNGLSAMPLERPARAMETERFVPROC( uint sampler, uint pname, ref float param );
public delegate void PFNGLSAMPLERPARAMETERIIVPROC( uint sampler, uint pname, ref int param );
public delegate void PFNGLSAMPLERPARAMETERIUIVPROC( uint sampler, uint pname, ref uint param );
public delegate void PFNGLGETSAMPLERPARAMETERIVPROC( uint sampler, uint pname, ref int parameters );
public delegate void PFNGLGETSAMPLERPARAMETERIIVPROC( uint sampler, uint pname, ref int parameters );
public delegate void PFNGLGETSAMPLERPARAMETERFVPROC( uint sampler, uint pname, ref float parameters );
public delegate void PFNGLGETSAMPLERPARAMETERIUIVPROC( uint sampler, uint pname, ref uint parameters );
public delegate void PFNGLQUERYCOUNTERPROC( uint id, uint target );
public delegate void PFNGLGETQUERYOBJECTI64VPROC( uint id, uint pname, ref int parameters );
public delegate void PFNGLGETQUERYOBJECTUI64VPROC( uint id, uint pname, ref uint parameters );
public delegate void PFNGLVERTEXATTRIBDIVISORPROC( uint index, uint divisor );
public delegate void PFNGLVERTEXATTRIBP1UIPROC( uint index, uint type, byte normalized, uint value );
public delegate void PFNGLVERTEXATTRIBP1UIVPROC( uint index, uint type, byte normalized, ref uint value );
public delegate void PFNGLVERTEXATTRIBP2UIPROC( uint index, uint type, byte normalized, uint value );
public delegate void PFNGLVERTEXATTRIBP2UIVPROC( uint index, uint type, byte normalized, ref uint value );
public delegate void PFNGLVERTEXATTRIBP3UIPROC( uint index, uint type, byte normalized, uint value );
public delegate void PFNGLVERTEXATTRIBP3UIVPROC( uint index, uint type, byte normalized, ref uint value );
public delegate void PFNGLVERTEXATTRIBP4UIPROC( uint index, uint type, byte normalized, uint value );
public delegate void PFNGLVERTEXATTRIBP4UIVPROC( uint index, uint type, byte normalized, ref uint value );
#endregion
#region Methods
public static PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glBindFragDataLocationIndexed;
public static PFNGLGETFRAGDATAINDEXPROC glGetFragDataIndex;
public static PFNGLGENSAMPLERSPROC glGenSamplers;
public static PFNGLDELETESAMPLERSPROC glDeleteSamplers;
public static PFNGLISSAMPLERPROC glIsSampler;
public static PFNGLBINDSAMPLERPROC glBindSampler;
public static PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri;
public static PFNGLSAMPLERPARAMETERIVPROC glSamplerParameteriv;
public static PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf;
public static PFNGLSAMPLERPARAMETERFVPROC glSamplerParameterfv;
public static PFNGLSAMPLERPARAMETERIIVPROC glSamplerParameterIiv;
public static PFNGLSAMPLERPARAMETERIUIVPROC glSamplerParameterIuiv;
public static PFNGLGETSAMPLERPARAMETERIVPROC glGetSamplerParameteriv;
public static PFNGLGETSAMPLERPARAMETERIIVPROC glGetSamplerParameterIiv;
public static PFNGLGETSAMPLERPARAMETERFVPROC glGetSamplerParameterfv;
public static PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;
public static PFNGLQUERYCOUNTERPROC glQueryCounter;
public static PFNGLGETQUERYOBJECTI64VPROC glGetQueryObjecti64v;
public static PFNGLGETQUERYOBJECTUI64VPROC glGetQueryObjectui64v;
public static PFNGLVERTEXATTRIBDIVISORPROC glVertexAttribDivisor;
public static PFNGLVERTEXATTRIBP1UIPROC glVertexAttribP1ui;
public static PFNGLVERTEXATTRIBP1UIVPROC glVertexAttribP1uiv;
public static PFNGLVERTEXATTRIBP2UIPROC glVertexAttribP2ui;
public static PFNGLVERTEXATTRIBP2UIVPROC glVertexAttribP2uiv;
public static PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui;
public static PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv;
public static PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui;
public static PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv;
#endregion
#endregion
#region OpenGL 4.0
#region Constants
public const uint GL_SAMPLE_SHADING = 35894;
public const uint GL_MIN_SAMPLE_SHADING_VALUE = 35895;
public const uint GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 36446;
public const uint GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 36447;
public const uint GL_TEXTURE_CUBE_MAP_ARRAY = 36873;
public const uint GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 36874;
public const uint GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 36875;
public const uint GL_SAMPLER_CUBE_MAP_ARRAY = 36876;
public const uint GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 36877;
public const uint GL_INT_SAMPLER_CUBE_MAP_ARRAY = 36878;
public const uint GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 36879;
public const uint GL_DRAW_INDIRECT_BUFFER = 36671;
public const uint GL_DRAW_INDIRECT_BUFFER_BINDING = 36675;
public const uint GL_GEOMETRY_SHADER_INVOCATIONS = 34943;
public const uint GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 36442;
public const uint GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 36443;
public const uint GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 36444;
public const uint GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 36445;
public const uint GL_MAX_VERTEX_STREAMS = 36465;
public const uint GL_DOUBLE_VEC2 = 36860;
public const uint GL_DOUBLE_VEC3 = 36861;
public const uint GL_DOUBLE_VEC4 = 36862;
public const uint GL_DOUBLE_MAT2 = 36678;
public const uint GL_DOUBLE_MAT3 = 36679;
public const uint GL_DOUBLE_MAT4 = 36680;
public const uint GL_DOUBLE_MAT2x3 = 36681;
public const uint GL_DOUBLE_MAT2x4 = 36682;
public const uint GL_DOUBLE_MAT3x2 = 36683;
public const uint GL_DOUBLE_MAT3x4 = 36684;
public const uint GL_DOUBLE_MAT4x2 = 36685;
public const uint GL_DOUBLE_MAT4x3 = 36686;
public const uint GL_ACTIVE_SUBROUTINES = 36325;
public const uint GL_ACTIVE_SUBROUTINE_UNIFORMS = 36326;
public const uint GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 36423;
public const uint GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 36424;
public const uint GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 36425;
public const uint GL_MAX_SUBROUTINES = 36327;
public const uint GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 36328;
public const uint GL_NUM_COMPATIBLE_SUBROUTINES = 36426;
public const uint GL_COMPATIBLE_SUBROUTINES = 36427;
public const uint GL_PATCHES = 14;
public const uint GL_PATCH_VERTICES = 36466;
public const uint GL_PATCH_DEFAULT_INNER_LEVEL = 36467;
public const uint GL_PATCH_DEFAULT_OUTER_LEVEL = 36468;
public const uint GL_TESS_CONTROL_OUTPUT_VERTICES = 36469;
public const uint GL_TESS_GEN_MODE = 36470;
public const uint GL_TESS_GEN_SPACING = 36471;
public const uint GL_TESS_GEN_VERTEX_ORDER = 36472;
public const uint GL_TESS_GEN_POINT_MODE = 36473;
public const uint GL_ISOLINES = 36474;
public const uint GL_FRACTIONAL_ODD = 36475;
public const uint GL_FRACTIONAL_EVEN = 36476;
public const uint GL_MAX_PATCH_VERTICES = 36477;
public const uint GL_MAX_TESS_GEN_LEVEL = 36478;
public const uint GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 36479;
public const uint GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 36480;
public const uint GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 36481;
public const uint GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 36482;
public const uint GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 36483;
public const uint GL_MAX_TESS_PATCH_COMPONENTS = 36484;
public const uint GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 36485;
public const uint GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 36486;
public const uint GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 36489;
public const uint GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 36490;
public const uint GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 34924;
public const uint GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 34925;
public const uint GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 36382;
public const uint GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 36383;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 34032;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 34033;
public const uint GL_TESS_EVALUATION_SHADER = 36487;
public const uint GL_TESS_CONTROL_SHADER = 36488;
public const uint GL_TRANSFORM_FEEDBACK = 36386;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 36387;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 36388;
public const uint GL_TRANSFORM_FEEDBACK_BINDING = 36389;
public const uint GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 36464;
#endregion
#region Delegates
public delegate void PFNGLMINSAMPLESHADINGPROC( float value );
public delegate void PFNGLBLENDEQUATIONIPROC( uint buf, uint mode );
public delegate void PFNGLBLENDEQUATIONSEPARATEIPROC( uint buf, uint modeRGB, uint modeAlpha );
public delegate void PFNGLBLENDFUNCIPROC( uint buf, uint src, uint dst );
public delegate void PFNGLBLENDFUNCSEPARATEIPROC( uint buf, uint srcRGB, uint dstRGB, uint srcAlpha, uint dstAlpha );
public delegate void PFNGLDRAWARRAYSINDIRECTPROC( uint mode, IntPtr indirect );
public delegate void PFNGLDRAWELEMENTSINDIRECTPROC( uint mode, uint type, IntPtr indirect );
public delegate void PFNGLUNIFORM1DPROC( int location, double x );
public delegate void PFNGLUNIFORM2DPROC( int location, double x, double y );
public delegate void PFNGLUNIFORM3DPROC( int location, double x, double y, double z );
public delegate void PFNGLUNIFORM4DPROC( int location, double x, double y, double z, double w );
public delegate void PFNGLUNIFORM1DVPROC( int location, int count, ref double value );
public delegate void PFNGLUNIFORM2DVPROC( int location, int count, ref double value );
public delegate void PFNGLUNIFORM3DVPROC( int location, int count, ref double value );
public delegate void PFNGLUNIFORM4DVPROC( int location, int count, ref double value );
public delegate void PFNGLUNIFORMMATRIX2DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX3DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX4DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX2X3DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX2X4DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX3X2DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX3X4DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX4X2DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLUNIFORMMATRIX4X3DVPROC( int location, int count, byte transpose, ref double value );
public delegate void PFNGLGETUNIFORMDVPROC( uint program, int location, ref double parameters );
public delegate int PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC( uint program, uint shadertype, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate uint PFNGLGETSUBROUTINEINDEXPROC( uint program, uint shadertype, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC( uint program, uint shadertype, uint index, uint pname, ref int values );
public delegate void PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC( uint program, uint shadertype, uint index, int bufsize, ref int length, IntPtr name );
public delegate void PFNGLGETACTIVESUBROUTINENAMEPROC( uint program, uint shadertype, uint index, int bufsize, ref int length, IntPtr name );
public delegate void PFNGLUNIFORMSUBROUTINESUIVPROC( uint shadertype, int count, ref uint indices );
public delegate void PFNGLGETUNIFORMSUBROUTINEUIVPROC( uint shadertype, int location, ref uint parameters );
public delegate void PFNGLGETPROGRAMSTAGEIVPROC( uint program, uint shadertype, uint pname, ref int values );
public delegate void PFNGLPATCHPARAMETERIPROC( uint pname, int value );
public delegate void PFNGLPATCHPARAMETERFVPROC( uint pname, ref float values );
public delegate void PFNGLBINDTRANSFORMFEEDBACKPROC( uint target, uint id );
public delegate void PFNGLDELETETRANSFORMFEEDBACKSPROC( int n, ref uint ids );
public delegate void PFNGLGENTRANSFORMFEEDBACKSPROC( int n, ref uint ids );
public delegate byte PFNGLISTRANSFORMFEEDBACKPROC( uint id );
public delegate void PFNGLPAUSETRANSFORMFEEDBACKPROC();
public delegate void PFNGLRESUMETRANSFORMFEEDBACKPROC();
public delegate void PFNGLDRAWTRANSFORMFEEDBACKPROC( uint mode, uint id );
public delegate void PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC( uint mode, uint id, uint stream );
public delegate void PFNGLBEGINQUERYINDEXEDPROC( uint target, uint index, uint id );
public delegate void PFNGLENDQUERYINDEXEDPROC( uint target, uint index );
public delegate void PFNGLGETQUERYINDEXEDIVPROC( uint target, uint index, uint pname, ref int parameters );
#endregion
#region Methods
public static PFNGLMINSAMPLESHADINGPROC glMinSampleShading;
public static PFNGLBLENDEQUATIONIPROC glBlendEquationi;
public static PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
public static PFNGLBLENDFUNCIPROC glBlendFunci;
public static PFNGLBLENDFUNCSEPARATEIPROC glBlendFuncSeparatei;
public static PFNGLDRAWARRAYSINDIRECTPROC glDrawArraysIndirect;
public static PFNGLDRAWELEMENTSINDIRECTPROC glDrawElementsIndirect;
public static PFNGLUNIFORM1DPROC glUniform1d;
public static PFNGLUNIFORM2DPROC glUniform2d;
public static PFNGLUNIFORM3DPROC glUniform3d;
public static PFNGLUNIFORM4DPROC glUniform4d;
public static PFNGLUNIFORM1DVPROC glUniform1dv;
public static PFNGLUNIFORM2DVPROC glUniform2dv;
public static PFNGLUNIFORM3DVPROC glUniform3dv;
public static PFNGLUNIFORM4DVPROC glUniform4dv;
public static PFNGLUNIFORMMATRIX2DVPROC glUniformMatrix2dv;
public static PFNGLUNIFORMMATRIX3DVPROC glUniformMatrix3dv;
public static PFNGLUNIFORMMATRIX4DVPROC glUniformMatrix4dv;
public static PFNGLUNIFORMMATRIX2X3DVPROC glUniformMatrix2x3dv;
public static PFNGLUNIFORMMATRIX2X4DVPROC glUniformMatrix2x4dv;
public static PFNGLUNIFORMMATRIX3X2DVPROC glUniformMatrix3x2dv;
public static PFNGLUNIFORMMATRIX3X4DVPROC glUniformMatrix3x4dv;
public static PFNGLUNIFORMMATRIX4X2DVPROC glUniformMatrix4x2dv;
public static PFNGLUNIFORMMATRIX4X3DVPROC glUniformMatrix4x3dv;
public static PFNGLGETUNIFORMDVPROC glGetUniformdv;
public static PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glGetSubroutineUniformLocation;
public static PFNGLGETSUBROUTINEINDEXPROC glGetSubroutineIndex;
public static PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glGetActiveSubroutineUniformiv;
public static PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glGetActiveSubroutineUniformName;
public static PFNGLGETACTIVESUBROUTINENAMEPROC glGetActiveSubroutineName;
public static PFNGLUNIFORMSUBROUTINESUIVPROC glUniformSubroutinesuiv;
public static PFNGLGETUNIFORMSUBROUTINEUIVPROC glGetUniformSubroutineuiv;
public static PFNGLGETPROGRAMSTAGEIVPROC glGetProgramStageiv;
public static PFNGLPATCHPARAMETERIPROC glPatchParameteri;
public static PFNGLPATCHPARAMETERFVPROC glPatchParameterfv;
public static PFNGLBINDTRANSFORMFEEDBACKPROC glBindTransformFeedback;
public static PFNGLDELETETRANSFORMFEEDBACKSPROC glDeleteTransformFeedbacks;
public static PFNGLGENTRANSFORMFEEDBACKSPROC glGenTransformFeedbacks;
public static PFNGLISTRANSFORMFEEDBACKPROC glIsTransformFeedback;
public static PFNGLPAUSETRANSFORMFEEDBACKPROC glPauseTransformFeedback;
public static PFNGLRESUMETRANSFORMFEEDBACKPROC glResumeTransformFeedback;
public static PFNGLDRAWTRANSFORMFEEDBACKPROC glDrawTransformFeedback;
public static PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glDrawTransformFeedbackStream;
public static PFNGLBEGINQUERYINDEXEDPROC glBeginQueryIndexed;
public static PFNGLENDQUERYINDEXEDPROC glEndQueryIndexed;
public static PFNGLGETQUERYINDEXEDIVPROC glGetQueryIndexediv;
#endregion
#endregion
#region OpenGL 4.1
#region Constants
public const uint GL_FIXED = 5132;
public const uint GL_IMPLEMENTATION_COLOR_READ_TYPE = 35738;
public const uint GL_IMPLEMENTATION_COLOR_READ_FORMAT = 35739;
public const uint GL_LOW_FLOAT = 36336;
public const uint GL_MEDIUM_FLOAT = 36337;
public const uint GL_HIGH_FLOAT = 36338;
public const uint GL_LOW_INT = 36339;
public const uint GL_MEDIUM_INT = 36340;
public const uint GL_HIGH_INT = 36341;
public const uint GL_SHADER_COMPILER = 36346;
public const uint GL_SHADER_BINARY_FORMATS = 36344;
public const uint GL_NUM_SHADER_BINARY_FORMATS = 36345;
public const uint GL_MAX_VERTEX_UNIFORM_VECTORS = 36347;
public const uint GL_MAX_VARYING_VECTORS = 36348;
public const uint GL_MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
public const uint GL_RGB565 = 36194;
public const uint GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 33367;
public const uint GL_PROGRAM_BINARY_LENGTH = 34625;
public const uint GL_NUM_PROGRAM_BINARY_FORMATS = 34814;
public const uint GL_PROGRAM_BINARY_FORMATS = 34815;
public const int GL_VERTEX_SHADER_BIT = 1;
public const int GL_FRAGMENT_SHADER_BIT = 2;
public const int GL_GEOMETRY_SHADER_BIT = 4;
public const int GL_TESS_CONTROL_SHADER_BIT = 8;
public const int GL_TESS_EVALUATION_SHADER_BIT = 16;
public const int GL_ALL_SHADER_BITS = -1;
public const uint GL_PROGRAM_SEPARABLE = 33368;
public const uint GL_ACTIVE_PROGRAM = 33369;
public const uint GL_PROGRAM_PIPELINE_BINDING = 33370;
public const uint GL_MAX_VIEWPORTS = 33371;
public const uint GL_VIEWPORT_SUBPIXEL_BITS = 33372;
public const uint GL_VIEWPORT_BOUNDS_RANGE = 33373;
public const uint GL_LAYER_PROVOKING_VERTEX = 33374;
public const uint GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 33375;
public const uint GL_UNDEFINED_VERTEX = 33376;
#endregion
#region Delegates
public delegate void PFNGLRELEASESHADERCOMPILERPROC();
public delegate void PFNGLSHADERBINARYPROC( int count, ref uint shaders, uint binaryformat, IntPtr binary, int length );
public delegate void PFNGLGETSHADERPRECISIONFORMATPROC( uint shadertype, uint precisiontype, ref int range, ref int precision );
public delegate void PFNGLDEPTHRANGEFPROC( float n, float f );
public delegate void PFNGLCLEARDEPTHFPROC( float d );
public delegate void PFNGLGETPROGRAMBINARYPROC( uint program, int bufSize, ref int length, ref uint binaryFormat, IntPtr binary );
public delegate void PFNGLPROGRAMBINARYPROC( uint program, uint binaryFormat, IntPtr binary, int length );
public delegate void PFNGLPROGRAMPARAMETERIPROC( uint program, uint pname, int value );
public delegate void PFNGLUSEPROGRAMSTAGESPROC( uint pipeline, uint stages, uint program );
public delegate void PFNGLACTIVESHADERPROGRAMPROC( uint pipeline, uint program );
public delegate uint PFNGLCREATESHADERPROGRAMVPROC( uint type, int count, IntPtr strings );
public delegate void PFNGLBINDPROGRAMPIPELINEPROC( uint pipeline );
public delegate void PFNGLDELETEPROGRAMPIPELINESPROC( int n, ref uint pipelines );
public delegate void PFNGLGENPROGRAMPIPELINESPROC( int n, ref uint pipelines );
public delegate byte PFNGLISPROGRAMPIPELINEPROC( uint pipeline );
public delegate void PFNGLGETPROGRAMPIPELINEIVPROC( uint pipeline, uint pname, ref int parameters );
public delegate void PFNGLPROGRAMUNIFORM1IPROC( uint program, int location, int v0 );
public delegate void PFNGLPROGRAMUNIFORM1IVPROC( uint program, int location, int count, ref int value );
public delegate void PFNGLPROGRAMUNIFORM1FPROC( uint program, int location, float v0 );
public delegate void PFNGLPROGRAMUNIFORM1FVPROC( uint program, int location, int count, ref float value );
public delegate void PFNGLPROGRAMUNIFORM1DPROC( uint program, int location, double v0 );
public delegate void PFNGLPROGRAMUNIFORM1DVPROC( uint program, int location, int count, ref double value );
public delegate void PFNGLPROGRAMUNIFORM1UIPROC( uint program, int location, uint v0 );
public delegate void PFNGLPROGRAMUNIFORM1UIVPROC( uint program, int location, int count, ref uint value );
public delegate void PFNGLPROGRAMUNIFORM2IPROC( uint program, int location, int v0, int v1 );
public delegate void PFNGLPROGRAMUNIFORM2IVPROC( uint program, int location, int count, ref int value );
public delegate void PFNGLPROGRAMUNIFORM2FPROC( uint program, int location, float v0, float v1 );
public delegate void PFNGLPROGRAMUNIFORM2FVPROC( uint program, int location, int count, ref float value );
public delegate void PFNGLPROGRAMUNIFORM2DPROC( uint program, int location, double v0, double v1 );
public delegate void PFNGLPROGRAMUNIFORM2DVPROC( uint program, int location, int count, ref double value );
public delegate void PFNGLPROGRAMUNIFORM2UIPROC( uint program, int location, uint v0, uint v1 );
public delegate void PFNGLPROGRAMUNIFORM2UIVPROC( uint program, int location, int count, ref uint value );
public delegate void PFNGLPROGRAMUNIFORM3IPROC( uint program, int location, int v0, int v1, int v2 );
public delegate void PFNGLPROGRAMUNIFORM3IVPROC( uint program, int location, int count, ref int value );
public delegate void PFNGLPROGRAMUNIFORM3FPROC( uint program, int location, float v0, float v1, float v2 );
public delegate void PFNGLPROGRAMUNIFORM3FVPROC( uint program, int location, int count, ref float value );
public delegate void PFNGLPROGRAMUNIFORM3DPROC( uint program, int location, double v0, double v1, double v2 );
public delegate void PFNGLPROGRAMUNIFORM3DVPROC( uint program, int location, int count, ref double value );
public delegate void PFNGLPROGRAMUNIFORM3UIPROC( uint program, int location, uint v0, uint v1, uint v2 );
public delegate void PFNGLPROGRAMUNIFORM3UIVPROC( uint program, int location, int count, ref uint value );
public delegate void PFNGLPROGRAMUNIFORM4IPROC( uint program, int location, int v0, int v1, int v2, int v3 );
public delegate void PFNGLPROGRAMUNIFORM4IVPROC( uint program, int location, int count, ref int value );
public delegate void PFNGLPROGRAMUNIFORM4FPROC( uint program, int location, float v0, float v1, float v2, float v3 );
public delegate void PFNGLPROGRAMUNIFORM4FVPROC( uint program, int location, int count, ref float value );
public delegate void PFNGLPROGRAMUNIFORM4DPROC( uint program, int location, double v0, double v1, double v2, double v3 );
public delegate void PFNGLPROGRAMUNIFORM4DVPROC( uint program, int location, int count, ref double value );
public delegate void PFNGLPROGRAMUNIFORM4UIPROC( uint program, int location, uint v0, uint v1, uint v2, uint v3 );
public delegate void PFNGLPROGRAMUNIFORM4UIVPROC( uint program, int location, int count, ref uint value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC( uint program, int location, int count, byte transpose, ref float value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC( uint program, int location, int count, byte transpose, ref double value );
public delegate void PFNGLVALIDATEPROGRAMPIPELINEPROC( uint pipeline );
public delegate void PFNGLGETPROGRAMPIPELINEINFOLOGPROC( uint pipeline, int bufSize, ref int length, IntPtr infoLog );
public delegate void PFNGLVERTEXATTRIBL1DPROC( uint index, double x );
public delegate void PFNGLVERTEXATTRIBL2DPROC( uint index, double x, double y );
public delegate void PFNGLVERTEXATTRIBL3DPROC( uint index, double x, double y, double z );
public delegate void PFNGLVERTEXATTRIBL4DPROC( uint index, double x, double y, double z, double w );
public delegate void PFNGLVERTEXATTRIBL1DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIBL2DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIBL3DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIBL4DVPROC( uint index, ref double v );
public delegate void PFNGLVERTEXATTRIBLPOINTERPROC( uint index, int size, uint type, int stride, IntPtr pointer );
public delegate void PFNGLGETVERTEXATTRIBLDVPROC( uint index, uint pname, ref double parameters );
public delegate void PFNGLVIEWPORTARRAYVPROC( uint first, int count, ref float v );
public delegate void PFNGLVIEWPORTINDEXEDFPROC( uint index, float x, float y, float w, float h );
public delegate void PFNGLVIEWPORTINDEXEDFVPROC( uint index, ref float v );
public delegate void PFNGLSCISSORARRAYVPROC( uint first, int count, ref int v );
public delegate void PFNGLSCISSORINDEXEDPROC( uint index, int left, int bottom, int width, int height );
public delegate void PFNGLSCISSORINDEXEDVPROC( uint index, ref int v );
public delegate void PFNGLDEPTHRANGEARRAYVPROC( uint first, int count, ref double v );
public delegate void PFNGLDEPTHRANGEINDEXEDPROC( uint index, double n, double f );
public delegate void PFNGLGETFLOATI_VPROC( uint target, uint index, ref float data );
public delegate void PFNGLGETDOUBLEI_VPROC( uint target, uint index, ref double data );
#endregion
#region Methods
public static PFNGLRELEASESHADERCOMPILERPROC glReleaseShaderCompiler;
public static PFNGLSHADERBINARYPROC glShaderBinary;
public static PFNGLGETSHADERPRECISIONFORMATPROC glGetShaderPrecisionFormat;
public static PFNGLDEPTHRANGEFPROC glDepthRangef;
public static PFNGLCLEARDEPTHFPROC glClearDepthf;
public static PFNGLGETPROGRAMBINARYPROC glGetProgramBinary;
public static PFNGLPROGRAMBINARYPROC glProgramBinary;
public static PFNGLPROGRAMPARAMETERIPROC glProgramParameteri;
public static PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
public static PFNGLACTIVESHADERPROGRAMPROC glActiveShaderProgram;
public static PFNGLCREATESHADERPROGRAMVPROC glCreateShaderProgramv;
public static PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline;
public static PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines;
public static PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
public static PFNGLISPROGRAMPIPELINEPROC glIsProgramPipeline;
public static PFNGLGETPROGRAMPIPELINEIVPROC glGetProgramPipelineiv;
public static PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i;
public static PFNGLPROGRAMUNIFORM1IVPROC glProgramUniform1iv;
public static PFNGLPROGRAMUNIFORM1FPROC glProgramUniform1f;
public static PFNGLPROGRAMUNIFORM1FVPROC glProgramUniform1fv;
public static PFNGLPROGRAMUNIFORM1DPROC glProgramUniform1d;
public static PFNGLPROGRAMUNIFORM1DVPROC glProgramUniform1dv;
public static PFNGLPROGRAMUNIFORM1UIPROC glProgramUniform1ui;
public static PFNGLPROGRAMUNIFORM1UIVPROC glProgramUniform1uiv;
public static PFNGLPROGRAMUNIFORM2IPROC glProgramUniform2i;
public static PFNGLPROGRAMUNIFORM2IVPROC glProgramUniform2iv;
public static PFNGLPROGRAMUNIFORM2FPROC glProgramUniform2f;
public static PFNGLPROGRAMUNIFORM2FVPROC glProgramUniform2fv;
public static PFNGLPROGRAMUNIFORM2DPROC glProgramUniform2d;
public static PFNGLPROGRAMUNIFORM2DVPROC glProgramUniform2dv;
public static PFNGLPROGRAMUNIFORM2UIPROC glProgramUniform2ui;
public static PFNGLPROGRAMUNIFORM2UIVPROC glProgramUniform2uiv;
public static PFNGLPROGRAMUNIFORM3IPROC glProgramUniform3i;
public static PFNGLPROGRAMUNIFORM3IVPROC glProgramUniform3iv;
public static PFNGLPROGRAMUNIFORM3FPROC glProgramUniform3f;
public static PFNGLPROGRAMUNIFORM3FVPROC glProgramUniform3fv;
public static PFNGLPROGRAMUNIFORM3DPROC glProgramUniform3d;
public static PFNGLPROGRAMUNIFORM3DVPROC glProgramUniform3dv;
public static PFNGLPROGRAMUNIFORM3UIPROC glProgramUniform3ui;
public static PFNGLPROGRAMUNIFORM3UIVPROC glProgramUniform3uiv;
public static PFNGLPROGRAMUNIFORM4IPROC glProgramUniform4i;
public static PFNGLPROGRAMUNIFORM4IVPROC glProgramUniform4iv;
public static PFNGLPROGRAMUNIFORM4FPROC glProgramUniform4f;
public static PFNGLPROGRAMUNIFORM4FVPROC glProgramUniform4fv;
public static PFNGLPROGRAMUNIFORM4DPROC glProgramUniform4d;
public static PFNGLPROGRAMUNIFORM4DVPROC glProgramUniform4dv;
public static PFNGLPROGRAMUNIFORM4UIPROC glProgramUniform4ui;
public static PFNGLPROGRAMUNIFORM4UIVPROC glProgramUniform4uiv;
public static PFNGLPROGRAMUNIFORMMATRIX2FVPROC glProgramUniformMatrix2fv;
public static PFNGLPROGRAMUNIFORMMATRIX3FVPROC glProgramUniformMatrix3fv;
public static PFNGLPROGRAMUNIFORMMATRIX4FVPROC glProgramUniformMatrix4fv;
public static PFNGLPROGRAMUNIFORMMATRIX2DVPROC glProgramUniformMatrix2dv;
public static PFNGLPROGRAMUNIFORMMATRIX3DVPROC glProgramUniformMatrix3dv;
public static PFNGLPROGRAMUNIFORMMATRIX4DVPROC glProgramUniformMatrix4dv;
public static PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glProgramUniformMatrix2x3fv;
public static PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glProgramUniformMatrix3x2fv;
public static PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glProgramUniformMatrix2x4fv;
public static PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glProgramUniformMatrix4x2fv;
public static PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glProgramUniformMatrix3x4fv;
public static PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glProgramUniformMatrix4x3fv;
public static PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glProgramUniformMatrix2x3dv;
public static PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glProgramUniformMatrix3x2dv;
public static PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glProgramUniformMatrix2x4dv;
public static PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glProgramUniformMatrix4x2dv;
public static PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glProgramUniformMatrix3x4dv;
public static PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glProgramUniformMatrix4x3dv;
public static PFNGLVALIDATEPROGRAMPIPELINEPROC glValidateProgramPipeline;
public static PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog;
public static PFNGLVERTEXATTRIBL1DPROC glVertexAttribL1d;
public static PFNGLVERTEXATTRIBL2DPROC glVertexAttribL2d;
public static PFNGLVERTEXATTRIBL3DPROC glVertexAttribL3d;
public static PFNGLVERTEXATTRIBL4DPROC glVertexAttribL4d;
public static PFNGLVERTEXATTRIBL1DVPROC glVertexAttribL1dv;
public static PFNGLVERTEXATTRIBL2DVPROC glVertexAttribL2dv;
public static PFNGLVERTEXATTRIBL3DVPROC glVertexAttribL3dv;
public static PFNGLVERTEXATTRIBL4DVPROC glVertexAttribL4dv;
public static PFNGLVERTEXATTRIBLPOINTERPROC glVertexAttribLPointer;
public static PFNGLGETVERTEXATTRIBLDVPROC glGetVertexAttribLdv;
public static PFNGLVIEWPORTARRAYVPROC glViewportArrayv;
public static PFNGLVIEWPORTINDEXEDFPROC glViewportIndexedf;
public static PFNGLVIEWPORTINDEXEDFVPROC glViewportIndexedfv;
public static PFNGLSCISSORARRAYVPROC glScissorArrayv;
public static PFNGLSCISSORINDEXEDPROC glScissorIndexed;
public static PFNGLSCISSORINDEXEDVPROC glScissorIndexedv;
public static PFNGLDEPTHRANGEARRAYVPROC glDepthRangeArrayv;
public static PFNGLDEPTHRANGEINDEXEDPROC glDepthRangeIndexed;
public static PFNGLGETFLOATI_VPROC glGetFloati_v;
public static PFNGLGETDOUBLEI_VPROC glGetDoublei_v;
#endregion
#endregion
#region OpenGL 4.2
#region Constants
public const uint GL_COPY_READ_BUFFER_BINDING = 36662;
public const uint GL_COPY_WRITE_BUFFER_BINDING = 36663;
public const uint GL_TRANSFORM_FEEDBACK_ACTIVE = 36388;
public const uint GL_TRANSFORM_FEEDBACK_PAUSED = 36387;
public const uint GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 37159;
public const uint GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 37160;
public const uint GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 37161;
public const uint GL_UNPACK_COMPRESSED_BLOCK_SIZE = 37162;
public const uint GL_PACK_COMPRESSED_BLOCK_WIDTH = 37163;
public const uint GL_PACK_COMPRESSED_BLOCK_HEIGHT = 37164;
public const uint GL_PACK_COMPRESSED_BLOCK_DEPTH = 37165;
public const uint GL_PACK_COMPRESSED_BLOCK_SIZE = 37166;
public const uint GL_NUM_SAMPLE_COUNTS = 37760;
public const uint GL_MIN_MAP_BUFFER_ALIGNMENT = 37052;
public const uint GL_ATOMIC_COUNTER_BUFFER = 37568;
public const uint GL_ATOMIC_COUNTER_BUFFER_BINDING = 37569;
public const uint GL_ATOMIC_COUNTER_BUFFER_START = 37570;
public const uint GL_ATOMIC_COUNTER_BUFFER_SIZE = 37571;
public const uint GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 37572;
public const uint GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 37573;
public const uint GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 37574;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 37575;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 37576;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 37577;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 37578;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 37579;
public const uint GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 37580;
public const uint GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 37581;
public const uint GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 37582;
public const uint GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 37583;
public const uint GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 37584;
public const uint GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 37585;
public const uint GL_MAX_VERTEX_ATOMIC_COUNTERS = 37586;
public const uint GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 37587;
public const uint GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 37588;
public const uint GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 37589;
public const uint GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 37590;
public const uint GL_MAX_COMBINED_ATOMIC_COUNTERS = 37591;
public const uint GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 37592;
public const uint GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 37596;
public const uint GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 37593;
public const uint GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 37594;
public const uint GL_UNSIGNED_INT_ATOMIC_COUNTER = 37595;
public const int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 1;
public const int GL_ELEMENT_ARRAY_BARRIER_BIT = 2;
public const int GL_UNIFORM_BARRIER_BIT = 4;
public const int GL_TEXTURE_FETCH_BARRIER_BIT = 8;
public const int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 32;
public const int GL_COMMAND_BARRIER_BIT = 64;
public const int GL_PIXEL_BUFFER_BARRIER_BIT = 128;
public const int GL_TEXTURE_UPDATE_BARRIER_BIT = 256;
public const int GL_BUFFER_UPDATE_BARRIER_BIT = 512;
public const int GL_FRAMEBUFFER_BARRIER_BIT = 1024;
public const int GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 2048;
public const int GL_ATOMIC_COUNTER_BARRIER_BIT = 4096;
public const int GL_ALL_BARRIER_BITS = -1;
public const uint GL_MAX_IMAGE_UNITS = 36664;
public const uint GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 36665;
public const uint GL_IMAGE_BINDING_NAME = 36666;
public const uint GL_IMAGE_BINDING_LEVEL = 36667;
public const uint GL_IMAGE_BINDING_LAYERED = 36668;
public const uint GL_IMAGE_BINDING_LAYER = 36669;
public const uint GL_IMAGE_BINDING_ACCESS = 36670;
public const uint GL_IMAGE_1D = 36940;
public const uint GL_IMAGE_2D = 36941;
public const uint GL_IMAGE_3D = 36942;
public const uint GL_IMAGE_2D_RECT = 36943;
public const uint GL_IMAGE_CUBE = 36944;
public const uint GL_IMAGE_BUFFER = 36945;
public const uint GL_IMAGE_1D_ARRAY = 36946;
public const uint GL_IMAGE_2D_ARRAY = 36947;
public const uint GL_IMAGE_CUBE_MAP_ARRAY = 36948;
public const uint GL_IMAGE_2D_MULTISAMPLE = 36949;
public const uint GL_IMAGE_2D_MULTISAMPLE_ARRAY = 36950;
public const uint GL_INT_IMAGE_1D = 36951;
public const uint GL_INT_IMAGE_2D = 36952;
public const uint GL_INT_IMAGE_3D = 36953;
public const uint GL_INT_IMAGE_2D_RECT = 36954;
public const uint GL_INT_IMAGE_CUBE = 36955;
public const uint GL_INT_IMAGE_BUFFER = 36956;
public const uint GL_INT_IMAGE_1D_ARRAY = 36957;
public const uint GL_INT_IMAGE_2D_ARRAY = 36958;
public const uint GL_INT_IMAGE_CUBE_MAP_ARRAY = 36959;
public const uint GL_INT_IMAGE_2D_MULTISAMPLE = 36960;
public const uint GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 36961;
public const uint GL_UNSIGNED_INT_IMAGE_1D = 36962;
public const uint GL_UNSIGNED_INT_IMAGE_2D = 36963;
public const uint GL_UNSIGNED_INT_IMAGE_3D = 36964;
public const uint GL_UNSIGNED_INT_IMAGE_2D_RECT = 36965;
public const uint GL_UNSIGNED_INT_IMAGE_CUBE = 36966;
public const uint GL_UNSIGNED_INT_IMAGE_BUFFER = 36967;
public const uint GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 36968;
public const uint GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 36969;
public const uint GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 36970;
public const uint GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 36971;
public const uint GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 36972;
public const uint GL_MAX_IMAGE_SAMPLES = 36973;
public const uint GL_IMAGE_BINDING_FORMAT = 36974;
public const uint GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 37063;
public const uint GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 37064;
public const uint GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 37065;
public const uint GL_MAX_VERTEX_IMAGE_UNIFORMS = 37066;
public const uint GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 37067;
public const uint GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 37068;
public const uint GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 37069;
public const uint GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 37070;
public const uint GL_MAX_COMBINED_IMAGE_UNIFORMS = 37071;
public const uint GL_COMPRESSED_RGBA_BPTC_UNORM = 36492;
public const uint GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 36493;
public const uint GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 36494;
public const uint GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 36495;
public const uint GL_TEXTURE_IMMUTABLE_FORMAT = 37167;
#endregion
#region Delegates
public delegate void PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC( uint mode, int first, int count, int instancecount, uint baseinstance );
public delegate void PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC( uint mode, int count, uint type, IntPtr indices, int instancecount, uint baseinstance );
public delegate void PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC( uint mode, int count, uint type, IntPtr indices, int instancecount, int basevertex, uint baseinstance );
public delegate void PFNGLGETINTERNALFORMATIVPROC( uint target, uint internalformat, uint pname, int bufSize, ref int parameters );
public delegate void PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC( uint program, uint bufferIndex, uint pname, ref int parameters );
public delegate void PFNGLBINDIMAGETEXTUREPROC( uint unit, uint texture, int level, byte layered, int layer, uint access, uint format );
public delegate void PFNGLMEMORYBARRIERPROC( uint barriers );
public delegate void PFNGLTEXSTORAGE1DPROC( uint target, int levels, uint internalformat, int width );
public delegate void PFNGLTEXSTORAGE2DPROC( uint target, int levels, uint internalformat, int width, int height );
public delegate void PFNGLTEXSTORAGE3DPROC( uint target, int levels, uint internalformat, int width, int height, int depth );
public delegate void PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC( uint mode, uint id, int instancecount );
public delegate void PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC( uint mode, uint id, uint stream, int instancecount );
#endregion
#region Methods
public static PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glDrawArraysInstancedBaseInstance;
public static PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glDrawElementsInstancedBaseInstance;
public static PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glDrawElementsInstancedBaseVertexBaseInstance;
public static PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ;
public static PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glGetActiveAtomicCounterBufferiv;
public static PFNGLBINDIMAGETEXTUREPROC glBindImageTexture;
public static PFNGLMEMORYBARRIERPROC glMemoryBarrier;
public static PFNGLTEXSTORAGE1DPROC glTexStorage1D;
public static PFNGLTEXSTORAGE2DPROC glTexStorage2D;
public static PFNGLTEXSTORAGE3DPROC glTexStorage3D;
public static PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glDrawTransformFeedbackInstanced;
public static PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glDrawTransformFeedbackStreamInstanced;
#endregion
#endregion
#region OpenGL 4.3
#region Constants
public const uint GL_NUM_SHADING_LANGUAGE_VERSIONS = 33513;
public const uint GL_VERTEX_ATTRIB_ARRAY_LONG = 34638;
public const uint GL_COMPRESSED_RGB8_ETC2 = 37492;
public const uint GL_COMPRESSED_SRGB8_ETC2 = 37493;
public const uint GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494;
public const uint GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495;
public const uint GL_COMPRESSED_RGBA8_ETC2_EAC = 37496;
public const uint GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497;
public const uint GL_COMPRESSED_R11_EAC = 37488;
public const uint GL_COMPRESSED_SIGNED_R11_EAC = 37489;
public const uint GL_COMPRESSED_RG11_EAC = 37490;
public const uint GL_COMPRESSED_SIGNED_RG11_EAC = 37491;
public const uint GL_PRIMITIVE_RESTART_FIXED_INDEX = 36201;
public const uint GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 36202;
public const uint GL_MAX_ELEMENT_INDEX = 36203;
public const uint GL_COMPUTE_SHADER = 37305;
public const uint GL_MAX_COMPUTE_UNIFORM_BLOCKS = 37307;
public const uint GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 37308;
public const uint GL_MAX_COMPUTE_IMAGE_UNIFORMS = 37309;
public const uint GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 33378;
public const uint GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 33379;
public const uint GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 33380;
public const uint GL_MAX_COMPUTE_ATOMIC_COUNTERS = 33381;
public const uint GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 33382;
public const uint GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 37099;
public const uint GL_MAX_COMPUTE_WORK_GROUP_COUNT = 37310;
public const uint GL_MAX_COMPUTE_WORK_GROUP_SIZE = 37311;
public const uint GL_COMPUTE_WORK_GROUP_SIZE = 33383;
public const uint GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 37100;
public const uint GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 37101;
public const uint GL_DISPATCH_INDIRECT_BUFFER = 37102;
public const uint GL_DISPATCH_INDIRECT_BUFFER_BINDING = 37103;
public const uint GL_COMPUTE_SHADER_BIT = 32;
public const uint GL_DEBUG_OUTPUT_SYNCHRONOUS = 33346;
public const uint GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 33347;
public const uint GL_DEBUG_CALLBACK_FUNCTION = 33348;
public const uint GL_DEBUG_CALLBACK_USER_PARAM = 33349;
public const uint GL_DEBUG_SOURCE_API = 33350;
public const uint GL_DEBUG_SOURCE_WINDOW_SYSTEM = 33351;
public const uint GL_DEBUG_SOURCE_SHADER_COMPILER = 33352;
public const uint GL_DEBUG_SOURCE_THIRD_PARTY = 33353;
public const uint GL_DEBUG_SOURCE_APPLICATION = 33354;
public const uint GL_DEBUG_SOURCE_OTHER = 33355;
public const uint GL_DEBUG_TYPE_ERROR = 33356;
public const uint GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 33357;
public const uint GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 33358;
public const uint GL_DEBUG_TYPE_PORTABILITY = 33359;
public const uint GL_DEBUG_TYPE_PERFORMANCE = 33360;
public const uint GL_DEBUG_TYPE_OTHER = 33361;
public const uint GL_MAX_DEBUG_MESSAGE_LENGTH = 37187;
public const uint GL_MAX_DEBUG_LOGGED_MESSAGES = 37188;
public const uint GL_DEBUG_LOGGED_MESSAGES = 37189;
public const uint GL_DEBUG_SEVERITY_HIGH = 37190;
public const uint GL_DEBUG_SEVERITY_MEDIUM = 37191;
public const uint GL_DEBUG_SEVERITY_LOW = 37192;
public const uint GL_DEBUG_TYPE_MARKER = 33384;
public const uint GL_DEBUG_TYPE_PUSH_GROUP = 33385;
public const uint GL_DEBUG_TYPE_POP_GROUP = 33386;
public const uint GL_DEBUG_SEVERITY_NOTIFICATION = 33387;
public const uint GL_MAX_DEBUG_GROUP_STACK_DEPTH = 33388;
public const uint GL_DEBUG_GROUP_STACK_DEPTH = 33389;
public const uint GL_BUFFER = 33504;
public const uint GL_SHADER = 33505;
public const uint GL_PROGRAM = 33506;
public const uint GL_QUERY = 33507;
public const uint GL_PROGRAM_PIPELINE = 33508;
public const uint GL_SAMPLER = 33510;
public const uint GL_MAX_LABEL_LENGTH = 33512;
public const uint GL_DEBUG_OUTPUT = 37600;
public const int GL_CONTEXT_FLAG_DEBUG_BIT = 2;
public const uint GL_MAX_UNIFORM_LOCATIONS = 33390;
public const uint GL_FRAMEBUFFER_DEFAULT_WIDTH = 37648;
public const uint GL_FRAMEBUFFER_DEFAULT_HEIGHT = 37649;
public const uint GL_FRAMEBUFFER_DEFAULT_LAYERS = 37650;
public const uint GL_FRAMEBUFFER_DEFAULT_SAMPLES = 37651;
public const uint GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 37652;
public const uint GL_MAX_FRAMEBUFFER_WIDTH = 37653;
public const uint GL_MAX_FRAMEBUFFER_HEIGHT = 37654;
public const uint GL_MAX_FRAMEBUFFER_LAYERS = 37655;
public const uint GL_MAX_FRAMEBUFFER_SAMPLES = 37656;
public const uint GL_INTERNALFORMAT_SUPPORTED = 33391;
public const uint GL_INTERNALFORMAT_PREFERRED = 33392;
public const uint GL_INTERNALFORMAT_RED_SIZE = 33393;
public const uint GL_INTERNALFORMAT_GREEN_SIZE = 33394;
public const uint GL_INTERNALFORMAT_BLUE_SIZE = 33395;
public const uint GL_INTERNALFORMAT_ALPHA_SIZE = 33396;
public const uint GL_INTERNALFORMAT_DEPTH_SIZE = 33397;
public const uint GL_INTERNALFORMAT_STENCIL_SIZE = 33398;
public const uint GL_INTERNALFORMAT_SHARED_SIZE = 33399;
public const uint GL_INTERNALFORMAT_RED_TYPE = 33400;
public const uint GL_INTERNALFORMAT_GREEN_TYPE = 33401;
public const uint GL_INTERNALFORMAT_BLUE_TYPE = 33402;
public const uint GL_INTERNALFORMAT_ALPHA_TYPE = 33403;
public const uint GL_INTERNALFORMAT_DEPTH_TYPE = 33404;
public const uint GL_INTERNALFORMAT_STENCIL_TYPE = 33405;
public const uint GL_MAX_WIDTH = 33406;
public const uint GL_MAX_HEIGHT = 33407;
public const uint GL_MAX_DEPTH = 33408;
public const uint GL_MAX_LAYERS = 33409;
public const uint GL_MAX_COMBINED_DIMENSIONS = 33410;
public const uint GL_COLOR_COMPONENTS = 33411;
public const uint GL_DEPTH_COMPONENTS = 33412;
public const uint GL_STENCIL_COMPONENTS = 33413;
public const uint GL_COLOR_RENDERABLE = 33414;
public const uint GL_DEPTH_RENDERABLE = 33415;
public const uint GL_STENCIL_RENDERABLE = 33416;
public const uint GL_FRAMEBUFFER_RENDERABLE = 33417;
public const uint GL_FRAMEBUFFER_RENDERABLE_LAYERED = 33418;
public const uint GL_FRAMEBUFFER_BLEND = 33419;
public const uint GL_READ_PIXELS = 33420;
public const uint GL_READ_PIXELS_FORMAT = 33421;
public const uint GL_READ_PIXELS_TYPE = 33422;
public const uint GL_TEXTURE_IMAGE_FORMAT = 33423;
public const uint GL_TEXTURE_IMAGE_TYPE = 33424;
public const uint GL_GET_TEXTURE_IMAGE_FORMAT = 33425;
public const uint GL_GET_TEXTURE_IMAGE_TYPE = 33426;
public const uint GL_MIPMAP = 33427;
public const uint GL_MANUAL_GENERATE_MIPMAP = 33428;
public const uint GL_AUTO_GENERATE_MIPMAP = 33429;
public const uint GL_COLOR_ENCODING = 33430;
public const uint GL_SRGB_READ = 33431;
public const uint GL_SRGB_WRITE = 33432;
public const uint GL_FILTER = 33434;
public const uint GL_VERTEX_TEXTURE = 33435;
public const uint GL_TESS_CONTROL_TEXTURE = 33436;
public const uint GL_TESS_EVALUATION_TEXTURE = 33437;
public const uint GL_GEOMETRY_TEXTURE = 33438;
public const uint GL_FRAGMENT_TEXTURE = 33439;
public const uint GL_COMPUTE_TEXTURE = 33440;
public const uint GL_TEXTURE_SHADOW = 33441;
public const uint GL_TEXTURE_GATHER = 33442;
public const uint GL_TEXTURE_GATHER_SHADOW = 33443;
public const uint GL_SHADER_IMAGE_LOAD = 33444;
public const uint GL_SHADER_IMAGE_STORE = 33445;
public const uint GL_SHADER_IMAGE_ATOMIC = 33446;
public const uint GL_IMAGE_TEXEL_SIZE = 33447;
public const uint GL_IMAGE_COMPATIBILITY_CLASS = 33448;
public const uint GL_IMAGE_PIXEL_FORMAT = 33449;
public const uint GL_IMAGE_PIXEL_TYPE = 33450;
public const uint GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 33452;
public const uint GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 33453;
public const uint GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 33454;
public const uint GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 33455;
public const uint GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 33457;
public const uint GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 33458;
public const uint GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 33459;
public const uint GL_CLEAR_BUFFER = 33460;
public const uint GL_TEXTURE_VIEW = 33461;
public const uint GL_VIEW_COMPATIBILITY_CLASS = 33462;
public const uint GL_FULL_SUPPORT = 33463;
public const uint GL_CAVEAT_SUPPORT = 33464;
public const uint GL_IMAGE_CLASS_4_X_32 = 33465;
public const uint GL_IMAGE_CLASS_2_X_32 = 33466;
public const uint GL_IMAGE_CLASS_1_X_32 = 33467;
public const uint GL_IMAGE_CLASS_4_X_16 = 33468;
public const uint GL_IMAGE_CLASS_2_X_16 = 33469;
public const uint GL_IMAGE_CLASS_1_X_16 = 33470;
public const uint GL_IMAGE_CLASS_4_X_8 = 33471;
public const uint GL_IMAGE_CLASS_2_X_8 = 33472;
public const uint GL_IMAGE_CLASS_1_X_8 = 33473;
public const uint GL_IMAGE_CLASS_11_11_10 = 33474;
public const uint GL_IMAGE_CLASS_10_10_10_2 = 33475;
public const uint GL_VIEW_CLASS_128_BITS = 33476;
public const uint GL_VIEW_CLASS_96_BITS = 33477;
public const uint GL_VIEW_CLASS_64_BITS = 33478;
public const uint GL_VIEW_CLASS_48_BITS = 33479;
public const uint GL_VIEW_CLASS_32_BITS = 33480;
public const uint GL_VIEW_CLASS_24_BITS = 33481;
public const uint GL_VIEW_CLASS_16_BITS = 33482;
public const uint GL_VIEW_CLASS_8_BITS = 33483;
public const uint GL_VIEW_CLASS_S3TC_DXT1_RGB = 33484;
public const uint GL_VIEW_CLASS_S3TC_DXT1_RGBA = 33485;
public const uint GL_VIEW_CLASS_S3TC_DXT3_RGBA = 33486;
public const uint GL_VIEW_CLASS_S3TC_DXT5_RGBA = 33487;
public const uint GL_VIEW_CLASS_RGTC1_RED = 33488;
public const uint GL_VIEW_CLASS_RGTC2_RG = 33489;
public const uint GL_VIEW_CLASS_BPTC_UNORM = 33490;
public const uint GL_VIEW_CLASS_BPTC_FLOAT = 33491;
public const uint GL_UNIFORM = 37601;
public const uint GL_UNIFORM_BLOCK = 37602;
public const uint GL_PROGRAM_INPUT = 37603;
public const uint GL_PROGRAM_OUTPUT = 37604;
public const uint GL_BUFFER_VARIABLE = 37605;
public const uint GL_SHADER_STORAGE_BLOCK = 37606;
public const uint GL_VERTEX_SUBROUTINE = 37608;
public const uint GL_TESS_CONTROL_SUBROUTINE = 37609;
public const uint GL_TESS_EVALUATION_SUBROUTINE = 37610;
public const uint GL_GEOMETRY_SUBROUTINE = 37611;
public const uint GL_FRAGMENT_SUBROUTINE = 37612;
public const uint GL_COMPUTE_SUBROUTINE = 37613;
public const uint GL_VERTEX_SUBROUTINE_UNIFORM = 37614;
public const uint GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 37615;
public const uint GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 37616;
public const uint GL_GEOMETRY_SUBROUTINE_UNIFORM = 37617;
public const uint GL_FRAGMENT_SUBROUTINE_UNIFORM = 37618;
public const uint GL_COMPUTE_SUBROUTINE_UNIFORM = 37619;
public const uint GL_TRANSFORM_FEEDBACK_VARYING = 37620;
public const uint GL_ACTIVE_RESOURCES = 37621;
public const uint GL_MAX_NAME_LENGTH = 37622;
public const uint GL_MAX_NUM_ACTIVE_VARIABLES = 37623;
public const uint GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 37624;
public const uint GL_NAME_LENGTH = 37625;
public const uint GL_TYPE = 37626;
public const uint GL_ARRAY_SIZE = 37627;
public const uint GL_OFFSET = 37628;
public const uint GL_BLOCK_INDEX = 37629;
public const uint GL_ARRAY_STRIDE = 37630;
public const uint GL_MATRIX_STRIDE = 37631;
public const uint GL_IS_ROW_MAJOR = 37632;
public const uint GL_ATOMIC_COUNTER_BUFFER_INDEX = 37633;
public const uint GL_BUFFER_BINDING = 37634;
public const uint GL_BUFFER_DATA_SIZE = 37635;
public const uint GL_NUM_ACTIVE_VARIABLES = 37636;
public const uint GL_ACTIVE_VARIABLES = 37637;
public const uint GL_REFERENCED_BY_VERTEX_SHADER = 37638;
public const uint GL_REFERENCED_BY_TESS_CONTROL_SHADER = 37639;
public const uint GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 37640;
public const uint GL_REFERENCED_BY_GEOMETRY_SHADER = 37641;
public const uint GL_REFERENCED_BY_FRAGMENT_SHADER = 37642;
public const uint GL_REFERENCED_BY_COMPUTE_SHADER = 37643;
public const uint GL_TOP_LEVEL_ARRAY_SIZE = 37644;
public const uint GL_TOP_LEVEL_ARRAY_STRIDE = 37645;
public const uint GL_LOCATION = 37646;
public const uint GL_LOCATION_INDEX = 37647;
public const uint GL_IS_PER_PATCH = 37607;
public const uint GL_SHADER_STORAGE_BUFFER = 37074;
public const uint GL_SHADER_STORAGE_BUFFER_BINDING = 37075;
public const uint GL_SHADER_STORAGE_BUFFER_START = 37076;
public const uint GL_SHADER_STORAGE_BUFFER_SIZE = 37077;
public const uint GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 37078;
public const uint GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 37079;
public const uint GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 37080;
public const uint GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 37081;
public const uint GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 37082;
public const uint GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 37083;
public const uint GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 37084;
public const uint GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 37085;
public const uint GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 37086;
public const uint GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 37087;
public const uint GL_SHADER_STORAGE_BARRIER_BIT = 8192;
public const uint GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 36665;
public const uint GL_DEPTH_STENCIL_TEXTURE_MODE = 37098;
public const uint GL_TEXTURE_BUFFER_OFFSET = 37277;
public const uint GL_TEXTURE_BUFFER_SIZE = 37278;
public const uint GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 37279;
public const uint GL_TEXTURE_VIEW_MIN_LEVEL = 33499;
public const uint GL_TEXTURE_VIEW_NUM_LEVELS = 33500;
public const uint GL_TEXTURE_VIEW_MIN_LAYER = 33501;
public const uint GL_TEXTURE_VIEW_NUM_LAYERS = 33502;
public const uint GL_TEXTURE_IMMUTABLE_LEVELS = 33503;
public const uint GL_VERTEX_ATTRIB_BINDING = 33492;
public const uint GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 33493;
public const uint GL_VERTEX_BINDING_DIVISOR = 33494;
public const uint GL_VERTEX_BINDING_OFFSET = 33495;
public const uint GL_VERTEX_BINDING_STRIDE = 33496;
public const uint GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 33497;
public const uint GL_MAX_VERTEX_ATTRIB_BINDINGS = 33498;
public const uint GL_VERTEX_BINDING_BUFFER = 36687;
#endregion
#region Delegates
public delegate void GLDEBUGPROC( uint source, uint type, uint id, uint severity, int length, [In] [MarshalAs( UnmanagedType.LPStr )] string message, IntPtr userParam );
public delegate void PFNGLCLEARBUFFERDATAPROC( uint target, uint internalformat, uint format, uint type, IntPtr data );
public delegate void PFNGLCLEARBUFFERSUBDATAPROC( uint target, uint internalformat, int offset, int size, uint format, uint type, IntPtr data );
public delegate void PFNGLDISPATCHCOMPUTEPROC( uint num_groups_x, uint num_groups_y, uint num_groups_z );
public delegate void PFNGLDISPATCHCOMPUTEINDIRECTPROC( int indirect );
public delegate void PFNGLCOPYIMAGESUBDATAPROC( uint srcName, uint srcTarget, int srcLevel, int srcX, int srcY, int srcZ, uint dstName, uint dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth );
public delegate void PFNGLFRAMEBUFFERPARAMETERIPROC( uint target, uint pname, int param );
public delegate void PFNGLGETFRAMEBUFFERPARAMETERIVPROC( uint target, uint pname, ref int parameters );
public delegate void PFNGLGETINTERNALFORMATI64VPROC( uint target, uint internalformat, uint pname, int bufSize, ref int parameters );
public delegate void PFNGLINVALIDATETEXSUBIMAGEPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth );
public delegate void PFNGLINVALIDATETEXIMAGEPROC( uint texture, int level );
public delegate void PFNGLINVALIDATEBUFFERSUBDATAPROC( uint buffer, int offset, int length );
public delegate void PFNGLINVALIDATEBUFFERDATAPROC( uint buffer );
public delegate void PFNGLINVALIDATEFRAMEBUFFERPROC( uint target, int numAttachments, ref uint attachments );
public delegate void PFNGLINVALIDATESUBFRAMEBUFFERPROC( uint target, int numAttachments, ref uint attachments, int x, int y, int width, int height );
public delegate void PFNGLMULTIDRAWARRAYSINDIRECTPROC( uint mode, IntPtr indirect, int drawcount, int stride );
public delegate void PFNGLMULTIDRAWELEMENTSINDIRECTPROC( uint mode, uint type, IntPtr indirect, int drawcount, int stride );
public delegate void PFNGLGETPROGRAMINTERFACEIVPROC( uint program, uint programInterface, uint pname, ref int parameters );
public delegate uint PFNGLGETPROGRAMRESOURCEINDEXPROC( uint program, uint programInterface, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLGETPROGRAMRESOURCENAMEPROC( uint program, uint programInterface, uint index, int bufSize, ref int length, IntPtr name );
public delegate void PFNGLGETPROGRAMRESOURCEIVPROC( uint program, uint programInterface, uint index, int propCount, ref uint props, int bufSize, ref int length, ref int parameters );
public delegate int PFNGLGETPROGRAMRESOURCELOCATIONPROC( uint program, uint programInterface, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate int PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC( uint program, uint programInterface, [In] [MarshalAs( UnmanagedType.LPStr )] string name );
public delegate void PFNGLSHADERSTORAGEBLOCKBINDINGPROC( uint program, uint storageBlockIndex, uint storageBlockBinding );
public delegate void PFNGLTEXBUFFERRANGEPROC( uint target, uint internalformat, uint buffer, int offset, int size );
public delegate void PFNGLTEXSTORAGE2DMULTISAMPLEPROC( uint target, int samples, uint internalformat, int width, int height, byte fixedsamplelocations );
public delegate void PFNGLTEXSTORAGE3DMULTISAMPLEPROC( uint target, int samples, uint internalformat, int width, int height, int depth, byte fixedsamplelocations );
public delegate void PFNGLTEXTUREVIEWPROC( uint texture, uint target, uint origtexture, uint internalformat, uint minlevel, uint numlevels, uint minlayer, uint numlayers );
public delegate void PFNGLBINDVERTEXBUFFERPROC( uint bindingindex, uint buffer, int offset, int stride );
public delegate void PFNGLVERTEXATTRIBFORMATPROC( uint attribindex, int size, uint type, byte normalized, uint relativeoffset );
public delegate void PFNGLVERTEXATTRIBIFORMATPROC( uint attribindex, int size, uint type, uint relativeoffset );
public delegate void PFNGLVERTEXATTRIBLFORMATPROC( uint attribindex, int size, uint type, uint relativeoffset );
public delegate void PFNGLVERTEXATTRIBBINDINGPROC( uint attribindex, uint bindingindex );
public delegate void PFNGLVERTEXBINDINGDIVISORPROC( uint bindingindex, uint divisor );
public delegate void PFNGLDEBUGMESSAGECONTROLPROC( uint source, uint type, uint severity, int count, ref uint ids, byte enabled );
public delegate void PFNGLDEBUGMESSAGEINSERTPROC( uint source, uint type, uint id, uint severity, int length, [In] [MarshalAs( UnmanagedType.LPStr )] string buf );
public delegate void PFNGLDEBUGMESSAGECALLBACKPROC( GLDEBUGPROC callback, IntPtr userParam );
public delegate uint PFNGLGETDEBUGMESSAGELOGPROC( uint count, int bufSize, ref uint sources, ref uint types, ref uint ids, ref uint severities, ref int lengths, IntPtr messageLog );
public delegate void PFNGLPUSHDEBUGGROUPPROC( uint source, uint id, int length, [In] [MarshalAs( UnmanagedType.LPStr )] string message );
public delegate void PFNGLPOPDEBUGGROUPPROC();
public delegate void PFNGLOBJECTLABELPROC( uint identifier, uint name, int length, [In] [MarshalAs( UnmanagedType.LPStr )] string label );
public delegate void PFNGLGETOBJECTLABELPROC( uint identifier, uint name, int bufSize, ref int length, IntPtr label );
public delegate void PFNGLOBJECTPTRLABELPROC( IntPtr ptr, int length, [In] [MarshalAs( UnmanagedType.LPStr )] string label );
public delegate void PFNGLGETOBJECTPTRLABELPROC( IntPtr ptr, int bufSize, ref int length, IntPtr label );
#endregion
#region Methods
public static PFNGLCLEARBUFFERDATAPROC glClearBufferData;
public static PFNGLCLEARBUFFERSUBDATAPROC glClearBufferSubData;
public static PFNGLDISPATCHCOMPUTEPROC glDispatchCompute;
public static PFNGLDISPATCHCOMPUTEINDIRECTPROC glDispatchComputeIndirect;
public static PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
public static PFNGLFRAMEBUFFERPARAMETERIPROC glFramebufferParameteri;
public static PFNGLGETFRAMEBUFFERPARAMETERIVPROC glGetFramebufferParameteriv;
public static PFNGLGETINTERNALFORMATI64VPROC glGetInternalformati64v;
public static PFNGLINVALIDATETEXSUBIMAGEPROC glInvalidateTexSubImage;
public static PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage;
public static PFNGLINVALIDATEBUFFERSUBDATAPROC glInvalidateBufferSubData;
public static PFNGLINVALIDATEBUFFERDATAPROC glInvalidateBufferData;
public static PFNGLINVALIDATEFRAMEBUFFERPROC glInvalidateFramebuffer;
public static PFNGLINVALIDATESUBFRAMEBUFFERPROC glInvalidateSubFramebuffer;
public static PFNGLMULTIDRAWARRAYSINDIRECTPROC glMultiDrawArraysIndirect;
public static PFNGLMULTIDRAWELEMENTSINDIRECTPROC glMultiDrawElementsIndirect;
public static PFNGLGETPROGRAMINTERFACEIVPROC glGetProgramInterfaceiv;
public static PFNGLGETPROGRAMRESOURCEINDEXPROC glGetProgramResourceIndex;
public static PFNGLGETPROGRAMRESOURCENAMEPROC glGetProgramResourceName;
public static PFNGLGETPROGRAMRESOURCEIVPROC glGetProgramResourceiv;
public static PFNGLGETPROGRAMRESOURCELOCATIONPROC glGetProgramResourceLocation;
public static PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glGetProgramResourceLocationIndex;
public static PFNGLSHADERSTORAGEBLOCKBINDINGPROC glShaderStorageBlockBinding;
public static PFNGLTEXBUFFERRANGEPROC glTexBufferRange;
public static PFNGLTEXSTORAGE2DMULTISAMPLEPROC glTexStorage2DMultisample;
public static PFNGLTEXSTORAGE3DMULTISAMPLEPROC glTexStorage3DMultisample;
public static PFNGLTEXTUREVIEWPROC glTextureView;
public static PFNGLBINDVERTEXBUFFERPROC glBindVertexBuffer;
public static PFNGLVERTEXATTRIBFORMATPROC glVertexAttribFormat;
public static PFNGLVERTEXATTRIBIFORMATPROC glVertexAttribIFormat;
public static PFNGLVERTEXATTRIBLFORMATPROC glVertexAttribLFormat;
public static PFNGLVERTEXATTRIBBINDINGPROC glVertexAttribBinding;
public static PFNGLVERTEXBINDINGDIVISORPROC glVertexBindingDivisor;
public static PFNGLDEBUGMESSAGECONTROLPROC glDebugMessageControl;
public static PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert;
public static PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback;
public static PFNGLGETDEBUGMESSAGELOGPROC glGetDebugMessageLog;
public static PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup;
public static PFNGLPOPDEBUGGROUPPROC glPopDebugGroup;
public static PFNGLOBJECTLABELPROC glObjectLabel;
public static PFNGLGETOBJECTLABELPROC glGetObjectLabel;
public static PFNGLOBJECTPTRLABELPROC glObjectPtrLabel;
public static PFNGLGETOBJECTPTRLABELPROC glGetObjectPtrLabel;
#endregion
#endregion
#region OpenGL 4.4
#region Constants
public const uint GL_MAX_VERTEX_ATTRIB_STRIDE = 33509;
public const uint GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 33313;
public const uint GL_TEXTURE_BUFFER_BINDING = 35882;
public const int GL_MAP_PERSISTENT_BIT = 64;
public const int GL_MAP_COHERENT_BIT = 128;
public const int GL_DYNAMIC_STORAGE_BIT = 256;
public const int GL_CLIENT_STORAGE_BIT = 512;
public const int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 16384;
public const uint GL_BUFFER_IMMUTABLE_STORAGE = 33311;
public const uint GL_BUFFER_STORAGE_FLAGS = 33312;
public const uint GL_CLEAR_TEXTURE = 37733;
public const uint GL_LOCATION_COMPONENT = 37706;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 37707;
public const uint GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 37708;
public const uint GL_QUERY_BUFFER = 37266;
public const uint GL_QUERY_BUFFER_BARRIER_BIT = 32768;
public const uint GL_QUERY_BUFFER_BINDING = 37267;
public const uint GL_QUERY_RESULT_NO_WAIT = 37268;
public const uint GL_MIRROR_CLAMP_TO_EDGE = 34627;
#endregion
#region Delegates
public delegate void PFNGLBUFFERSTORAGEPROC( uint target, int size, IntPtr data, uint flags );
public delegate void PFNGLCLEARTEXIMAGEPROC( uint texture, int level, uint format, uint type, IntPtr data );
public delegate void PFNGLCLEARTEXSUBIMAGEPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, uint type, IntPtr data );
public delegate void PFNGLBINDBUFFERSBASEPROC( uint target, uint first, int count, ref uint buffers );
public delegate void PFNGLBINDBUFFERSRANGEPROC( uint target, uint first, int count, ref uint buffers, ref int offsets, ref int sizes );
public delegate void PFNGLBINDTEXTURESPROC( uint first, int count, ref uint textures );
public delegate void PFNGLBINDSAMPLERSPROC( uint first, int count, ref uint samplers );
public delegate void PFNGLBINDIMAGETEXTURESPROC( uint first, int count, ref uint textures );
public delegate void PFNGLBINDVERTEXBUFFERSPROC( uint first, int count, ref uint buffers, ref int offsets, ref int strides );
#endregion
#region Methods
public static PFNGLBUFFERSTORAGEPROC glBufferStorage;
public static PFNGLCLEARTEXIMAGEPROC glClearTexImage;
public static PFNGLCLEARTEXSUBIMAGEPROC glClearTexSubImage;
public static PFNGLBINDBUFFERSBASEPROC glBindBuffersBase;
public static PFNGLBINDBUFFERSRANGEPROC glBindBuffersRange;
public static PFNGLBINDTEXTURESPROC glBindTextures;
public static PFNGLBINDSAMPLERSPROC glBindSamplers;
public static PFNGLBINDIMAGETEXTURESPROC glBindImageTextures;
public static PFNGLBINDVERTEXBUFFERSPROC glBindVertexBuffers;
#endregion
#endregion
#region OpenGL 4.5
#region Constants
public const uint GL_CONTEXT_LOST = 1287;
public const uint GL_NEGATIVE_ONE_TO_ONE = 37726;
public const uint GL_ZERO_TO_ONE = 37727;
public const uint GL_CLIP_ORIGIN = 37724;
public const uint GL_CLIP_DEPTH_MODE = 37725;
public const uint GL_QUERY_WAIT_INVERTED = 36375;
public const uint GL_QUERY_NO_WAIT_INVERTED = 36376;
public const uint GL_QUERY_BY_REGION_WAIT_INVERTED = 36377;
public const uint GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 36378;
public const uint GL_MAX_CULL_DISTANCES = 33529;
public const uint GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 33530;
public const uint GL_TEXTURE_TARGET = 4102;
public const uint GL_QUERY_TARGET = 33514;
public const uint GL_GUILTY_CONTEXT_RESET = 33363;
public const uint GL_INNOCENT_CONTEXT_RESET = 33364;
public const uint GL_UNKNOWN_CONTEXT_RESET = 33365;
public const uint GL_RESET_NOTIFICATION_STRATEGY = 33366;
public const uint GL_LOSE_CONTEXT_ON_RESET = 33362;
public const uint GL_NO_RESET_NOTIFICATION = 33377;
public const int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 4;
public const uint GL_CONTEXT_RELEASE_BEHAVIOR = 33531;
public const uint GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 33532;
#endregion
#region Delegates
public delegate void PFNGLCLIPCONTROLPROC( uint origin, uint depth );
public delegate void PFNGLCREATETRANSFORMFEEDBACKSPROC( int n, ref uint ids );
public delegate void PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC( uint xfb, uint index, uint buffer );
public delegate void PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC( uint xfb, uint index, uint buffer, int offset, int size );
public delegate void PFNGLGETTRANSFORMFEEDBACKIVPROC( uint xfb, uint pname, ref int param );
public delegate void PFNGLGETTRANSFORMFEEDBACKI_VPROC( uint xfb, uint pname, uint index, ref int param );
public delegate void PFNGLGETTRANSFORMFEEDBACKI64_VPROC( uint xfb, uint pname, uint index, ref int param );
public delegate void PFNGLCREATEBUFFERSPROC( int n, ref uint buffers );
public delegate void PFNGLNAMEDBUFFERSTORAGEPROC( uint buffer, int size, IntPtr data, uint flags );
public delegate void PFNGLNAMEDBUFFERDATAPROC( uint buffer, int size, IntPtr data, uint usage );
public delegate void PFNGLNAMEDBUFFERSUBDATAPROC( uint buffer, int offset, int size, IntPtr data );
public delegate void PFNGLCOPYNAMEDBUFFERSUBDATAPROC( uint readBuffer, uint writeBuffer, int readOffset, int writeOffset, int size );
public delegate void PFNGLCLEARNAMEDBUFFERDATAPROC( uint buffer, uint internalformat, uint format, uint type, IntPtr data );
public delegate void PFNGLCLEARNAMEDBUFFERSUBDATAPROC( uint buffer, uint internalformat, int offset, int size, uint format, uint type, IntPtr data );
public delegate IntPtr PFNGLMAPNAMEDBUFFERPROC( uint buffer, uint access );
public delegate IntPtr PFNGLMAPNAMEDBUFFERRANGEPROC( uint buffer, int offset, int length, uint access );
public delegate byte PFNGLUNMAPNAMEDBUFFERPROC( uint buffer );
public delegate void PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC( uint buffer, int offset, int length );
public delegate void PFNGLGETNAMEDBUFFERPARAMETERIVPROC( uint buffer, uint pname, ref int parameters );
public delegate void PFNGLGETNAMEDBUFFERPARAMETERI64VPROC( uint buffer, uint pname, ref int parameters );
public delegate void PFNGLGETNAMEDBUFFERPOINTERVPROC( uint buffer, uint pname, ref IntPtr parameters );
public delegate void PFNGLGETNAMEDBUFFERSUBDATAPROC( uint buffer, int offset, int size, IntPtr data );
public delegate void PFNGLCREATEFRAMEBUFFERSPROC( int n, ref uint framebuffers );
public delegate void PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC( uint framebuffer, uint attachment, uint renderbuffertarget, uint renderbuffer );
public delegate void PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC( uint framebuffer, uint pname, int param );
public delegate void PFNGLNAMEDFRAMEBUFFERTEXTUREPROC( uint framebuffer, uint attachment, uint texture, int level );
public delegate void PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC( uint framebuffer, uint attachment, uint texture, int level, int layer );
public delegate void PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC( uint framebuffer, uint buf );
public delegate void PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC( uint framebuffer, int n, ref uint bufs );
public delegate void PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC( uint framebuffer, uint src );
public delegate void PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC( uint framebuffer, int numAttachments, ref uint attachments );
public delegate void PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC( uint framebuffer, int numAttachments, ref uint attachments, int x, int y, int width, int height );
public delegate void PFNGLCLEARNAMEDFRAMEBUFFERIVPROC( uint framebuffer, uint buffer, int drawbuffer, ref int value );
public delegate void PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC( uint framebuffer, uint buffer, int drawbuffer, ref uint value );
public delegate void PFNGLCLEARNAMEDFRAMEBUFFERFVPROC( uint framebuffer, uint buffer, int drawbuffer, ref float value );
public delegate void PFNGLCLEARNAMEDFRAMEBUFFERFIPROC( uint framebuffer, uint buffer, int drawbuffer, float depth, int stencil );
public delegate void PFNGLBLITNAMEDFRAMEBUFFERPROC( uint readFramebuffer, uint drawFramebuffer, int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, uint mask, uint filter );
public delegate uint PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC( uint framebuffer, uint target );
public delegate void PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC( uint framebuffer, uint pname, ref int param );
public delegate void PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC( uint framebuffer, uint attachment, uint pname, ref int parameters );
public delegate void PFNGLCREATERENDERBUFFERSPROC( int n, ref uint renderbuffers );
public delegate void PFNGLNAMEDRENDERBUFFERSTORAGEPROC( uint renderbuffer, uint internalformat, int width, int height );
public delegate void PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC( uint renderbuffer, int samples, uint internalformat, int width, int height );
public delegate void PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC( uint renderbuffer, uint pname, ref int parameters );
public delegate void PFNGLCREATETEXTURESPROC( uint target, int n, ref uint textures );
public delegate void PFNGLTEXTUREBUFFERPROC( uint texture, uint internalformat, uint buffer );
public delegate void PFNGLTEXTUREBUFFERRANGEPROC( uint texture, uint internalformat, uint buffer, int offset, int size );
public delegate void PFNGLTEXTURESTORAGE1DPROC( uint texture, int levels, uint internalformat, int width );
public delegate void PFNGLTEXTURESTORAGE2DPROC( uint texture, int levels, uint internalformat, int width, int height );
public delegate void PFNGLTEXTURESTORAGE3DPROC( uint texture, int levels, uint internalformat, int width, int height, int depth );
public delegate void PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC( uint texture, int samples, uint internalformat, int width, int height, byte fixedsamplelocations );
public delegate void PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC( uint texture, int samples, uint internalformat, int width, int height, int depth, byte fixedsamplelocations );
public delegate void PFNGLTEXTURESUBIMAGE1DPROC( uint texture, int level, int xoffset, int width, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXTURESUBIMAGE2DPROC( uint texture, int level, int xoffset, int yoffset, int width, int height, uint format, uint type, IntPtr pixels );
public delegate void PFNGLTEXTURESUBIMAGE3DPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, uint type, IntPtr pixels );
public delegate void PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC( uint texture, int level, int xoffset, int width, uint format, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC( uint texture, int level, int xoffset, int yoffset, int width, int height, uint format, int imageSize, IntPtr data );
public delegate void PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, int imageSize, IntPtr data );
public delegate void PFNGLCOPYTEXTURESUBIMAGE1DPROC( uint texture, int level, int xoffset, int x, int y, int width );
public delegate void PFNGLCOPYTEXTURESUBIMAGE2DPROC( uint texture, int level, int xoffset, int yoffset, int x, int y, int width, int height );
public delegate void PFNGLCOPYTEXTURESUBIMAGE3DPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height );
public delegate void PFNGLTEXTUREPARAMETERFPROC( uint texture, uint pname, float param );
public delegate void PFNGLTEXTUREPARAMETERFVPROC( uint texture, uint pname, ref float param );
public delegate void PFNGLTEXTUREPARAMETERIPROC( uint texture, uint pname, int param );
public delegate void PFNGLTEXTUREPARAMETERIIVPROC( uint texture, uint pname, ref int parameters );
public delegate void PFNGLTEXTUREPARAMETERIUIVPROC( uint texture, uint pname, ref uint parameters );
public delegate void PFNGLTEXTUREPARAMETERIVPROC( uint texture, uint pname, ref int param );
public delegate void PFNGLGENERATETEXTUREMIPMAPPROC( uint texture );
public delegate void PFNGLBINDTEXTUREUNITPROC( uint unit, uint texture );
public delegate void PFNGLGETTEXTUREIMAGEPROC( uint texture, int level, uint format, uint type, int bufSize, IntPtr pixels );
public delegate void PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC( uint texture, int level, int bufSize, IntPtr pixels );
public delegate void PFNGLGETTEXTURELEVELPARAMETERFVPROC( uint texture, int level, uint pname, ref float parameters );
public delegate void PFNGLGETTEXTURELEVELPARAMETERIVPROC( uint texture, int level, uint pname, ref int parameters );
public delegate void PFNGLGETTEXTUREPARAMETERFVPROC( uint texture, uint pname, ref float parameters );
public delegate void PFNGLGETTEXTUREPARAMETERIIVPROC( uint texture, uint pname, ref int parameters );
public delegate void PFNGLGETTEXTUREPARAMETERIUIVPROC( uint texture, uint pname, ref uint parameters );
public delegate void PFNGLGETTEXTUREPARAMETERIVPROC( uint texture, uint pname, ref int parameters );
public delegate void PFNGLCREATEVERTEXARRAYSPROC( int n, ref uint arrays );
public delegate void PFNGLDISABLEVERTEXARRAYATTRIBPROC( uint vaobj, uint index );
public delegate void PFNGLENABLEVERTEXARRAYATTRIBPROC( uint vaobj, uint index );
public delegate void PFNGLVERTEXARRAYELEMENTBUFFERPROC( uint vaobj, uint buffer );
public delegate void PFNGLVERTEXARRAYVERTEXBUFFERPROC( uint vaobj, uint bindingindex, uint buffer, int offset, int stride );
public delegate void PFNGLVERTEXARRAYVERTEXBUFFERSPROC( uint vaobj, uint first, int count, ref uint buffers, ref int offsets, ref int strides );
public delegate void PFNGLVERTEXARRAYATTRIBBINDINGPROC( uint vaobj, uint attribindex, uint bindingindex );
public delegate void PFNGLVERTEXARRAYATTRIBFORMATPROC( uint vaobj, uint attribindex, int size, uint type, byte normalized, uint relativeoffset );
public delegate void PFNGLVERTEXARRAYATTRIBIFORMATPROC( uint vaobj, uint attribindex, int size, uint type, uint relativeoffset );
public delegate void PFNGLVERTEXARRAYATTRIBLFORMATPROC( uint vaobj, uint attribindex, int size, uint type, uint relativeoffset );
public delegate void PFNGLVERTEXARRAYBINDINGDIVISORPROC( uint vaobj, uint bindingindex, uint divisor );
public delegate void PFNGLGETVERTEXARRAYIVPROC( uint vaobj, uint pname, ref int param );
public delegate void PFNGLGETVERTEXARRAYINDEXEDIVPROC( uint vaobj, uint index, uint pname, ref int param );
public delegate void PFNGLGETVERTEXARRAYINDEXED64IVPROC( uint vaobj, uint index, uint pname, ref int param );
public delegate void PFNGLCREATESAMPLERSPROC( int n, ref uint samplers );
public delegate void PFNGLCREATEPROGRAMPIPELINESPROC( int n, ref uint pipelines );
public delegate void PFNGLCREATEQUERIESPROC( uint target, int n, ref uint ids );
public delegate void PFNGLGETQUERYBUFFEROBJECTI64VPROC( uint id, uint buffer, uint pname, int offset );
public delegate void PFNGLGETQUERYBUFFEROBJECTIVPROC( uint id, uint buffer, uint pname, int offset );
public delegate void PFNGLGETQUERYBUFFEROBJECTUI64VPROC( uint id, uint buffer, uint pname, int offset );
public delegate void PFNGLGETQUERYBUFFEROBJECTUIVPROC( uint id, uint buffer, uint pname, int offset );
public delegate void PFNGLMEMORYBARRIERBYREGIONPROC( uint barriers );
public delegate void PFNGLGETTEXTURESUBIMAGEPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, uint format, uint type, int bufSize, IntPtr pixels );
public delegate void PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC( uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, IntPtr pixels );
public delegate uint PFNGLGETGRAPHICSRESETSTATUSPROC();
public delegate void PFNGLGETNCOMPRESSEDTEXIMAGEPROC( uint target, int lod, int bufSize, IntPtr pixels );
public delegate void PFNGLGETNTEXIMAGEPROC( uint target, int level, uint format, uint type, int bufSize, IntPtr pixels );
public delegate void PFNGLGETNUNIFORMDVPROC( uint program, int location, int bufSize, ref double parameters );
public delegate void PFNGLGETNUNIFORMFVPROC( uint program, int location, int bufSize, ref float parameters );
public delegate void PFNGLGETNUNIFORMIVPROC( uint program, int location, int bufSize, ref int parameters );
public delegate void PFNGLGETNUNIFORMUIVPROC( uint program, int location, int bufSize, ref uint parameters );
public delegate void PFNGLREADNPIXELSPROC( int x, int y, int width, int height, uint format, uint type, int bufSize, IntPtr data );
public delegate void PFNGLTEXTUREBARRIERPROC();
#endregion
#region Methods
public static PFNGLCLIPCONTROLPROC glClipControl;
public static PFNGLCREATETRANSFORMFEEDBACKSPROC glCreateTransformFeedbacks;
public static PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glTransformFeedbackBufferBase;
public static PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glTransformFeedbackBufferRange;
public static PFNGLGETTRANSFORMFEEDBACKIVPROC glGetTransformFeedbackiv;
public static PFNGLGETTRANSFORMFEEDBACKI_VPROC glGetTransformFeedbacki_v;
public static PFNGLGETTRANSFORMFEEDBACKI64_VPROC glGetTransformFeedbacki64_v;
public static PFNGLCREATEBUFFERSPROC glCreateBuffers;
public static PFNGLNAMEDBUFFERSTORAGEPROC glNamedBufferStorage;
public static PFNGLNAMEDBUFFERDATAPROC glNamedBufferData;
public static PFNGLNAMEDBUFFERSUBDATAPROC glNamedBufferSubData;
public static PFNGLCOPYNAMEDBUFFERSUBDATAPROC glCopyNamedBufferSubData;
public static PFNGLCLEARNAMEDBUFFERDATAPROC glClearNamedBufferData;
public static PFNGLCLEARNAMEDBUFFERSUBDATAPROC glClearNamedBufferSubData;
public static PFNGLMAPNAMEDBUFFERPROC glMapNamedBuffer;
public static PFNGLMAPNAMEDBUFFERRANGEPROC glMapNamedBufferRange;
public static PFNGLUNMAPNAMEDBUFFERPROC glUnmapNamedBuffer;
public static PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glFlushMappedNamedBufferRange;
public static PFNGLGETNAMEDBUFFERPARAMETERIVPROC glGetNamedBufferParameteriv;
public static PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glGetNamedBufferParameteri64v;
public static PFNGLGETNAMEDBUFFERPOINTERVPROC glGetNamedBufferPointerv;
public static PFNGLGETNAMEDBUFFERSUBDATAPROC glGetNamedBufferSubData;
public static PFNGLCREATEFRAMEBUFFERSPROC glCreateFramebuffers;
public static PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glNamedFramebufferRenderbuffer;
public static PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glNamedFramebufferParameteri;
public static PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glNamedFramebufferTexture;
public static PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glNamedFramebufferTextureLayer;
public static PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glNamedFramebufferDrawBuffer;
public static PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glNamedFramebufferDrawBuffers;
public static PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glNamedFramebufferReadBuffer;
public static PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glInvalidateNamedFramebufferData;
public static PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glInvalidateNamedFramebufferSubData;
public static PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glClearNamedFramebufferiv;
public static PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glClearNamedFramebufferuiv;
public static PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glClearNamedFramebufferfv;
public static PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glClearNamedFramebufferfi;
public static PFNGLBLITNAMEDFRAMEBUFFERPROC glBlitNamedFramebuffer;
public static PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glCheckNamedFramebufferStatus;
public static PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glGetNamedFramebufferParameteriv;
public static PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetNamedFramebufferAttachmentParameteriv;
public static PFNGLCREATERENDERBUFFERSPROC glCreateRenderbuffers;
public static PFNGLNAMEDRENDERBUFFERSTORAGEPROC glNamedRenderbufferStorage;
public static PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glNamedRenderbufferStorageMultisample;
public static PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glGetNamedRenderbufferParameteriv;
public static PFNGLCREATETEXTURESPROC glCreateTextures;
public static PFNGLTEXTUREBUFFERPROC glTextureBuffer;
public static PFNGLTEXTUREBUFFERRANGEPROC glTextureBufferRange;
public static PFNGLTEXTURESTORAGE1DPROC glTextureStorage1D;
public static PFNGLTEXTURESTORAGE2DPROC glTextureStorage2D;
public static PFNGLTEXTURESTORAGE3DPROC glTextureStorage3D;
public static PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glTextureStorage2DMultisample;
public static PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glTextureStorage3DMultisample;
public static PFNGLTEXTURESUBIMAGE1DPROC glTextureSubImage1D;
public static PFNGLTEXTURESUBIMAGE2DPROC glTextureSubImage2D;
public static PFNGLTEXTURESUBIMAGE3DPROC glTextureSubImage3D;
public static PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glCompressedTextureSubImage1D;
public static PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glCompressedTextureSubImage2D;
public static PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glCompressedTextureSubImage3D;
public static PFNGLCOPYTEXTURESUBIMAGE1DPROC glCopyTextureSubImage1D;
public static PFNGLCOPYTEXTURESUBIMAGE2DPROC glCopyTextureSubImage2D;
public static PFNGLCOPYTEXTURESUBIMAGE3DPROC glCopyTextureSubImage3D;
public static PFNGLTEXTUREPARAMETERFPROC glTextureParameterf;
public static PFNGLTEXTUREPARAMETERFVPROC glTextureParameterfv;
public static PFNGLTEXTUREPARAMETERIPROC glTextureParameteri;
public static PFNGLTEXTUREPARAMETERIIVPROC glTextureParameterIiv;
public static PFNGLTEXTUREPARAMETERIUIVPROC glTextureParameterIuiv;
public static PFNGLTEXTUREPARAMETERIVPROC glTextureParameteriv;
public static PFNGLGENERATETEXTUREMIPMAPPROC glGenerateTextureMipmap;
public static PFNGLBINDTEXTUREUNITPROC glBindTextureUnit;
public static PFNGLGETTEXTUREIMAGEPROC glGetTextureImage;
public static PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glGetCompressedTextureImage;
public static PFNGLGETTEXTURELEVELPARAMETERFVPROC glGetTextureLevelParameterfv;
public static PFNGLGETTEXTURELEVELPARAMETERIVPROC glGetTextureLevelParameteriv;
public static PFNGLGETTEXTUREPARAMETERFVPROC glGetTextureParameterfv;
public static PFNGLGETTEXTUREPARAMETERIIVPROC glGetTextureParameterIiv;
public static PFNGLGETTEXTUREPARAMETERIUIVPROC glGetTextureParameterIuiv;
public static PFNGLGETTEXTUREPARAMETERIVPROC glGetTextureParameteriv;
public static PFNGLCREATEVERTEXARRAYSPROC glCreateVertexArrays;
public static PFNGLDISABLEVERTEXARRAYATTRIBPROC glDisableVertexArrayAttrib;
public static PFNGLENABLEVERTEXARRAYATTRIBPROC glEnableVertexArrayAttrib;
public static PFNGLVERTEXARRAYELEMENTBUFFERPROC glVertexArrayElementBuffer;
public static PFNGLVERTEXARRAYVERTEXBUFFERPROC glVertexArrayVertexBuffer;
public static PFNGLVERTEXARRAYVERTEXBUFFERSPROC glVertexArrayVertexBuffers;
public static PFNGLVERTEXARRAYATTRIBBINDINGPROC glVertexArrayAttribBinding;
public static PFNGLVERTEXARRAYATTRIBFORMATPROC glVertexArrayAttribFormat;
public static PFNGLVERTEXARRAYATTRIBIFORMATPROC glVertexArrayAttribIFormat;
public static PFNGLVERTEXARRAYATTRIBLFORMATPROC glVertexArrayAttribLFormat;
public static PFNGLVERTEXARRAYBINDINGDIVISORPROC glVertexArrayBindingDivisor;
public static PFNGLGETVERTEXARRAYIVPROC glGetVertexArrayiv;
public static PFNGLGETVERTEXARRAYINDEXEDIVPROC glGetVertexArrayIndexediv;
public static PFNGLGETVERTEXARRAYINDEXED64IVPROC glGetVertexArrayIndexed64iv;
public static PFNGLCREATESAMPLERSPROC glCreateSamplers;
public static PFNGLCREATEPROGRAMPIPELINESPROC glCreateProgramPipelines;
public static PFNGLCREATEQUERIESPROC glCreateQueries;
public static PFNGLGETQUERYBUFFEROBJECTI64VPROC glGetQueryBufferObjecti64v;
public static PFNGLGETQUERYBUFFEROBJECTIVPROC glGetQueryBufferObjectiv;
public static PFNGLGETQUERYBUFFEROBJECTUI64VPROC glGetQueryBufferObjectui64v;
public static PFNGLGETQUERYBUFFEROBJECTUIVPROC glGetQueryBufferObjectuiv;
public static PFNGLMEMORYBARRIERBYREGIONPROC glMemoryBarrierByRegion;
public static PFNGLGETTEXTURESUBIMAGEPROC glGetTextureSubImage;
public static PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glGetCompressedTextureSubImage;
public static PFNGLGETGRAPHICSRESETSTATUSPROC glGetGraphicsResetStatus;
public static PFNGLGETNCOMPRESSEDTEXIMAGEPROC glGetnCompressedTexImage;
public static PFNGLGETNTEXIMAGEPROC glGetnTexImage;
public static PFNGLGETNUNIFORMDVPROC glGetnUniformdv;
public static PFNGLGETNUNIFORMFVPROC glGetnUniformfv;
public static PFNGLGETNUNIFORMIVPROC glGetnUniformiv;
public static PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv;
public static PFNGLREADNPIXELSPROC glReadnPixels;
public static PFNGLTEXTUREBARRIERPROC glTextureBarrier;
#endregion
#endregion
}
}
#endregion
#region Abstraction
namespace CSGL
{
using static OpenGL;
using static Glfw3;
using static CSGL;
using static DLL;
#region Prototypes
public enum CSGLWindowStyle : int
{
Normal = 1,
Borderless = 2,
Fullscreen = 4
}
#region Delegates
public delegate void CSGLDrawEvent( CSGLWindow sender, double deltaTime );
public delegate void CSGLUpdateEvent( CSGLWindow sender, double deltaTime );
#endregion
#endregion
public static class CSGL
{
#region Extension
#region Fields
public static IntPtr NULL = (IntPtr)0;
private static Type _glType = typeof( OpenGL );
private static Type _delegateType = typeof( MulticastDelegate );
public static int CSGL_GLVERSION = 0;
#endregion
#region Methods
public static bool csglLoadGL()
{
#region Loader
FieldInfo[] fields = _glType.GetFields( BindingFlags.Public | BindingFlags.Static );
foreach ( FieldInfo fi in fields )
{
if ( fi.FieldType.BaseType == _delegateType )
{
IntPtr ptr = glfwGetProcAddress( fi.Name );
if ( ptr != IntPtr.Zero )
fi.SetValue( null, Marshal.GetDelegateForFunctionPointer( ptr, fi.FieldType ) );
}
}
#endregion
#region Detect version
CSGL_GLVERSION = 0;
if( glAccum != null )
CSGL_GLVERSION = 110;
if ( glDrawRangeElements != null )
CSGL_GLVERSION = 120;
if ( glActiveTexture != null )
CSGL_GLVERSION = 130;
if ( glBlendFuncSeparate != null )
CSGL_GLVERSION = 140;
if ( glGenQueries != null )
CSGL_GLVERSION = 150;
if ( glBlendEquationSeparate != null )
CSGL_GLVERSION = 200;
if ( glUniformMatrix2x3fv != null )
CSGL_GLVERSION = 210;
if ( glColorMaski != null )
CSGL_GLVERSION = 300;
if ( glDrawArraysInstanced != null )
CSGL_GLVERSION = 310;
if ( glDrawElementsBaseVertex != null )
CSGL_GLVERSION = 320;
if ( glBindFragDataLocationIndexed != null )
CSGL_GLVERSION = 330;
if ( glMinSampleShading != null )
CSGL_GLVERSION = 400;
if ( glReleaseShaderCompiler != null )
CSGL_GLVERSION = 410;
if ( glDrawArraysInstancedBaseInstance != null )
CSGL_GLVERSION = 420;
if ( glClearBufferData != null )
CSGL_GLVERSION = 430;
if ( glBufferStorage != null )
CSGL_GLVERSION = 440;
if ( glClipControl != null )
CSGL_GLVERSION = 450;
if( CSGL_GLVERSION == 0 )
throw new Exception( "Could not load OpenGL" );
#endregion
Console.WriteLine( "Linked 'OpenGL' -> VERSION {0}", CSGL_GLVERSION );
return true;
}
public static void csglAssert()
{
uint glError = glGetError();
if ( glError != GL_NO_ERROR )
throw new Exception( "OpenGL error (" + glError + ")" );
}
#endregion
#region Macros
#region csglBuffer
public static uint csglBuffer( float[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( float ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( float ) );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, sizeof( float ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( double[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( double ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( double ) );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, sizeof( double ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( byte[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( byte ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( ushort[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( ushort ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( ushort ) );
Marshal.Copy( (short[])(Array)data, 0, ptrData, data.Length );
glBufferData( target, sizeof( ushort ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( short[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( short ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( short ) );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, sizeof( short ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( uint[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( uint ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( uint ) );
Marshal.Copy( (int[])(Array)data, 0, ptrData, data.Length );
glBufferData( target, sizeof( uint ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( int[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( int ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( int ) );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, sizeof( int ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( ulong[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( ulong ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( ulong ) );
Marshal.Copy( (long[])(Array)data, 0, ptrData, data.Length );
glBufferData( target, sizeof( ulong ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
public static uint csglBuffer( long[] data, uint buffer = 0, uint target = GL_ARRAY_BUFFER, uint usage = GL_STATIC_DRAW )
{
uint BUFF = buffer;
if ( BUFF == 0 )
glGenBuffers( 1, ref BUFF );
glBindBuffer( target, BUFF );
#if UNSAFE
unsafe
{
fixed ( void* ptrData = data )
glBufferData( target, sizeof( long ) * data.Length, (IntPtr)ptrData, usage );
}
#else
IntPtr ptrData = Marshal.AllocHGlobal( data.Length * sizeof( long ) );
Marshal.Copy( data, 0, ptrData, data.Length );
glBufferData( target, sizeof( long ) * data.Length, ptrData, usage );
Marshal.FreeHGlobal( ptrData );
#endif
return BUFF;
}
#endregion
#region csglShader
public static uint csglShader( IntPtr shaderSource, uint type, int length = 0 )
{
#region Compile
uint shader = glCreateShader( type );
glShaderSource( shader, 1, ref shaderSource, ref length );
glCompileShader( shader );
#endregion
#region Assert
int success = 0;
glGetShaderiv( shader, GL_COMPILE_STATUS, ref success );
if ( success == 0 )
{
IntPtr log = Marshal.AllocHGlobal( 512 );
glGetShaderInfoLog( shader, 512, ref length, log );
byte[] buffer = new byte[ length ];
Marshal.Copy( log, buffer, 0, length );
Marshal.FreeHGlobal( log );
throw new Exception( Encoding.ASCII.GetString( buffer ) );
}
#endregion
return shader;
}
public static uint csglShader( byte[] shaderSource, uint type )
{
IntPtr ptrSource = Marshal.AllocHGlobal( shaderSource.Length );
Marshal.Copy( shaderSource, 0, ptrSource, shaderSource.Length );
uint shader = csglShader( ptrSource, type, shaderSource.Length );
Marshal.FreeHGlobal( ptrSource );
return shader;
}
public static uint csglShader( string shaderSource, uint type )
{
return csglShader( Encoding.ASCII.GetBytes( shaderSource ), type );
}
public static uint csglShaderFile( string filename, uint type, bool ascii = true )
{
if ( ascii )
return csglShader( File.ReadAllBytes( filename ), type );
else
return csglShader( File.ReadAllText( filename ), type );
}
public static uint csglShaderProgram( params uint[] shaders )
{
#region Link
uint shaderProgram = glCreateProgram();
foreach ( uint shader in shaders )
glAttachShader( shaderProgram, shader );
glLinkProgram( shaderProgram );
#endregion
#region Assert
int success = 0;
glGetProgramiv( shaderProgram, GL_LINK_STATUS, ref success );
if ( success == 0 )
{
int length = 0;
IntPtr log = Marshal.AllocHGlobal( 512 );
glGetProgramInfoLog( shaderProgram, 512, ref length, log );
byte[] buffer = new byte[ length ];
Marshal.Copy( log, buffer, 0, length );
Marshal.FreeHGlobal( log );
throw new Exception( System.Text.Encoding.ASCII.GetString( buffer ) );
}
#endregion
#region Clean
foreach ( uint shader in shaders )
glDeleteShader( shader );
#endregion
return shaderProgram;
}
#endregion
#region csglVertex
public static void csglVertexAttribPointer( uint index, int size, uint type, bool normalized, int stride, int offset = 0 )
{
glVertexAttribPointer( index, size, type, normalized ? GL_TRUE : GL_FALSE, stride, NULL + offset );
}
public static void csglVertexAttribPointer( uint index, int size, uint type, int stride, int offset = 0 )
{
glVertexAttribPointer( index, size, type, GL_FALSE, stride, NULL + offset );
}
#endregion
#region csglTexture
private static Stack<uint> _availTexPtrs = new Stack<uint>();
public static uint csglTexture( int width, int height, IntPtr pixels, uint externalFormat = GL_RGBA, bool generateMipmaps = true, uint texture = 0 )
{
if ( texture == 0 )
{
if ( _availTexPtrs.Count > 0 )
texture = _availTexPtrs.Pop();
else
glGenTextures( 1, ref texture );
}
glBindTexture( GL_TEXTURE_2D, texture );
if ( CSGL_GLVERSION < 300 & generateMipmaps )
{
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4 );
glTexParameteri( GL_TEXTURE_2D, 0x8191, GL_TRUE );
}
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (int)GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (int)GL_CLAMP_TO_EDGE );
if( generateMipmaps )
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (int)GL_LINEAR_MIPMAP_NEAREST );
else
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (int)GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (int)GL_NEAREST );
glTexImage2D( GL_TEXTURE_2D, 0, (int)GL_RGBA, width, height, 0, externalFormat, GL_UNSIGNED_BYTE, pixels );
if( CSGL_GLVERSION > 210 & generateMipmaps )
glGenerateMipmap( GL_TEXTURE_2D );
csglAssert();
return texture;
}
public static void csglTextureClear( uint texture )
{
_availTexPtrs.Push( texture );
}
#endregion
#region csglClone
public static byte[] csglClone( byte[] from )
{
byte[] result = new byte[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length );
return result;
}
public static ushort[] csglClone( ushort[] from )
{
ushort[] result = new ushort[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( ushort ) );
return result;
}
public static short[] csglClone( short[] from )
{
short[] result = new short[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( short ) );
return result;
}
public static uint[] csglClone( uint[] from )
{
uint[] result = new uint[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( uint ) );
return result;
}
public static int[] csglClone( int[] from )
{
int[] result = new int[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( int ) );
return result;
}
public static ulong[] csglClone( ulong[] from )
{
ulong[] result = new ulong[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( ulong ) );
return result;
}
public static long[] csglClone( long[] from )
{
long[] result = new long[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( long ) );
return result;
}
public static float[] csglClone( float[] from )
{
float[] result = new float[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( float ) );
return result;
}
public static double[] csglClone( double[] from )
{
double[] result = new double[ from.Length ];
Buffer.BlockCopy( from, 0, result, 0, from.Length * sizeof( double ) );
return result;
}
public static void csglClone( byte[] from, byte[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length );
}
public static void csglClone( ushort[] from, ushort[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( ushort ) );
}
public static void csglClone( short[] from, short[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( short ) );
}
public static void csglClone( uint[] from, uint[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( uint ) );
}
public static void csglClone( int[] from, int[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( int ) );
}
public static void csglClone( ulong[] from, ulong[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( ulong ) );
}
public static void csglClone( long[] from, long[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( long ) );
}
public static void csglClone( float[] from, float[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( float ) );
}
public static void csglClone( double[] from, double[] to )
{
Buffer.BlockCopy( from, 0, to, 0, to.Length * sizeof( double ) );
}
#endregion
#endregion
#endregion
#region Math
#region Unsafe
#if UNSAFE
public static float csglFastSqrt( float value )
{
float result = value;
unsafe
{
int tmp = *(int*)&result;
tmp -= 1 << 23;
tmp >>= 1;
tmp += 1 << 29;
result = *(float*)&tmp;
}
return result;
}
public static float csglFastInvSqrt( float value )
{
float x = value;
unsafe
{
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - ( i >> 1 );
x = *(float*)&i;
x = x * ( 1.5f - xhalf * x * x );
}
return x;
}
#endif
#endregion
#region Safe
#if !UNSAFE
public static float csglFastSqrt( float value ) { return (float)Math.Sqrt( value ); }
public static float csglFastInvSqrt( float value ) { return (float)( 1.0 / Math.Sqrt( value ) ); }
#endif
#endregion
#region Vector
#region Vector scalar
public static void csglVectorAdd( float[] vector, float value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] += value;
}
public static void csglVectorSub( float[] vector, float value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] -= value;
}
public static void csglVectorMul( float[] vector, float value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] *= value;
}
public static void csglVectorDiv( float[] vector, float value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] /= value;
}
#endregion
#region Vector vector
public static void csglVectorAdd( float[] vector, float[] value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] += value[ i ];
}
public static void csglVectorSub( float[] vector, float[] value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] -= value[ i ];
}
public static void csglVectorMul( float[] vector, float[] value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] *= value[ i ];
}
public static void csglVectorDiv( float[] vector, float[] value )
{
for ( int i = 0; i < vector.Length; i++ )
vector[ i ] /= value[ i ];
}
#endregion
#region Vector misc
public static float csglVectorLength( float[] vector )
{
float pow = 0;
for ( int i = 0; i < vector.Length; i++ )
pow += vector[ i ] * vector[ i ];
return csglFastSqrt( pow );
}
public static float csglVectorDot( float[] v1, float[] v2 )
{
float dot = 0;
int min = v1.Length < v2.Length ? v1.Length : v2.Length;
for ( int i = 0; i < min; i++ )
dot += v1[ i ] * v2[ i ];
return dot;
}
public static float[] csglVector3Cross( float[] v1, float[] v2 )
{
return new float[ 3 ]
{
v1[ 1 ] * v2[ 2 ] - v1[ 2 ] * v2[ 1 ],
v1[ 2 ] * v2[ 0 ] - v1[ 0 ] * v2[ 2 ],
v1[ 0 ] * v2[ 1 ] - v1[ 1 ] * v2[ 0 ]
};
}
#endregion
#endregion
#region Matrix
#region Identity
public static float[] csglIdentity2()
{
return new float[ 4 ]
{
1, 0,
0, 1
};
}
public static float[] csglIdentity3()
{
return new float[ 9 ]
{
1, 0, 0,
0, 1, 0,
0, 0, 1
};
}
public static float[] csglIdentity4()
{
return new float[ 16 ]
{
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
}
#endregion
#region Matrix scalar
// Vector scalar rules apply
#endregion
#region Matrix matrix
public static float[] csglMatrixMul( float[] m1, float[] m2, int stride )
{
int rows = (int)( m1.Length / (float)stride );
int cols0 = (int)( 1 / ( (float)stride / m2.Length ) );
int cols1 = (int)( 1 / ( (float)stride / m1.Length ) );
if ( rows != cols0 )
return new float[ 0 ] { };
float[] result = new float[ rows * cols0 ];
for ( int i = 0; i < rows * cols0; i++ )
result[ i ] = 0f;
for ( int i = 0; i < rows; i++ )
{
for ( int j = 0; j < cols0; j++ )
{
for ( int k = 0; k < cols1; k++ )
result[ i * stride + j ] += m1[ i * stride + k ] * m2[ k * stride + j ];
}
}
return result;
}
#endregion
#region Matrix misc
public static void csglMatrixColumn( float[] source, ref float[] destination, int stride, int column )
{
for ( int i = stride * column; i < stride * column + stride; i++ )
destination[ i ] = source[ i ];
}
public static float[] csglMatrixVector( float[] matrix, float[] vector, int stride )
{
int columns = (int)( 1 / ( vector.Length / (float) stride ) );
float[] result = new float[ stride ];
for ( int i = 0; i < columns; i++ )
{
float column = 0;
for ( int j = 0; j < stride; j++ )
column += matrix[ i * j + i ] * vector[ j ];
result[ i ] = column;
}
return result;
}
public static void csglMatrixScale( float[] matrix, float[] vector, int stride )
{
int rows = (int)( matrix.Length / (float)stride );
for ( int i = 0; i < rows; i++ )
{
for ( int j = 0; j < stride; j++ )
matrix[ i * stride + j ] *= ( i < vector.Length ? vector[ i ] : 1 );
}
}
public static void csglMatrixTranslate( float[] matrix, float[] vector, int stride )
{
int last = matrix.Length - stride;
int min = vector.Length < matrix.Length ? vector.Length : matrix.Length;
for ( int i = 0; i < min; i++ )
{
for ( int j = 0; j < stride; j++ )
matrix[ last + j ] += matrix[ i * stride + j ] * vector[ i ];
}
}
public static float[] csglMatrixOrtho( float left, float right, float bottom, float top, float zNear = 0f, float zFar = 1f )
{
return new float[ 16 ]
{
2f / ( right - left ), 0, 0, 0,
0, 2f / ( top - bottom ), 0, 0,
0, 0, -2f / ( zFar - zNear ), 0,
-( right + left )/( right - left ), -( top + bottom )/( top - bottom ), -( zFar + zNear )/( zFar - zNear ), 1
};
}
#endregion
#endregion
#endregion
}
public class CSGLShader
{
#region Fields
private uint _vertexShader;
private uint _fragmentShader;
private uint _shaderProgram;
private Dictionary<string, int> _uniformCache;
#endregion
#region Constructor
public CSGLShader() { _uniformCache = new Dictionary<string, int>(); }
#endregion
#region Destructor
~CSGLShader()
{
// glDeleteProgram( _shaderProgram );
}
#endregion
#region Methods
#region Creation
public static CSGLShader FromPointer( IntPtr vertexSource, IntPtr fragmentSource )
{
CSGLShader shader = new CSGLShader();
shader._vertexShader = csglShader( vertexSource, GL_VERTEX_SHADER );
shader._fragmentShader = csglShader( fragmentSource, GL_FRAGMENT_SHADER );
shader._shaderProgram = csglShaderProgram( shader._vertexShader, shader._fragmentShader );
shader._cacheUniforms();
return shader;
}
public static CSGLShader FromBytes( byte[] vertexSource, byte[] fragmentSource )
{
CSGLShader shader = new CSGLShader();
shader._vertexShader = csglShader( vertexSource, GL_VERTEX_SHADER );
shader._fragmentShader = csglShader( fragmentSource, GL_FRAGMENT_SHADER );
shader._shaderProgram = csglShaderProgram( shader._vertexShader, shader._fragmentShader );
shader._cacheUniforms();
return shader;
}
public static CSGLShader FromString( string vertexSource, string fragmentSource )
{
CSGLShader shader = new CSGLShader();
shader._vertexShader = csglShader( vertexSource, GL_VERTEX_SHADER );
shader._fragmentShader = csglShader( fragmentSource, GL_FRAGMENT_SHADER );
shader._shaderProgram = csglShaderProgram( shader._vertexShader, shader._fragmentShader );
shader._cacheUniforms();
return shader;
}
public static CSGLShader FromFile( string vertexFile, string fragmentFile )
{
CSGLShader shader = new CSGLShader();
shader._vertexShader = csglShaderFile( vertexFile, GL_VERTEX_SHADER );
shader._fragmentShader = csglShaderFile( fragmentFile, GL_FRAGMENT_SHADER );
shader._shaderProgram = csglShaderProgram( shader._vertexShader, shader._fragmentShader );
shader._cacheUniforms();
return shader;
}
#endregion
#region Uniforms
private const int _maxUniformNameSize = 16;
private void _cacheUniforms()
{
int count = 0;
int length = 0;
int size = 0;
uint type = 0;
IntPtr ptrName = Marshal.AllocHGlobal( _maxUniformNameSize );
glGetProgramiv( _shaderProgram, GL_ACTIVE_UNIFORMS, ref count );
for ( uint i = 0; i < count; i++ )
{
glGetActiveUniform( _shaderProgram, i, _maxUniformNameSize, ref length, ref size, ref type, ptrName );
byte[] buffer = new byte[ length ];
Marshal.Copy( ptrName, buffer, 0, length );
string name = Encoding.ASCII.GetString( buffer );
_uniformCache[ name ] = glGetUniformLocation( _shaderProgram, name );
}
Marshal.FreeHGlobal( ptrName );
}
#endregion
#region Usage
public void Use()
{
glUseProgram( _shaderProgram );
}
public int GetUniformLocation( string name )
{
return _uniformCache[ name ];
}
#region Set (string name)
#region 1D
public void SetBool( string name, bool value )
{
glUniform1i( _uniformCache[ name ], value ? GL_TRUE : GL_FALSE );
}
public void SetUInt( string name, uint value )
{
glUniform1ui( _uniformCache[ name ], value );
}
public void SetInt( string name, int value )
{
glUniform1i( _uniformCache[ name ], value );
}
public void SetFloat( string name, float value )
{
glUniform1f( _uniformCache[ name ], value );
}
public void SetDouble( string name, double value )
{
glUniform1d( _uniformCache[ name ], value );
}
#endregion
#region 2D
public void SetBVector2( string name, bool x, bool y )
{
glUniform2i( _uniformCache[ name ], x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE );
}
public void SetBVector2( string name, bool[] xy ) { SetBVector2( name, xy[ 0 ], xy[ 1 ] ); }
public void SetUVector2( string name, uint x, uint y )
{
glUniform2ui( _uniformCache[ name ], x, y );
}
public void SetUVector2( string name, bool[] xy ) { SetBVector2( name, xy[ 0 ], xy[ 1 ] ); }
public void SetIVector2( string name, int x, int y )
{
glUniform2i( _uniformCache[ name ], x, y );
}
public void SetIVector2( string name, bool[] xy ) { SetBVector2( name, xy[ 0 ], xy[ 1 ] ); }
public void SetVector2( string name, float x, float y )
{
glUniform2f( _uniformCache[ name ], x, y );
}
public void SetVector2( string name, bool[] xy ) { SetBVector2( name, xy[ 0 ], xy[ 1 ] ); }
public void SetDVector2( string name, double x, double y )
{
glUniform2d( _uniformCache[ name ], x, y );
}
public void SetDVector2( string name, bool[] xy ) { SetBVector2( name, xy[ 0 ], xy[ 1 ] ); }
#endregion
#region 3D
public void SetBVector3( string name, bool x, bool y, bool z )
{
glUniform3i( _uniformCache[ name ], x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE, z ? GL_TRUE : GL_FALSE );
}
public void SetBVector3( string name, bool[] xyz ) { SetBVector3( name, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetUVector3( string name, uint x, uint y, uint z )
{
glUniform3ui( _uniformCache[ name ], x, y, z );
}
public void SetUVector3( string name, uint[] xyz ) { SetUVector3( name, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetIVector3( string name, int x, int y, int z )
{
glUniform3i( _uniformCache[ name ], x, y, z );
}
public void SetIVector3( string name, int[] xyz ) { SetIVector3( name, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetVector3( string name, float x, float y, float z )
{
glUniform3f( _uniformCache[ name ], x, y, z );
}
public void SetVector3( string name, float[] xyz ) { SetVector3( name, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetDVector3( string name, double x, double y, double z )
{
glUniform3d( _uniformCache[ name ], x, y, z );
}
public void SetDVector3( string name, double[] xyz ) { SetDVector3( name, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
#endregion
#region 4D
public void SetBVector4( string name, bool x, bool y, bool z, bool w )
{
glUniform4i( _uniformCache[ name ], x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE, z ? GL_TRUE : GL_FALSE, w ? GL_TRUE : GL_FALSE );
}
public void SetBVector4( string name, bool[] xyzw ) { SetBVector4( name, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetUVector4( string name, uint x, uint y, uint z, uint w )
{
glUniform4ui( _uniformCache[ name ], x, y, z, w );
}
public void SetUVector4( string name, uint[] xyzw ) { SetUVector4( name, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetIVector4( string name, int x, int y, int z, int w )
{
glUniform4i( _uniformCache[ name ], x, y, z, w );
}
public void SetIVector4( string name, int[] xyzw ) { SetIVector4( name, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetVector4( string name, float x, float y, float z, float w )
{
glUniform4f( _uniformCache[ name ], x, y, z, w );
}
public void SetVector4( string name, float[] xyzw ) { SetVector4( name, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetDVector4( string name, double x, double y, double z, double w )
{
glUniform4d( _uniformCache[ name ], x, y, z, w );
}
public void SetDVector4( string name, double[] xyzw ) { SetDVector4( name, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
#endregion
#region Matrix
public void SetMatrix2( string name, int count, bool transpose, float[] value )
{
glUniformMatrix2fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix2x3( string name, int count, bool transpose, float[] value )
{
glUniformMatrix2x3fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix2x4( string name, int count, bool transpose, float[] value )
{
glUniformMatrix2x4fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3( string name, int count, bool transpose, float[] value )
{
glUniformMatrix3fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3x2( string name, int count, bool transpose, float[] value )
{
glUniformMatrix3x2fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3x4( string name, int count, bool transpose, float[] value )
{
glUniformMatrix3x4fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4( string name, int count, bool transpose, float[] value )
{
glUniformMatrix4fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4x2( string name, int count, bool transpose, float[] value )
{
glUniformMatrix4x2fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4x3( string name, int count, bool transpose, float[] value )
{
glUniformMatrix4x3fv( _uniformCache[ name ], count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
#endregion
#endregion
#region Set (int location)
#region 1D
public void SetBool( int location, bool value )
{
glUniform1i( location, value ? GL_TRUE : GL_FALSE );
}
public void SetUInt( int location, uint value )
{
glUniform1ui( location, value );
}
public void SetInt( int location, int value )
{
glUniform1i( location, value );
}
public void SetFloat( int location, float value )
{
glUniform1f( location, value );
}
public void SetDouble( int location, double value )
{
glUniform1d( location, value );
}
#endregion
#region 2D
public void SetBVector2( int location, bool x, bool y )
{
glUniform2i( location, x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE );
}
public void SetBVector2( int location, bool[] xy ) { SetBVector2( location, xy[ 0 ], xy[ 1 ] ); }
public void SetUVector2( int location, uint x, uint y )
{
glUniform2ui( location, x, y );
}
public void SetUVector2( int location, bool[] xy ) { SetBVector2( location, xy[ 0 ], xy[ 1 ] ); }
public void SetIVector2( int location, int x, int y )
{
glUniform2i( location, x, y );
}
public void SetIVector2( int location, bool[] xy ) { SetBVector2( location, xy[ 0 ], xy[ 1 ] ); }
public void SetVector2( int location, float x, float y )
{
glUniform2f( location, x, y );
}
public void SetVector2( int location, bool[] xy ) { SetBVector2( location, xy[ 0 ], xy[ 1 ] ); }
public void SetDVector2( int location, double x, double y )
{
glUniform2d( location, x, y );
}
public void SetDVector2( int location, bool[] xy ) { SetBVector2( location, xy[ 0 ], xy[ 1 ] ); }
#endregion
#region 3D
public void SetBVector3( int location, bool x, bool y, bool z )
{
glUniform3i( location, x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE, z ? GL_TRUE : GL_FALSE );
}
public void SetBVector3( int location, bool[] xyz ) { SetBVector3( location, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetUVector3( int location, uint x, uint y, uint z )
{
glUniform3ui( location, x, y, z );
}
public void SetUVector3( int location, uint[] xyz ) { SetUVector3( location, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetIVector3( int location, int x, int y, int z )
{
glUniform3i( location, x, y, z );
}
public void SetIVector3( int location, int[] xyz ) { SetIVector3( location, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetVector3( int location, float x, float y, float z )
{
glUniform3f( location, x, y, z );
}
public void SetVector3( int location, float[] xyz ) { SetVector3( location, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
public void SetDVector3( int location, double x, double y, double z )
{
glUniform3d( location, x, y, z );
}
public void SetDVector3( int location, double[] xyz ) { SetDVector3( location, xyz[ 0 ], xyz[ 1 ], xyz[ 2 ] ); }
#endregion
#region 4D
public void SetBVector4( int location, bool x, bool y, bool z, bool w )
{
glUniform4i( location, x ? GL_TRUE : GL_FALSE, y ? GL_TRUE : GL_FALSE, z ? GL_TRUE : GL_FALSE, w ? GL_TRUE : GL_FALSE );
}
public void SetBVector4( int location, bool[] xyzw ) { SetBVector4( location, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetUVector4( int location, uint x, uint y, uint z, uint w )
{
glUniform4ui( location, x, y, z, w );
}
public void SetUVector4( int location, uint[] xyzw ) { SetUVector4( location, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetIVector4( int location, int x, int y, int z, int w )
{
glUniform4i( location, x, y, z, w );
}
public void SetIVector4( int location, int[] xyzw ) { SetIVector4( location, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetVector4( int location, float x, float y, float z, float w )
{
glUniform4f( location, x, y, z, w );
}
public void SetVector4( int location, float[] xyzw ) { SetVector4( location, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
public void SetDVector4( int location, double x, double y, double z, double w )
{
glUniform4d( location, x, y, z, w );
}
public void SetDVector4( int location, double[] xyzw ) { SetDVector4( location, xyzw[ 0 ], xyzw[ 1 ], xyzw[ 2 ], xyzw[ 3 ] ); }
#endregion
#region Matrix
public void SetMatrix2( int location, int count, bool transpose, float[] value )
{
glUniformMatrix2fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix2x3( int location, int count, bool transpose, float[] value )
{
glUniformMatrix2x3fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix2x4( int location, int count, bool transpose, float[] value )
{
glUniformMatrix2x4fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3( int location, int count, bool transpose, float[] value )
{
glUniformMatrix3fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3x2( int location, int count, bool transpose, float[] value )
{
glUniformMatrix3x2fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix3x4( int location, int count, bool transpose, float[] value )
{
glUniformMatrix3x4fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4( int location, int count, bool transpose, float[] value )
{
glUniformMatrix4fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4x2( int location, int count, bool transpose, float[] value )
{
glUniformMatrix4x2fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
public void SetMatrix4x3( int location, int count, bool transpose, float[] value )
{
glUniformMatrix4x3fv( location, count, transpose ? GL_TRUE : GL_FALSE, ref value[ 0 ] );
}
#endregion
#endregion
#endregion
#endregion
}
public class CSGLSprite
{
#region Fields
private float[] _vertices;
private uint _texture;
private uint _vbo;
private uint _vao;
#region Abstracted
/* Vertex map
_vertices = new float [] {
0 1 2 3 4 5 6 7
_x, _y, 0f, 0f, 1f, 1f, 1f, 1f,
8 9 10 11 12 13 14 15
_x + _width, _y, 1f, 0f, 1f, 1f, 1f, 1f,
16 17 18 19 20 21 22 23
_x + width, _y + height, 1f, 1f, 1f, 1f, 1f, 1f,
24 25 26 27 28 29 30 31
_x, _y, 0f, 0f, 1f, 1f, 1f, 1f,
32 33 34 35 36 37 38 39
_x, _y + height, 0f, 1f, 1f, 1f, 1f, 1f,
40 41 42 43 44 45 46 47
_x + width, _y + height, 1f, 1f 1f, 1f, 1f, 1f,
};
*/
public float[] Vertices { get { return _vertices; } }
public uint Texture { get { return _texture; } }
#if UNSAFE
private float _x;
public unsafe float X
{
get { return _x; }
set
{
_x = value;
fixed ( float* ptrVerts = _vertices )
{
ptrVerts[ 0 ] = value;
ptrVerts[ 8 ] = _width + value;
ptrVerts[ 16 ] = _width + value;
ptrVerts[ 24 ] = value;
ptrVerts[ 32 ] = value;
ptrVerts[ 40 ] = _width + value;
}
}
}
private float _y;
public unsafe float Y
{
get { return _y; }
set
{
_y = value;
fixed ( float* ptrVerts = _vertices )
{
ptrVerts[ 1 ] = value;
ptrVerts[ 9 ] = value;
ptrVerts[ 17 ] = _height + value;
ptrVerts[ 25 ] = value;
ptrVerts[ 33 ] = _height + value;
ptrVerts[ 41 ] = _height + value;
}
}
}
private float _width;
public unsafe float Width
{
get { return _width; }
set
{
_width = value;
fixed ( float* ptrVerts = _vertices )
{
ptrVerts[ 8 ] = _x + value;
ptrVerts[ 16 ] = _x + value;
ptrVerts[ 40 ] = _x + value;
}
}
}
private float _height;
public unsafe float Height
{
get { return _height; }
set
{
_height = value;
fixed ( float* ptrVerts = _vertices )
{
ptrVerts[ 17 ] = _y + value;
ptrVerts[ 33 ] = _y + value;
ptrVerts[ 41 ] = _y + value;
}
}
}
#else
private float _x;
public float X
{
get { return _x; }
set
{
_x = value;
_vertices[ 0 ] = value;
_vertices[ 8 ] = _width + value;
_vertices[ 16 ] = _width + value;
_vertices[ 24 ] = value;
_vertices[ 32 ] = value;
_vertices[ 40 ] = _width + value;
}
}
private float _y;
public float Y
{
get { return _y; }
set
{
_y = value;
_vertices[ 1 ] = value;
_vertices[ 9 ] = value;
_vertices[ 17 ] = _height + value;
_vertices[ 25 ] = value;
_vertices[ 33 ] = _height + value;
_vertices[ 41 ] = _height + value;
}
}
private float _width;
public float Width
{
get { return _width; }
set
{
_width = value;
_vertices[ 8 ] = _x + value;
_vertices[ 16 ] = _x + value;
_vertices[ 40 ] = _x + value;
}
}
private float _height;
public float Height
{
get { return _height; }
set
{
_height = value;
_vertices[ 17 ] = _y + value;
_vertices[ 33 ] = _y + value;
_vertices[ 41 ] = _y + value;
}
}
#endif
public float OriginalWidth { get; private set; }
public float OriginalHeight { get; private set; }
#endregion
#endregion
#region Constructor
public CSGLSprite( float width, float height, uint texture )
{
_texture = texture;
_width = width;
_height = height;
OriginalWidth = width;
OriginalHeight = height;
_vertices = new float[ 48 ] {
0f, 0f, 0f, 0f, 1f, 1f, 1f, 1f,
width, 0f, 1f, 0f, 1f, 1f, 1f, 1f,
width, height, 1f, 1f, 1f, 1f, 1f, 1f,
0f, 0f, 0f, 0f, 1f, 1f, 1f, 1f,
0f, height, 0f, 1f, 1f, 1f, 1f, 1f,
width, height, 1f, 1f, 1f, 1f, 1f, 1f
};
_vao = 0;
glGenVertexArrays( 1, ref _vao );
glBindVertexArray( _vao );
_vbo = csglBuffer( _vertices );
csglVertexAttribPointer( 0, 2, GL_FLOAT, 8 * sizeof( float ) );
glEnableVertexAttribArray( 0 );
csglVertexAttribPointer( 1, 2, GL_FLOAT, 8 * sizeof( float ), 2 * sizeof( float ) );
glEnableVertexAttribArray( 1 );
csglVertexAttribPointer( 2, 4, GL_FLOAT, 8 * sizeof( float ), 4 * sizeof( float ) );
glEnableVertexAttribArray( 2 );
}
#endregion
#region Destructor
~CSGLSprite()
{
csglTextureClear( _texture );
}
#endregion
#region Methods
public void Upload()
{
csglBuffer( _vertices, _vbo );
}
public void Draw()
{
glBindTexture( GL_TEXTURE_2D, _texture );
glBindVertexArray( _vao );
glDrawArrays( GL_TRIANGLES, 0, 6 );
}
public void Bind()
{
glBindTexture( GL_TEXTURE_2D, _texture );
glBindVertexArray( _vao );
}
public void Raw()
{
glDrawArrays( GL_TRIANGLE_FAN, 0, 4 );
}
public void SetColor( float r, float g, float b, float a = 1f, int index = -1 )
{
#if UNSAFE
unsafe
{
int offset = 0;
if ( index < 0 )
{
fixed ( float* ptrVerts = _vertices )
{
for ( int i = 0; i < 6; i++ )
{
offset = i * 8;
ptrVerts[ offset + 4 ] = r;
ptrVerts[ offset + 5 ] = g;
ptrVerts[ offset + 6 ] = b;
ptrVerts[ offset + 7 ] = a;
}
}
}
else
{
fixed ( float* ptrVerts = _vertices )
{
offset = index * 8;
ptrVerts[ offset + 4 ] = r;
ptrVerts[ offset + 5 ] = g;
ptrVerts[ offset + 6 ] = b;
ptrVerts[ offset + 7 ] = a;
}
}
}
#else
int offset = 0;
if ( index < 0 )
{
for( int i = 0; i < 6; i++ )
{
offset = i * 8;
_vertices[ offset + 4 ] = r;
_vertices[ offset + 5 ] = g;
_vertices[ offset + 6 ] = b;
_vertices[ offset + 7 ] = a;
}
}
else
{
offset = index * 8;
_vertices[ offset + 4 ] = r;
_vertices[ offset + 5 ] = g;
_vertices[ offset + 6 ] = b;
_vertices[ offset + 7 ] = a;
}
#endif
}
#endregion
}
/// <summary>
/// Not ready for usage, yet.
/// </summary>
public static class CSGLSpriteBatch
{
private static float[] _vertices = new float[ 0 ];
private static uint[] _textures = new uint[ 0 ];
private static int[,] _index = new int[ 0, 0 ];
private const int VARRAY_LENGTH = 48;
private const int VARRAY_SIZE = VARRAY_LENGTH * sizeof( float );
private const int HARD_LIMIT = 4194304; // This would take up 768MB of RAM
private static int _length = 0;
private static uint _texture = 0;
private static uint _vbo = 0;
private static uint _vao = 0;
#region Methods
private static void _reallocVerts()
{
int newAlloc = _vertices.Length * 2;
if ( newAlloc > HARD_LIMIT )
throw new OutOfMemoryException( "Vertices buffer too large" );
float[] verts = new float[ newAlloc ];
#if UNSAFE
unsafe
{
fixed ( void* ptrSrc = _vertices )
{
fixed ( void* ptrDst = verts )
csglMemcpy( (IntPtr)ptrDst, (IntPtr)ptrSrc, (uint)_vertices.Length * sizeof( float ) );
}
}
#else
Buffer.BlockCopy( _vertices, 0, verts, 0, _vertices.Length * sizeof( float ) );
#endif
_vertices = verts;
}
private static void _reallocTexs()
{
int newAlloc = _textures.Length * 2;
uint[] texs = new uint[ newAlloc ];
#if UNSAFE
unsafe
{
fixed ( void* ptrSrc = _textures )
{
fixed ( void* ptrDst = texs )
csglMemcpy( (IntPtr)ptrDst, (IntPtr)ptrSrc, (uint)_textures.Length * sizeof( uint ) );
}
}
#else
Buffer.BlockCopy( _textures, 0, texs, 0, _textures.Length * sizeof( uint ) );
#endif
_textures = texs;
}
private static void _reallocIndex()
{
int newAlloc = _index.GetLength( 0 ) * 2;
int[,] idx = new int[ newAlloc, 2 ];
Buffer.BlockCopy( _index, 0, idx, 0, _index.Length * sizeof( int ) );
_index = idx;
}
// TODO: actually sort _vertices!
public static void Begin( int amount = 0 )
{
amount = amount > 0 ? amount : 1;
_length = 0;
_texture = 0;
if ( _vertices.Length < amount * VARRAY_LENGTH )
_vertices = new float[ amount * VARRAY_LENGTH ];
_index = new int[ amount, 2 ];
_textures = new uint[ amount ];
if ( _vbo == 0 )
glGenBuffers( 1, ref _vbo );
glBindBuffer( GL_ARRAY_BUFFER, _vbo );
if ( _vao == 0 )
{
glGenVertexArrays( 1, ref _vao );
glBindVertexArray( _vao );
csglVertexAttribPointer( 0, 2, GL_FLOAT, 8 * sizeof( float ) );
glEnableVertexAttribArray( 0 );
csglVertexAttribPointer( 1, 2, GL_FLOAT, 8 * sizeof( float ), 2 * sizeof( float ) );
glEnableVertexAttribArray( 1 );
csglVertexAttribPointer( 2, 4, GL_FLOAT, 8 * sizeof( float ), 4 * sizeof( float ) );
glEnableVertexAttribArray( 2 );
}
else
glBindVertexArray( _vao );
}
#region Draw
public static void Draw( CSGLSprite sprite )
{
if ( _vertices.Length < _length * VARRAY_LENGTH + 1 )
_reallocVerts();
if ( _textures.Length < _length + 1 )
_reallocTexs();
if ( _index.GetLength( 0 ) < _length + 1 )
_reallocIndex();
if( _texture != sprite.Texture )
{
_texture = sprite.Texture;
glBindTexture( GL_TEXTURE_2D, _texture );
}
#if UNSAFE
unsafe
{
fixed ( void* srcPtr = sprite.Vertices )
{
fixed ( void* dstPtr = _vertices )
csglMemcpy( (IntPtr)dstPtr + _length * VARRAY_SIZE, (IntPtr)srcPtr, VARRAY_SIZE );
}
}
#else
Buffer.BlockCopy( sprite.Vertices, 0, _vertices, _length * VARRAY_SIZE, VARRAY_SIZE );
#endif
_textures[ _length ] = sprite.Texture;
_length++;
}
public static void Draw( CSGLSprite sprite, float x, float y )
{
sprite.X = x;
sprite.Y = y;
Draw( sprite );
}
public static void Draw( CSGLSprite sprite, float x, float y, float w, float h )
{
sprite.X = x;
sprite.Y = y;
sprite.Width = w;
sprite.Height = h;
Draw( sprite );
}
#endregion
public static void End()
{
#if UNSAFE
unsafe
{
fixed ( void* ptrVerts = _vertices )
glBufferData( GL_ARRAY_BUFFER, VARRAY_SIZE * _length, (IntPtr)ptrVerts, GL_DYNAMIC_DRAW );
}
#else
int length = VARRAY_SIZE * _length;
IntPtr ptrData = Marshal.AllocHGlobal( length );
Marshal.Copy( _vertices, 0, ptrData, VARRAY_LENGTH * _length );
glBufferData( GL_ARRAY_BUFFER, length, ptrData, GL_DYNAMIC_DRAW );
Marshal.FreeHGlobal( ptrData );
#endif
glDrawArrays( GL_TRIANGLES, 0, _length * 6 );
}
#endregion
}
public class CSGLWindow
{
#region Fields
private IntPtr _glfwWindow;
public IntPtr Pointer { get { return _glfwWindow; } }
private double _lastDrawTime;
private double _lastUpdatetime;
#region Abstracted
private int _x;
public int X
{
get { return _x; }
set
{
_x = value;
glfwSetWindowPos( _glfwWindow, value, _y );
}
}
private int _y;
public int Y
{
get { return _y; }
set
{
_y = value;
glfwSetWindowPos( _glfwWindow, _x, value );
}
}
private int _width;
public int Width
{
get { return _width; }
set
{
_width = value;
glfwSetWindowSize( _glfwWindow, value, _height );
}
}
private int _height;
public int Height
{
get { return _height; }
set
{
_height = value;
glfwSetWindowSize( _glfwWindow, _width, value );
}
}
private string _title;
public string Title
{
get { return _title; }
set
{
_title = value;
glfwSetWindowTitle( _glfwWindow, value );
}
}
private CSGLWindowStyle _style;
public CSGLWindowStyle Style
{
get { return _style; }
set
{
// TODO: Replace as soon as GLFW 3.3 gets released
_style = value;
bool borderless = ( value & CSGLWindowStyle.Borderless ) != 0;
bool fullscreen = ( value & CSGLWindowStyle.Fullscreen ) != 0;
glfwWindowHint( GLFW_DECORATED, borderless ? GL_FALSE : GL_TRUE );
if ( fullscreen )
{
if ( borderless )
{
IntPtr _tempWindow = IntPtr.Zero;
IntPtr monitor = glfwGetPrimaryMonitor();
IntPtr mode = glfwGetVideoMode( monitor );
#if UNSAFE
unsafe
{
GLFWvidmode* ptrMode = (GLFWvidmode*)mode;
glfwWindowHint( GLFW_REFRESH_RATE, ptrMode->refreshRate );
_tempWindow = glfwCreateWindow( ptrMode->width, ptrMode->height, _title, monitor, _glfwWindow );
_width = ptrMode->width;
_height = ptrMode->height;
}
#else
GLFWvidmode vidmode = Marshal.PtrToStructure<GLFWvidmode>( mode );
glfwWindowHint( GLFW_REFRESH_RATE, vidmode.refreshRate );
_tempWindow = glfwCreateWindow( vidmode.width, vidmode.height, _title, monitor, _glfwWindow );
_width = vidmode.width;
_height = vidmode.height;
#endif
glfwDestroyWindow( _glfwWindow );
_glfwWindow = _tempWindow;
glfwMakeContextCurrent( _glfwWindow );
_setCallbacks();
glViewport( 0, 0, _width, _height );
}
else
{
IntPtr _tempWindow = glfwCreateWindow( _width, _height, _title, glfwGetPrimaryMonitor(), _glfwWindow );
glfwDestroyWindow( _glfwWindow );
_glfwWindow = _tempWindow;
glfwMakeContextCurrent( _glfwWindow );
_setCallbacks();
glViewport( 0, 0, _width, _height );
}
}
else
{
IntPtr _tempWindow = glfwCreateWindow( _width, _height, _title, IntPtr.Zero, _glfwWindow );
glfwDestroyWindow( _glfwWindow );
_glfwWindow = _tempWindow;
glfwMakeContextCurrent( _glfwWindow );
_setCallbacks();
glViewport( 0, 0, _width, _height );
}
}
}
#endregion
#region Events
public event GLFWkeyfun OnKeyboard;
public event GLFWcursorposfun OnCursorMoved;
public event GLFWcursorenterfun OnCursorEnteredLeft;
public event GLFWmousebuttonfun OnMouse;
public event GLFWscrollfun OnScroll;
public CSGLDrawEvent OnDraw;
public CSGLUpdateEvent OnUpdate;
#endregion
#endregion
#region Constructor
public CSGLWindow( int width = 640, int height = 480, string title = "CSGLWindow" )
{
glfwWindowHint( GLFW_RESIZABLE, GL_FALSE );
_glfwWindow = glfwCreateWindow( width, height, title, IntPtr.Zero, IntPtr.Zero );
glfwMakeContextCurrent( _glfwWindow );
glfwShowWindow( _glfwWindow );
if ( CSGL_GLVERSION == 0 )
csglLoadGL();
glViewport( 0, 0, width, height );
// Initialize fields
_x = 0;
_y = 0;
_width = width;
_height = height;
_title = title;
}
#endregion
#region Destructor
~CSGLWindow()
{
}
#endregion
#region Methods
public void MakeContextCurrent()
{
glfwMakeContextCurrent( _glfwWindow );
}
private void _setCallbacks()
{
glfwSetKeyCallback( _glfwWindow, OnKeyboard );
glfwSetCursorPosCallback( _glfwWindow, OnCursorMoved );
glfwSetCursorEnterCallback( _glfwWindow, OnCursorEnteredLeft );
glfwSetMouseButtonCallback( _glfwWindow, OnMouse );
glfwSetScrollCallback( _glfwWindow, OnScroll );
}
public void Run()
{
_setCallbacks();
_lastDrawTime = glfwGetTime();
_lastUpdatetime = glfwGetTime();
while ( glfwWindowShouldClose( _glfwWindow ) == 0 )
{
glClear( GL_COLOR_BUFFER_BIT );
OnUpdate?.Invoke( this, glfwGetTime() - _lastUpdatetime );
_lastUpdatetime = glfwGetTime();
OnDraw?.Invoke( this, glfwGetTime() - _lastDrawTime );
_lastDrawTime = glfwGetTime();
Thread.Sleep( 1 );
glfwSwapBuffers( _glfwWindow );
glfwPollEvents();
}
}
public void Dispose()
{
glfwDestroyWindow( _glfwWindow );
}
#endregion
}
}
#endregion | 54.12669 | 248 | 0.694673 | [
"Unlicense"
] | TheSpydog/CSGL | src/CSGL.cs | 356,318 | C# |
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Gpu.State;
using System;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Gpu.Engine
{
partial class Methods
{
// State associated with direct uniform buffer updates.
// This state is used to attempt to batch together consecutive updates.
private ulong _ubBeginCpuAddress = 0;
private ulong _ubFollowUpAddress = 0;
private ulong _ubByteCount = 0;
/// <summary>
/// Flushes any queued ubo updates.
/// </summary>
/// <param name="memoryManager">GPU memory manager where the uniform buffer is mapped</param>
public void FlushUboDirty(MemoryManager memoryManager)
{
if (_ubFollowUpAddress != 0)
{
memoryManager.Physical.BufferCache.ForceDirty(memoryManager, _ubFollowUpAddress - _ubByteCount, _ubByteCount);
_ubFollowUpAddress = 0;
}
}
/// <summary>
/// Updates the uniform buffer data with inline data.
/// </summary>
/// <param name="state">Current GPU state</param>
/// <param name="argument">New uniform buffer data word</param>
private void UniformBufferUpdate(GpuState state, int argument)
{
var uniformBuffer = state.Get<UniformBufferState>(MethodOffset.UniformBufferState);
ulong address = uniformBuffer.Address.Pack() + (uint)uniformBuffer.Offset;
if (_ubFollowUpAddress != address)
{
FlushUboDirty(state.Channel.MemoryManager);
_ubByteCount = 0;
_ubBeginCpuAddress = state.Channel.MemoryManager.Translate(address);
}
var byteData = MemoryMarshal.Cast<int, byte>(MemoryMarshal.CreateSpan(ref argument, 1));
state.Channel.MemoryManager.Physical.WriteUntracked(_ubBeginCpuAddress + _ubByteCount, byteData);
_ubFollowUpAddress = address + 4;
_ubByteCount += 4;
state.SetUniformBufferOffset(uniformBuffer.Offset + 4);
}
/// <summary>
/// Updates the uniform buffer data with inline data.
/// </summary>
/// <param name="state">Current GPU state</param>
/// <param name="data">Data to be written to the uniform buffer</param>
public void UniformBufferUpdate(GpuState state, ReadOnlySpan<int> data)
{
var uniformBuffer = state.Get<UniformBufferState>(MethodOffset.UniformBufferState);
ulong address = uniformBuffer.Address.Pack() + (uint)uniformBuffer.Offset;
ulong size = (ulong)data.Length * 4;
if (_ubFollowUpAddress != address)
{
FlushUboDirty(state.Channel.MemoryManager);
_ubByteCount = 0;
_ubBeginCpuAddress = state.Channel.MemoryManager.Translate(address);
}
var byteData = MemoryMarshal.Cast<int, byte>(data);
state.Channel.MemoryManager.Physical.WriteUntracked(_ubBeginCpuAddress + _ubByteCount, byteData);
_ubFollowUpAddress = address + size;
_ubByteCount += size;
state.SetUniformBufferOffset(uniformBuffer.Offset + data.Length * 4);
}
}
} | 37.443182 | 126 | 0.624583 | [
"MIT"
] | 6Fer6/Ryujinx | Ryujinx.Graphics.Gpu/Engine/MethodUniformBufferUpdate.cs | 3,295 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CustomerTestsExcel
{
public interface ITextLineWriter
{
void WriteLine(string text);
void StartLine(string text);
void ContinueLine(string text);
void EndLine(string text);
}
}
| 16.947368 | 39 | 0.68323 | [
"MIT"
] | DanielKirkwood/customer-tests-excel | CustomerTestsExcel/ITextLineWriter.cs | 324 | C# |
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
namespace Microsoft.VisualStudio.Utilities
{
/// <summary>
/// Represents an attribute which assigns an integer priority to a MEF component part.
/// </summary>
public sealed class PriorityAttribute : SingletonBaseMetadataAttribute
{
/// <summary>
/// Creates a new instance of this attribute, assigning it a priority value.
/// </summary>
/// <param name="priority">The priority for the MEF component part. Lower integer
/// values represent higher precedence.</param>
public PriorityAttribute(int priority)
{
this.Priority = priority;
}
/// <summary>
/// Gets the priority for the attributed MEF extension.
/// </summary>
public int Priority { get; }
}
}
| 33.034483 | 96 | 0.637787 | [
"MIT"
] | AmadeusW/vs-editor-api | src/Editor/Core/Def/BaseUtility/PriorityAttribute.cs | 960 | C# |
namespace BusinessDiary.Data.Migrations
{
using Microsoft.AspNet.Identity.EntityFramework;
using Models;
using System.Data.Entity.Migrations;
using System.Linq;
public sealed class Configuration : DbMigrationsConfiguration<BusinessDiaryDbContext>
{
public Configuration()
{
this.AutomaticMigrationsEnabled = true;
this.AutomaticMigrationDataLossAllowed = true;
}
protected override void Seed(BusinessDiaryDbContext context)
{
context.Roles.AddOrUpdate(
p => p.Name,
new IdentityRole { Name = "Admin" });
context.SaveChanges();
if (!context.Users.Where(u => u.UserName == "vivabags@abv.com").Any())
{
var admin = new User
{
UserName = "vivabags@abv.com",
Email = "vivabags@abv.com",
PasswordHash = "AJ6xY/N9kWRShbJYh8QE5fIt5Yg5IeyTFBnJ9RXAdIXUo9hiqxtVWRiYJ0XyUHVDbg==",
SecurityStamp = "59bcf0ca-0367-4397-b3c1-af413e479e0c",
LockoutEnabled = true,
};
context.Users.Add(admin);
var role = context.Roles.Where(r => r.Name == "Admin").FirstOrDefault();
var adminRole = new IdentityUserRole
{
RoleId = role.Id
};
admin.Roles.Add(adminRole);
context.SaveChanges();
}
}
}
}
| 32.125 | 106 | 0.535668 | [
"MIT"
] | mvivancheva9/BusinessDiary | BusinessDiary/BusinessDiary.Data/Migrations/Configuration.cs | 1,542 | C# |
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Text;
namespace SlimOrm
{
/// <summary>
/// Lightweight MS SQL ORM
/// </summary>
public class SqlDataOrm : ISqlDataOrm
{
#region Fields
private readonly IDbConnectionService _dbConn;
public IDbConnectionService DbConnectionService
{
get
{
return _dbConn;
}
}
#endregion
#region Ctor
public SqlDataOrm(IDbConnectionService dbConn)
{
_dbConn = dbConn;
}
#endregion
#region Private Methods
private static string CreateDeleteStatement(object obj)
{
StringBuilder sb = new StringBuilder();
TableName tableName = obj.GetType().GetCustomAttribute<TableName>();
if (tableName == null)
throw new Exception("No table name provided.");
sb.AppendFormat("Delete from {0}", tableName.Value);
//get properties
string fieldName = "";
DBName currentAttribute;
string identity = "";
foreach (PropertyInfo property in obj.GetType().GetProperties().Where(x => x.GetCustomAttributes(typeof(DBName)).Count() > 0))
{
currentAttribute = (DBName)property.GetCustomAttribute(typeof(DBName));
fieldName = (currentAttribute.Value == "") ? property.Name.ToUnderScoreCase() : currentAttribute.Value;
//identity check
if (property.GetCustomAttribute(typeof(Identity)) != null)
{
identity = fieldName;
break;
}
}
//ensure there was an identity
if (string.IsNullOrEmpty(identity))
throw new Exception("No identity column was specified.");
//append identity where clause
sb.AppendFormat(" where {0} = @{0}", identity);
return sb.ToString();
}
private static string CreateUpdateStatement(object obj)
{
StringBuilder sb = new StringBuilder();
TableName tableName = obj.GetType().GetCustomAttribute<TableName>();
if (tableName == null)
throw new Exception("No table name provided.");
sb.AppendFormat("Update {0} set", tableName.Value);
//get properties
string fieldName = "";
DBName currentAttribute;
string identity = "";
foreach (PropertyInfo property in obj.GetType().GetProperties().Where(x => x.GetCustomAttributes(typeof(DBName)).Count() > 0))
{
currentAttribute = (DBName)property.GetCustomAttribute(typeof(DBName));
fieldName = (currentAttribute.Value == "") ? property.Name.ToUnderScoreCase() : currentAttribute.Value;
//identity check
if (property.GetCustomAttribute(typeof(Identity)) != null)
{
identity = fieldName;
continue;
}
//otherwise add to statement
sb.AppendFormat(" {0} = @{0},", fieldName);
}
//ensure there was an identity
if (string.IsNullOrEmpty(identity))
throw new Exception("No identity column was specified.");
//remove trailing comma
sb.Remove(sb.Length - 1, 1);
//append identity where clause
sb.AppendFormat(" where {0} = @{0}; Select * from {1} where {0} = @{0}", identity, tableName.Value);
return sb.ToString();
}
private static string CreateInsertStatement(object obj)
{
StringBuilder sb = new StringBuilder();
TableName tableName = obj.GetType().GetCustomAttribute<TableName>();
if (tableName == null)
throw new Exception("No table name provided.");
sb.AppendFormat("Insert into {0} ( ", tableName.Value);
List<string> fields = new List<string>();
string fieldName = "";
DBName currentAttribute;
string identity = "";
foreach (PropertyInfo property in obj.GetType().GetProperties().Where(x => x.GetCustomAttributes(typeof(DBName)).Count() > 0))
{
currentAttribute = (DBName)property.GetCustomAttribute(typeof(DBName));
fieldName = (currentAttribute.Value == "") ? property.Name.ToUnderScoreCase() : currentAttribute.Value;
//identity check
if (property.GetCustomAttribute(typeof(Identity)) != null)
{
identity = fieldName;
continue;
}
//otherwise add to statement
sb.AppendFormat("{0},", fieldName);
fields.Add(fieldName);
}
//ensure there was an identity
if (string.IsNullOrEmpty(identity))
throw new Exception("No identity column was specified.");
sb.Remove(sb.Length - 1, 1);
sb.Append(") values (");
foreach (var s in fields)
sb.AppendFormat("@{0},", s);
//remove trailing comma
sb.Remove(sb.Length - 1, 1);
sb.AppendFormat("); select * from {0} where {1} = @@IDENTITY", tableName.Value, identity);
return sb.ToString();
}
private static string CreateSelectStatement(object obj)
{
StringBuilder sb = new StringBuilder();
TableName tableName = obj.GetType().GetCustomAttribute<TableName>();
if (tableName == null)
throw new Exception("No table name provided.");
sb.AppendFormat("Select * from {0}", tableName.Value);
//get properties
string fieldName = "";
DBName currentAttribute;
string identity = "";
foreach (PropertyInfo property in obj.GetType().GetProperties().Where(x => x.GetCustomAttributes(typeof(DBName)).Count() > 0))
{
currentAttribute = (DBName)property.GetCustomAttribute(typeof(DBName));
fieldName = (currentAttribute.Value == "") ? property.Name.ToUnderScoreCase() : currentAttribute.Value;
//identity check
if (property.GetCustomAttribute(typeof(Identity)) != null)
{
identity = fieldName;
break;
}
}
//ensure there was an identity
if (string.IsNullOrEmpty(identity))
throw new Exception("No identity column was specified.");
//append identity where clause
sb.AppendFormat(" where {0} = @{0}", identity);
return sb.ToString();
}
#endregion
#region Public Methods
public T Create<T>(T obj) where T : class
{
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand insertStatment = new SqlCommand(CreateInsertStatement(obj), conn);
SqlDataAssigner.SetParametersFromDbNameProperties(obj, insertStatment);
conn.Open();
SqlDataReader reader = insertStatment.ExecuteReader();
T retVal = null;
while(reader.Read())
retVal = Activator.CreateInstance(typeof(T), args: reader) as T;
return retVal;
}
}
public int Purge<T>(T obj) where T : class
{
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand deleteCommand = new SqlCommand(CreateDeleteStatement(obj), conn);
SqlDataAssigner.SetParametersFromDbNameProperties(obj, deleteCommand);
conn.Open();
return deleteCommand.ExecuteNonQuery();
}
}
public T Retrive<T>(T obj) where T : class
{
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand selectCommand = new SqlCommand(CreateSelectStatement(obj), conn);
SqlDataAssigner.SetParametersFromDbNameProperties(obj, selectCommand);
conn.Open();
SqlDataReader reader = selectCommand.ExecuteReader();
T retVal = null;
while (reader.Read())
retVal = Activator.CreateInstance(typeof(T), args: reader) as T;
return retVal;
}
}
public T Update<T>(T obj) where T : class
{
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand updateCommand = new SqlCommand(CreateUpdateStatement(obj), conn);
SqlDataAssigner.SetParametersFromDbNameProperties(obj, updateCommand);
conn.Open();
SqlDataReader reader = updateCommand.ExecuteReader();
T retVal = null;
while (reader.Read())
retVal = Activator.CreateInstance(typeof(T), args: reader) as T;
return retVal;
}
}
public List<T> GetWithQuery<T>(string query, object paramObject) where T : class
{
List<T> retVal = null;
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand selectCommand = new SqlCommand(query, conn);
if(paramObject!=null)
SqlDataAssigner.SetParametersFromObject(paramObject, selectCommand);
conn.Open();
SqlDataReader reader = selectCommand.ExecuteReader();
if (reader.HasRows)
retVal = new List<T>();
while (reader.Read())
retVal.Add(Activator.CreateInstance(typeof(T), args: reader) as T);
return retVal;
}
}
public int ExecuteQuery(string query, object paramObject)
{
using (SqlConnection conn = (SqlConnection)_dbConn.CreateConnection())
{
SqlCommand command = new SqlCommand(query, conn);
if (paramObject != null)
SqlDataAssigner.SetParametersFromObject(paramObject, command);
conn.Open();
return command.ExecuteNonQuery();
}
}
#endregion
}
}
| 36.926421 | 139 | 0.530749 | [
"MIT"
] | iamamonte/slimorm | SlimOrm/DB/SqlDataOrm.cs | 11,043 | C# |
using System;
namespace Core.Maybe;
/// <summary>
/// Applying side effects into the Maybe call chain
/// </summary>
public static class MaybeSideEffects
{
/// <summary>
/// Calls <paramref name="fn"/> if <paramref name="m"/> has value, otherwise does nothing
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="m"></param>
/// <param name="fn"></param>
/// <returns></returns>
public static Maybe<T> Do<T>(this Maybe<T> m, Action<T> fn) where T : notnull
{
if (m.IsSomething())
{
fn(m.Value());
}
return m;
}
/// <summary>
/// Calls <paramref name="fn"/> if <paramref name="m"/> has value, otherwise calls <paramref name="else"/>
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="m"></param>
/// <param name="fn"></param>
/// <param name="else"></param>
/// <returns></returns>
public static Maybe<T> Match<T>(this Maybe<T> m, Action<T> fn, Action @else) where T : notnull
{
if (m.IsSomething())
{
fn(m.Value());
}
else
{
@else();
}
return m;
}
} | 22.895833 | 108 | 0.563239 | [
"Apache-2.0"
] | grzesiek-galezowski/core-maybe | Core.Maybe/Maybe/MaybeSideEffects.cs | 1,101 | C# |
using UnityEngine;
using System.Collections;
public class HandAnimationManager : MonoBehaviour
{
public Animator anim;
private Vector2 startPos;
private Vector2 direction;
private bool directionChosen;
private bool animationPlayed = false;
void Start()
{
}
void Update()
{
anim = gameObject.GetComponent<Animator>();
// Track a single touch as a direction control.
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
// Handle finger movements based on touch phase.
switch (touch.phase)
{
// Record initial touch position.
case TouchPhase.Began:
startPos = touch.position;
directionChosen = false;
break;
// Determine direction by comparing the current touch position with the initial one.
case TouchPhase.Moved:
direction = touch.position - startPos;
break;
// Report that a direction has been chosen when the finger is lifted.
case TouchPhase.Ended:
directionChosen = true;
break;
}
}
if (directionChosen && !animationPlayed || Input.GetKeyDown(KeyCode.Alpha1) && !animationPlayed)
{
animationPlayed = true;
anim.Play("Separate Hands");
}
}
}
| 21.666667 | 98 | 0.694872 | [
"MIT"
] | michaeldll/horslesmurs | Assets/Scripts/HandAnimationManager.cs | 1,170 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the dax-2017-04-19.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.DAX.Model
{
/// <summary>
/// Container for the parameters to the DescribeClusters operation.
/// Returns information about all provisioned DAX clusters if no cluster identifier is
/// specified, or about a specific DAX cluster if a cluster identifier is supplied.
///
///
/// <para>
/// If the cluster is in the CREATING state, only cluster level information will be displayed
/// until all of the nodes are successfully provisioned.
/// </para>
///
/// <para>
/// If the cluster is in the DELETING state, only cluster level information will be displayed.
/// </para>
///
/// <para>
/// If nodes are currently being added to the DAX cluster, node endpoint information and
/// creation time for the additional nodes will not be displayed until they are completely
/// provisioned. When the DAX cluster state is <i>available</i>, the cluster is ready
/// for use.
/// </para>
///
/// <para>
/// If nodes are currently being removed from the DAX cluster, no endpoint information
/// for the removed nodes is displayed.
/// </para>
/// </summary>
public partial class DescribeClustersRequest : AmazonDAXRequest
{
private List<string> _clusterNames = new List<string>();
private int? _maxResults;
private string _nextToken;
/// <summary>
/// Gets and sets the property ClusterNames.
/// <para>
/// The names of the DAX clusters being described.
/// </para>
/// </summary>
public List<string> ClusterNames
{
get { return this._clusterNames; }
set { this._clusterNames = value; }
}
// Check to see if ClusterNames property is set
internal bool IsSetClusterNames()
{
return this._clusterNames != null && this._clusterNames.Count > 0;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to include in the response. If more results exist than
/// the specified <code>MaxResults</code> value, a token is included in the response so
/// that the remaining results can be retrieved.
/// </para>
///
/// <para>
/// The value for <code>MaxResults</code> must be between 20 and 100.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// An optional token returned from a prior request. Use this token for pagination of
/// results from this action. If this parameter is specified, the response includes only
/// results beyond the token, up to the value specified by <code>MaxResults</code>.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 35.496063 | 102 | 0.600488 | [
"Apache-2.0"
] | philasmar/aws-sdk-net | sdk/src/Services/DAX/Generated/Model/DescribeClustersRequest.cs | 4,508 | C# |
using System.Threading.Tasks;
namespace Dionach.ShareAudit.Modules.Services
{
public interface IScopeValidationService
{
Task<(bool isValid, string errorMessage)> ValidateScopeAsync(string scope);
}
}
| 22.3 | 83 | 0.744395 | [
"MIT"
] | Dionach/ShareAudit | src/Dionach.ShareAudit.Modules.Services/IScopeValidationService.cs | 225 | C# |
using System;
using System.Text;
using EasyNetQ;
using EasyNetQ.Topology;
using Microsoft.Extensions.DependencyInjection;
using Sikiro.Tookits.Extension;
using Sikiro.Tookits.Helper;
namespace Sikiro.Bus.Extension
{
/// <summary>
/// 消息总线扩展
/// </summary>
public static class BusExtension
{
/// <summary>
/// 订阅
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="bus"></param>
/// <param name="serviceProvider"></param>
public static void Subscribe<T>(this IBus bus, ServiceProvider serviceProvider) where T : class, new()
{
var busConsumer = serviceProvider.GetService<IBusConsumer<T>>();
bus.PubSub.Subscribe<T>(string.Empty, async msg =>
{
LoggerHelper.WriteToFile("业务开始:" + msg.ToJson(), null);
try
{
await busConsumer.Excute(msg);
}
catch (Exception e)
{
e.WriteToFile("业务执行异常");
Console.WriteLine(e);
}
});
}
/// <summary>
/// 订阅
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="bus"></param>
/// <param name="queueName"></param>
/// <param name="exchange"></param>
/// <param name="topic"></param>
/// <param name="action"></param>
public static void Subscribe<T>(this IBus bus, string queueName, string exchange, string topic, Action<T> action) where T : EasyNetQEntity, new()
{
var qu = bus.Advanced.QueueDeclare(queueName);
var ex = bus.Advanced.ExchangeDeclare(exchange, ExchangeType.Topic);
bus.Advanced.Bind(ex, qu, topic);
bus.Advanced.Consume(qu, (body, properties, info) =>
{
try
{
var msg = Encoding.UTF8.GetString(body).FromJson<T>();
action(msg);
}
catch (Exception e)
{
e.WriteToFile("业务执行异常");
Console.WriteLine(e);
}
});
}
/// <summary>
/// 订阅
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="bus"></param>
/// <param name="action"></param>
public static void Subscribe<T>(this IBus bus, Action<T> action) where T : EasyNetQEntity, new()
{
var queueAttribute = AttributeHelper<QueueAttribute>.GetAttribute(typeof(T));
if (queueAttribute == null)
throw new ArgumentNullException(nameof(QueueAttribute));
var qu = bus.Advanced.QueueDeclare(queueAttribute.QueueName);
var ex = bus.Advanced.ExchangeDeclare(queueAttribute.ExchangeName, ExchangeType.Topic);
bus.Advanced.Bind(ex, qu, "");
bus.Advanced.Consume(qu, (body, properties, info) =>
{
try
{
var msg = Encoding.UTF8.GetString(body).FromJson<T>();
action(msg);
}
catch (Exception e)
{
e.WriteToFile("业务执行异常");
Console.WriteLine(e);
}
});
}
}
}
| 33.683168 | 153 | 0.494121 | [
"MIT"
] | SkyChenSky/Sikiro | src/Sikiro.Bus.Extension/BusExtension.cs | 3,474 | C# |
using BBC.Core.Domain.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace BBC.Core.Domain
{
public class Media : EntityBase<int>
{
public string MediaUrl { get; set; }
[ForeignKey("ContentId")] //ContentId nin foreignKey olduğunu belirttik.
public int ContentId { get; set; }
public Content Content { get; set; }
}
} | 23.842105 | 81 | 0.688742 | [
"Apache-2.0"
] | AhmetYkayhan/BBC | Server/BBC_API/src/BBC.Core/Domain/Media.cs | 456 | C# |
using System;
using System.Collections.Generic;
namespace KeyPayV2.Uk.Enums
{
public enum LumpSumCalculationMethod
{
NotApplicable,
A,
B2
}
}
| 14.692308 | 41 | 0.596859 | [
"MIT"
] | KeyPay/keypay-dotnet-v2 | src/keypay-dotnet/Uk/Enums/LumpSumCalculationMethod.cs | 191 | C# |
//#define DEBUG_MOVEMENTS
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Net.Mime;
using W3C.Soap;
using Microsoft.Ccr.Core;
using Microsoft.Dss.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Dss.Services.Serializer;
using Microsoft.Dss.ServiceModel.DsspServiceBase;
using Microsoft.Dss.Core.DsspHttp;
using Microsoft.Dss.Core.DsspHttpUtilities;
using bumper = Microsoft.Robotics.Services.ContactSensor.Proxy;
//using bumper = TrackRoamer.Robotics.Services.TrackRoamerServices.Bumper.Proxy;
using drive = Microsoft.Robotics.Services.Drive.Proxy;
using sicklrf = Microsoft.Robotics.Services.Sensors.SickLRF.Proxy;
using kinect = Microsoft.Kinect;
using animhead = TrackRoamer.Robotics.Services.AnimatedHeadService.Proxy;
using dssp = Microsoft.Dss.ServiceModel.Dssp;
using TrackRoamer.Robotics.Utility.LibSystem;
using TrackRoamer.Robotics.LibMapping;
using TrackRoamer.Robotics.LibBehavior;
using System.Text.RegularExpressions;
using System.Diagnostics;
namespace TrackRoamer.Robotics.Services.TrackRoamerBehaviors
{
partial class TrackRoamerBehaviorsService : DsspServiceBase
{
#region StrategyPersonFollowing()
/// <summary>
/// how far we want to be from the target
/// </summary>
private const double TargetDistanceToGoalMeters = 1.8d; // must be less than FreeDistanceMm
private const double smallMovementsAngleTreshold = 5.0d;
private int skelsCountPrev = 0;
private SkeletonPose skeletonPoseLast = SkeletonPose.None;
private DateTime lastLostTargets = DateTime.Now;
private DateTime lastHadSkeletons = DateTime.Now;
private DateTime lastHadRedShirt = DateTime.Now;
private DateTime lastAmazing = DateTime.Now;
private DateTime lastGunsFiredOnRed = DateTime.Now;
private DateTime lastTurnedKinectPlatform = DateTime.Now;
private DateTime lastThanksForStoppingBy = DateTime.Now;
private DateTime lastSayState = DateTime.Now;
private bool hadATarget = false;
private double targetPan = 0.0d; // relative to robot
private double targetTilt = 0.0d;
private int lastWaitingForHumansAnnounced = 0;
private int lastTargetPanSwitch = 0;
private bool haveATargetNow = false;
private int haveATargetNowState = 0;
private double[] panKinectSearchAngles = new double[] { 0.0d, -35.0d, -70.0d, -35.0d, 0.0d, 35.0d, 70.0d, 35.0d };
private int panKinectSearchIndex = 0;
private int secondsSinceLostTargetLast = -1;
private SkeletonPose shootingPose = SkeletonPose.HandsUp;
private bool shotAtHuman = false;
private DateTime lastShotAtHuman = DateTime.MinValue;
private object shootingPoseLock = new object();
private TalkerToHuman talkerToHuman;
#region Skeleton pose helpers
/// <summary>
/// converts SkeletonPose enum into spoken words
/// </summary>
/// <param name="pose"></param>
/// <returns></returns>
private string SkeletonPoseToSpokenString(SkeletonPose pose)
{
// split CamelCase into words:
string sPose = pose.ToString();
Regex upperCaseRegex = new Regex(@"[A-Z]{1}[a-z]*");
MatchCollection matches = upperCaseRegex.Matches(sPose);
List<string> words = new List<string>();
foreach (Match match in matches)
{
words.Add(match.Value);
}
return string.Join(" ", words.ToArray());
}
/// <summary>
/// when changed, announce pose and react to it. Left and right are mirror in robot view.
/// </summary>
/// <param name="skeletonPose"></param>
private void ReactOnSkeletonPose(SkeletonPose skeletonPose)
{
if (skeletonPose != skeletonPoseLast)
{
skeletonPoseLast = skeletonPose;
switch (skeletonPose)
{
case SkeletonPose.NotDetected: // we don't come here with "NotDetected"
case SkeletonPose.None:
case SkeletonPose.BothArmsForward: // special case - growling at human
break;
default:
talkerToHuman.Say(9, "Your " + SkeletonPoseToSpokenString(skeletonPose));
break;
}
switch (skeletonPose)
{
case SkeletonPose.NotDetected: // we don't come here with "NotDetected"
default:
StartHeadAnimationCombo(HeadComboAnimations.Restpose);
AddHeadAnimationCombo(HeadComboAnimations.BlinkCycle);
HeadlightsOff();
break;
case SkeletonPose.ArmsCrossed:
case SkeletonPose.LeftHandPointingRight:
case SkeletonPose.LeftHandUp:
case SkeletonPose.RightHandPointingLeft:
case SkeletonPose.RightHandUp:
StartHeadAnimationCombo(HeadComboAnimations.Blink1, true, 0.5d);
break;
case SkeletonPose.None:
//talkerToHuman.Say(9, "At ease");
HeadlightsOff();
StartHeadAnimationCombo(HeadComboAnimations.Restpose);
AddHeadAnimationCombo(HeadComboAnimations.Acknowledge);
break;
case SkeletonPose.HandsUp:
//talkerToHuman.Say(9, "Hands Up");
StartHeadAnimationCombo(HeadComboAnimations.Angry);
break;
case SkeletonPose.BothArmsForward:
//talkerToHuman.Say(9, "Pointing At Me");
talkerToHuman.GrowlAtHuman();
break;
case SkeletonPose.LeftArmForward:
StartHeadAnimationCombo(HeadComboAnimations.Alert_lookright);
break;
case SkeletonPose.RightArmForward:
StartHeadAnimationCombo(HeadComboAnimations.Alert_lookleft);
break;
// react to headlights commanding pose gestures:
case SkeletonPose.BothArmsOut:
{
HeadlightsOn();
FollowDirectionTargetDistanceToGoalMeters += 0.3d; // hands to the sides also means back up a bit
StartHeadAnimationCombo(HeadComboAnimations.Angry);
}
break;
case SkeletonPose.LeftArmOut:
{
HeadlightsOnOff(false, true); // right light on
StartHeadAnimationCombo(HeadComboAnimations.Acknowledge);
AddHeadAnimationCombo(HeadComboAnimations.Turn_right);
}
break;
case SkeletonPose.RightArmOut:
{
HeadlightsOnOff(true, false); // left light on
StartHeadAnimationCombo(HeadComboAnimations.Acknowledge);
AddHeadAnimationCombo(HeadComboAnimations.Turn_left);
}
break;
}
}
}
#endregion // Skeleton pose helpers
private void StrategyPersonFollowingInit()
{
_soundsHelper.SetSoundSkin(SoundSkinType.Bullfight);
_mapperVicinity.robotDirection.bearing = null;
talkerToHuman = new TalkerToHuman(_soundsHelper, this);
StartHeadAnimationCombo(HeadComboAnimations.Restpose);
AddHeadAnimationCombo(HeadComboAnimations.BlinkCycle, true, 0.4d);
HeadlightsOff();
}
private void StrategyPersonFollowing()
{
haveATargetNow = false;
bool haveSkeleton = false;
bool lostSkeletons = false;
DateTime Now = DateTime.Now;
//kinect.JointType targetJointType = kinect.JointType.HandLeft;
kinect.JointType targetJointType = kinect.JointType.Spine;
setCurrentGoalDistance(null); // measured value, best case is distance to skeleton, can be null if we completely lost target, or assumed to be 5 meters for red shirt.
FollowDirectionTargetDistanceToGoalMeters = TargetDistanceToGoalMeters; // desired value. We want to stop at this distance to human and keep him in front of the robot.
SetLightsTrackingSkeleton(false);
SetLightsTrackingRedShirt(false);
if (!_mapperVicinity.robotState.ignoreKinectSkeletons)
{
var tmpAllSkeletons = frameProcessor.AllSkeletons; // get a snapshot of the pointer to allocated array, and then take sweet time processing it knowing it will not change
var skels = from s in tmpAllSkeletons
where s.IsSkeletonActive && s.JointPoints[targetJointType].TrackingState == kinect.JointTrackingState.Tracked
orderby s.JointPoints[targetJointType].Z
select s;
int skelsCount = skels.Count();
if (skelsCount != skelsCountPrev)
{
int deltaSkelsCount = skelsCount - skelsCountPrev;
skelsCountPrev = skelsCount;
//if (deltaSkelsCount < 0)
//{
// if ((Now - lastAmazing).TotalSeconds > 10.0d)
// {
// lastAmazing = Now;
// _soundsHelper.PlaySound("you were amazing", 0.5d);
// }
//}
//else
//{
// _soundsHelper.PlaySound("skeletons number changed", 0.2d);
//}
//talkerToHuman.ensureAnnouncementDelay();
if (skelsCount > 0)
{
frameProcessor.doSaveOneImage = _mapperVicinity.robotState.doPhotos; // snap a picture
//_mainWindow.PlayRandomSound();
//talkerToHuman.Say(9, "" + skelsCount + " tasty human" + (skelsCount > 1 ? "s" : ""));
HeadlightsOff();
}
else
{
lostSkeletons = true;
}
}
if (skelsCount > 0)
{
haveSkeleton = true;
#region Have a skeleton, follow it
lastHadSkeletons = Now;
// found the first skeleton; track it:
VisualizableSkeletonInformation vsi = skels.FirstOrDefault();
if (vsi == null)
{
// this really, really should not happen, especially now when we allocate frameProcessor.AllSkeletons for every frame.
Tracer.Error("StrategyPersonFollowing() vsi == null");
return;
}
VisualizableJoint targetJoint = vsi.JointPoints[targetJointType];
//bool isSkeletonActive = vsi.IsSkeletonActive; always true
SkeletonPose skeletonPose = vsi.SkeletonPose;
// when changed, announce pose and react to it:
ReactOnSkeletonPose(skeletonPose);
// Warning: VisualizableJoint::ComputePanTilt() can set Pan or Tilt to NaN
if (targetJoint != null && !double.IsNaN(targetJoint.Pan) && !double.IsNaN(targetJoint.Tilt))
{
haveATargetNow = true;
SetLightsTrackingSkeleton(true);
double targetPanRelativeToRobot = _state.currentPanKinect + targetJoint.Pan;
double targetPanRelativeToHead = targetJoint.Pan;
//Tracer.Trace("================== currentPanKinect=" + _state.currentPanKinect + " targetJoint.Pan=" + targetJoint.Pan + " targetPanRelativeToRobot=" + targetPanRelativeToRobot);
// guns rotate (pan) with Kinect, but tilt independently of Kinect. They are calibrated when Kinect tilt = 0
targetPan = targetPanRelativeToHead;
targetTilt = targetJoint.Tilt + _state.currentTiltKinect;
double kinectTurnEstimate = targetPanRelativeToRobot - _state.currentPanKinect;
bool shouldTurnKinect = Math.Abs(kinectTurnEstimate) > smallMovementsAngleTreshold; // don't follow small movements
SetDesiredKinectPlatformPan(shouldTurnKinect ? (double?)targetPanRelativeToRobot : null); // will be processed in computeAndExecuteKinectPlatformTurn() when head turn measurement comes.
setPanTilt(targetPan, targetTilt);
double distanceToHumanMeters = targetJoint.Z; // actual distance from Kinect to human
bool tooCloseToHuman = distanceToHumanMeters < TargetDistanceToGoalMeters - 0.1d; // cannot shoot, likely backing up
bool veryCloseToHuman = distanceToHumanMeters < TargetDistanceToGoalMeters + 0.1d; // can talk to human, likely in the dead zone and not moving
#region Greet the Human
if (veryCloseToHuman && talkerToHuman.canTalk())
{
frameProcessor.doSaveOneImage = _mapperVicinity.robotState.doPhotos; // snap a picture
talkerToHuman.TalkToHuman();
}
#endregion // Greet the Human
#region Shoot the Human
if (skeletonPose == shootingPose)
{
if (!tooCloseToHuman)
{
//lock (shootingPoseLock)
//{
if (!shotAtHuman && (Now - lastShotAtHuman).TotalSeconds > 2.0d)
{
lastShotAtHuman = Now;
shotAtHuman = true;
talkerToHuman.Say(9, "good boy");
SpawnIterator(ShootGunOnce);
}
//}
}
}
else
{
shotAtHuman = false;
}
#endregion // Shoot the Human
ComputeMovingVelocity(distanceToHumanMeters, targetPanRelativeToRobot, 0.25d, 10.0d);
}
// else
// {
// // we have skeleton(s) but the target joint is not visible. What to do here?
// }
#endregion // Have a skeleton, follow it
}
else if ((Now - lastHadSkeletons).TotalSeconds < 1.0d)
{
return; // may be just temporary loss of skeletons, wait a little before switching to red shirt
}
} // end ignoreKinectSkeletons
if (!_mapperVicinity.robotState.ignoreRedShirt && !haveSkeleton && frameProcessor.videoSurveillanceDecider != null)
{
#region Have a red shirt, follow it
VideoSurveillanceTarget target = frameProcessor.videoSurveillanceDecider.mainColorTarget;
if (target != null && (Now - target.TimeStamp).TotalSeconds < 0.5d) // must also be recent
{
lastHadRedShirt = Now;
haveATargetNow = true;
SetLightsTrackingRedShirt(true);
double targetPanRelativeToRobot = target.Pan; // already adjusted for currentPanKinect
//Tracer.Trace("+++++++++++++++ currentPanKinect=" + _state.currentPanKinect + " target.Pan=" + target.Pan + " targetPanRelativeToRobot=" + targetPanRelativeToRobot);
//Tracer.Trace(" target.Pan=" + target.Pan + " Tilt=" + target.Tilt);
// guns rotate (pan) with Kinect, but tilt independently of Kinect. They are calibrated when Kinect tilt = 0
targetPan = targetPanRelativeToRobot - _state.currentPanKinect;
targetTilt = target.Tilt; // currentTiltKinect already accounted for by VideoSurveillance
//Tracer.Trace("+++++++++++++++ currentTiltKinect=" + _state.currentTiltKinect + " target.Tilt=" + target.Tilt + " targetTilt=" + targetTilt);
//if((DateTime.Now - lastTurnedKinectPlatform).TotalSeconds > 1.0d)
{
lastTurnedKinectPlatform = DateTime.Now;
double kinectTurnEstimate = targetPan; // targetPanRelativeToRobot - _state.currentPanKinect;
bool shouldTurnKinect = Math.Abs(kinectTurnEstimate) > smallMovementsAngleTreshold; // don't follow small movements
SetDesiredKinectPlatformPan(shouldTurnKinect ? (double?)targetPanRelativeToRobot : null); // will be processed in computeAndExecuteKinectPlatformTurn() when head turn measurement comes.
}
//Tracer.Trace(string.Format(" targetPan={0:0.00} Tilt={1:0.00} PanKinect={2:0.00}", targetPan, targetTilt, _state.currentPanKinect));
setPanTilt(targetPan, targetTilt);
double bestKinectTilt = targetTilt; // will be limited to +-27 degrees
SetDesiredKinectTilt(bestKinectTilt);
// choose robotTacticsType - current tactics is move towards human:
var mostRecentParkingSensor = _state.MostRecentParkingSensor;
double redShirtDistanceMetersEstimated = mostRecentParkingSensor == null ? TargetDistanceToGoalMeters : Math.Min(mostRecentParkingSensor.parkingSensorMetersLF, mostRecentParkingSensor.parkingSensorMetersRF);
//Tracer.Trace("redShirtDistanceEstimated = " + redShirtDistanceMetersEstimated);
ComputeMovingVelocity(redShirtDistanceMetersEstimated, targetPanRelativeToRobot, 0.35d, 10.0d);
if (_mapperVicinity.robotState.robotTacticsType == RobotTacticsType.None
&& Math.Abs(redShirtDistanceMetersEstimated - TargetDistanceToGoalMeters) < 0.35d
&& Math.Abs(targetPan) < 10.0d
&& (DateTime.Now - lastGunsFiredOnRed).TotalSeconds > 5.0d)
{
lastGunsFiredOnRed = Now;
//talkerToHuman.Say(9, "red shirt");
SpawnIterator(ShootGunOnce);
}
if (!hadATarget || lostSkeletons) // just acquired target, or lost all Skeletons
{
frameProcessor.doSaveOneImage = _mapperVicinity.robotState.doPhotos; // snap a picture
//talkerToHuman.Say(9, "red shirt");
//nextAnnouncementDelay = _soundsHelper.Announce("$lady in red", nextAnnouncementDelayDefault, 0.05d);
//nextAnnouncementDelay = _soundsHelper.Announce("red shirt", nextAnnouncementDelayDefault, 0.05d);
talkerToHuman.rewindDialogue();
}
}
else
{
if (target == null)
{
Tracer.Trace("----------------- no main color target");
}
else
{
Tracer.Trace("----------------- main color target too old at " + (Now - target.TimeStamp).TotalSeconds + " sec");
}
}
#endregion // Have a red shirt, follow it
} // end ignoreRedShirt
else if ((Now - lastHadRedShirt).TotalSeconds < 1.0d)
{
_mapperVicinity.robotDirection.bearing = null; // indication for tactics to compute collisions and stop.
return; // may be just temporary loss of red shirt, wait a little before switching to sound
}
else if(!haveSkeleton && !_mapperVicinity.robotState.ignoreKinectSounds)
{
// we let voice recognizer have control for several seconds, if we can't track skeleton or red shirt anyway.
if ((Now - lastVoiceLocalized).TotalSeconds > 5.0d)
{
// choose robotTacticsType - current tactics is Stop:
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
}
}
if (!haveATargetNow)
{
// no target means stopping
PerformAvoidCollision(null, 1.0d); // just in case
setCurrentGoalDistance(null);
_mapperVicinity.robotDirection.bearing = null; // indication for tactics to compute collisions and stop.
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
StopMoving();
_state.MovingState = MovingState.Unable;
_state.Countdown = 0; // 0 = immediate response
}
if (hadATarget && !haveATargetNow)
{
lastLostTargets = Now;
secondsSinceLostTargetLast = -1;
haveATargetNowState = 0;
if ((Now - lastThanksForStoppingBy).TotalSeconds > 60.0d)
{
lastThanksForStoppingBy = Now;
talkerToHuman.Say(9, "thanks for stopping by!");
}
//talkerToHuman.Say(9, "lost all humans");
//string messageToSay = "$lost all humans";
//nextAnnouncementDelay = _soundsHelper.Announce(messageToSay, nextAnnouncementDelayDefault, 0.1d);
talkerToHuman.rewindDialogue();
lastTargetPanSwitch = 0;
StartHeadAnimationCombo(HeadComboAnimations.Restpose, false);
AddHeadAnimationCombo(HeadComboAnimations.BlinkCycle, true, 0.4d);
}
hadATarget = haveATargetNow; // set flag for the next cycle
#region Target Lost Routine
if (!haveATargetNow)
{
if (_mapperVicinity.robotState.doLostTargetRoutine)
{
// after losing targets, rotate both directions for a while, and then stop and wait:
int secondsSinceLostTarget = (int)Math.Round((Now - lastLostTargets).TotalSeconds);
if (secondsSinceLostTarget != secondsSinceLostTargetLast)
{
// we come here once every second when the target is not in view.
secondsSinceLostTargetLast = secondsSinceLostTarget;
if (secondsSinceLostTarget <= 30)
{
HeadlightsOn();
double tmpPanKinect = 0.0d;
switch (secondsSinceLostTarget)
{
case 0:
case 1:
// stop for now:
setCurrentGoalDistance(null);
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
SetDesiredKinectTilt(3.0d);
return;
case 2:
case 3:
case 4:
if (haveATargetNowState != 1)
{
tmpPanKinect = 50.0d * Math.Sign(targetPan);
Tracer.Trace("setPanTilt() 1 Kinect pan=" + tmpPanKinect);
SetDesiredKinectPlatformPan(tmpPanKinect);
setGunsParked();
haveATargetNowState = 1;
talkerToHuman.Say(9, "One");
}
break;
case 5:
case 6:
case 7:
if (haveATargetNowState != 2)
{
Tracer.Trace("setPanKinect() 2 Kinect pan=0");
SetDesiredKinectPlatformPan(0.0d);
haveATargetNowState = 2;
talkerToHuman.Say(9, "Two");
}
break;
case 8:
case 9:
case 10:
if (haveATargetNowState != 3)
{
tmpPanKinect = -50.0d * Math.Sign(targetPan);
Tracer.Trace("setPanKinect() 3 Kinect pan=" + tmpPanKinect);
SetDesiredKinectPlatformPan(tmpPanKinect);
haveATargetNowState = 3;
talkerToHuman.Say(9, "Three");
}
break;
case 11:
case 12:
if (haveATargetNowState != 4)
{
Tracer.Trace("setPanKinect() 4 Kinect pan=0");
SetDesiredKinectPlatformPan(0.0d);
haveATargetNowState = 4;
talkerToHuman.Say(9, "Four");
}
break;
}
if (secondsSinceLostTarget > 12 && secondsSinceLostTarget % 6 == 0 && lastTargetPanSwitch != secondsSinceLostTarget)
{
lastTargetPanSwitch = secondsSinceLostTarget;
targetPan = -targetPan; // switch rotation direction every 6 seconds
Tracer.Trace("setPanKinect() 5 Kinect pan=0");
talkerToHuman.Say(9, "Switch");
SetDesiredKinectPlatformPan(0.0d);
}
setCurrentGoalBearingRelativeToRobot(60.0d * Math.Sign(targetPan)); // keep in the same direction where the target last was, aiming at 60 degrees for a steep turn in place
// choose robotTacticsType - rotate towards where the target was last seen:
setCurrentGoalDistance(TargetDistanceToGoalMeters);
FollowDirectionMaxVelocityMmSec = MinimumForwardVelocityMmSec; // ;ModerateForwardVelocityMmSec
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.FollowDirection;
}
else
{
// stop, sing a song and wait for a target to appear:
FollowDirectionMaxVelocityMmSec = 0.0d;
setCurrentGoalDistance(null);
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
haveATargetNowState = 0;
int lonelyPlayTime = 180; // the song is 2:40 - give it 3 minutes to play
if (secondsSinceLostTarget % 20 == 0 && (lastWaitingForHumansAnnounced == 0 || lastWaitingForHumansAnnounced == secondsSinceLostTarget - lonelyPlayTime))
{
lastWaitingForHumansAnnounced = secondsSinceLostTarget;
//talkerToHuman.Say(9, "waiting for humans");
_soundsHelper.Announce("$lonely", 5.0d, 0.05d); // play "I-am-Mr-Lonely.mp3" really quietly
talkerToHuman.rewindDialogue();
lastWaitingForHumansAnnounced = 0;
HeadlightsOff();
}
Tracer.Trace("secondsSinceLostTarget=" + secondsSinceLostTarget);
if (secondsSinceLostTarget % 10 == 0)
{
Tracer.Trace("setPanKinect() 5 Kinect pan=" + panKinectSearchAngles[panKinectSearchIndex]);
SetDesiredKinectTilt(3.0d);
SetDesiredKinectPlatformPan(panKinectSearchAngles[panKinectSearchIndex++]);
if (panKinectSearchIndex >= panKinectSearchAngles.Length)
{
panKinectSearchIndex = 0;
}
}
}
}
}
else // !doLostTargetRoutine
{
// just assume safe position and wait till a new target appears in front of the camera:
HeadlightsOff();
if ((DateTime.Now - lastLostTargets).TotalSeconds > 3.0d)
{
SafePosture();
}
// stop for now:
setCurrentGoalDistance(null);
_mapperVicinity.robotDirection.bearing = null;
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
}
}
#endregion // Target Lost Routine
}
/// <summary>
/// compute and set all FollowDirection parameters based on polar coordinates of target
/// </summary>
/// <param name="distanceToHumanMeters"></param>
/// <param name="targetPanRelativeToRobot"></param>
/// <param name="toleranceMeters">positive</param>
/// <param name="toleranceDegrees">positive</param>
private void ComputeMovingVelocity(double distanceToHumanMeters, double targetPanRelativeToRobot, double toleranceMeters, double toleranceDegrees)
{
//Tracer.Trace("++++++ ComputeMovingVelocity() distanceToHumanMeters=" + distanceToHumanMeters + " targetPanRelativeToRobot=" + targetPanRelativeToRobot);
setCurrentGoalBearingRelativeToRobot(targetPanRelativeToRobot);
double distanceToCoverMeters = distanceToHumanMeters - TargetDistanceToGoalMeters;
// see if we are OK with just keeping the current position or heading:
bool positionOk = Math.Abs(distanceToCoverMeters) < toleranceMeters;
bool headingOk = Math.Abs(targetPanRelativeToRobot) < toleranceDegrees;
bool intendToStay = positionOk && headingOk; // do not move
if (intendToStay)
{
// within the margin from target and almost pointed to it.
// this is dead zone - we don't want to jerk around the desired distance and small angle:
SayState("keeping - target at " + Math.Round(targetPanRelativeToRobot));
//setCurrentGoalDistance(TargetDistanceToGoalMeters); // let PID think we've reached the target
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
return;
}
// we need to move - maybe turn in place. See if we can move at all.
bool canMove = PerformAvoidCollision(null, positionOk ? null : (double?)Math.Sign(distanceToCoverMeters)); // make sure CollisionState is computed if we want to move. Use velocity +-1.0 to communicate direction.
CollisionState collisionState = _state.collisionState;
if (positionOk && !headingOk) // just turn
{
FollowDirectionMaxVelocityMmSec = MinimumForwardVelocityMmSec;
if (targetPanRelativeToRobot > 0.0d && collisionState.canTurnRight)
{
SayState("Turn right in place " + Math.Round(targetPan));
FollowDirectionMaxVelocityMmSec = MaximumForwardVelocityMmSec;
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.FollowDirection;
setCurrentGoalDistance(distanceToHumanMeters);
return;
}
else if (targetPanRelativeToRobot < 0.0d && collisionState.canTurnLeft)
{
SayState("Turn left in place " + Math.Round(-targetPan));
FollowDirectionMaxVelocityMmSec = MaximumForwardVelocityMmSec;
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.FollowDirection;
setCurrentGoalDistance(distanceToHumanMeters);
return;
}
else
{
SayState("Turn blocked");
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
return;
}
}
if (!canMove)
{
SayState("movement blocked");
StopMoving();
_state.MovingState = MovingState.Unable;
_state.Countdown = 0; // 0 = immediate response
_mapperVicinity.robotState.robotTacticsType = RobotTacticsType.None;
return;
}
if (distanceToCoverMeters >= 0.0d)
{
SayState(collisionState.canMoveForward ? ("Forward " + Math.Round(distanceToCoverMeters, 1)) : "Forward Blocked");
FollowDirectionMaxVelocityMmSec = Math.Min(MaximumForwardVelocityMmSec, collisionState.canMoveForwardSpeedMms);
//Tracer.Trace("++ fwd: FollowDirectionMaxVelocityMmSec = " + FollowDirectionMaxVelocityMmSec);
_mapperVicinity.robotState.robotTacticsType = collisionState.canMoveForward ? RobotTacticsType.FollowDirection : RobotTacticsType.None;
setCurrentGoalDistance(distanceToHumanMeters);
}
else if (distanceToCoverMeters <= 0.0d)
{
FollowDirectionMaxVelocityMmSec = Math.Min(MaximumBackwardVelocityMmSec, collisionState.canMoveBackwardsSpeedMms);
SayState(collisionState.canMoveBackwards ? ("Backwards " + Math.Round(distanceToCoverMeters, 1)) : "Backwards Blocked");
//SayState(collisionState.canMoveBackwards ? ("Backwards " + Math.Round(distanceToCoverMeters, 1) + " velocity " + FollowDirectionMaxVelocityMmSec + " human at " + Math.Round(distanceToHumanMeters, 1)) : "Backwards Blocked");
_mapperVicinity.robotState.robotTacticsType = collisionState.canMoveBackwards ? RobotTacticsType.FollowDirection : RobotTacticsType.None;
setCurrentGoalDistance(distanceToHumanMeters);
}
//Tracer.Trace("FollowDirectionMaxVelocityMmSec = " + FollowDirectionMaxVelocityMmSec);
}
#endregion // StrategyPersonFollowing()
[Conditional("DEBUG_MOVEMENTS")]
private void SayState(string whatToSay)
{
Tracer.Trace(whatToSay);
if ((DateTime.Now - lastSayState).TotalSeconds > 3.0d)
{
lastSayState = DateTime.Now;
talkerToHuman.Say(9, whatToSay);
}
}
}
}
| 49.294423 | 242 | 0.517813 | [
"MIT"
] | slgrobotics/TrackRoamer | src/TrackRoamer/TrackRoamerBehaviors/Strategy/StrategyPersonFollowing.cs | 38,008 | C# |
using System.Collections.Generic;
using Essensoft.AspNetCore.Payment.Alipay.Domain;
using Newtonsoft.Json;
namespace Essensoft.AspNetCore.Payment.Alipay.Response
{
/// <summary>
/// AlipayDataDataserviceAdPrincipalQueryResponse.
/// </summary>
public class AlipayDataDataserviceAdPrincipalQueryResponse : AlipayResponse
{
/// <summary>
/// 商家支付宝PID
/// </summary>
[JsonProperty("alipay_pid")]
public string AlipayPid { get; set; }
/// <summary>
/// 商家的全量资质列表
/// </summary>
[JsonProperty("attachment_list")]
public List<OuterAttachment> AttachmentList { get; set; }
/// <summary>
/// 商家id
/// </summary>
[JsonProperty("principal_id")]
public long PrincipalId { get; set; }
/// <summary>
/// 状态: ENABLE-生效 DISABLE-失效 CHECKING-待审核 FAILEDCHECK-审核未通过 INIT-初始化 RE_SIGN-待重签
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }
/// <summary>
/// 二级行业ID
/// </summary>
[JsonProperty("trade_id")]
public string TradeId { get; set; }
}
}
| 27.581395 | 94 | 0.580101 | [
"MIT"
] | lotosbin/payment | src/Essensoft.AspNetCore.Payment.Alipay/Response/AlipayDataDataserviceAdPrincipalQueryResponse.cs | 1,270 | C# |
#pragma warning disable 108 // new keyword hiding
#pragma warning disable 114 // new keyword hiding
namespace Windows.Media.SpeechRecognition
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
#endif
public partial class SpeechContinuousRecognitionResultGeneratedEventArgs
{
#if __ANDROID__ || __IOS__ || NET46 || __WASM__
[global::Uno.NotImplemented]
public global::Windows.Media.SpeechRecognition.SpeechRecognitionResult Result
{
get
{
throw new global::System.NotImplementedException("The member SpeechRecognitionResult SpeechContinuousRecognitionResultGeneratedEventArgs.Result is not implemented in Uno.");
}
}
#endif
// Forced skipping of method Windows.Media.SpeechRecognition.SpeechContinuousRecognitionResultGeneratedEventArgs.Result.get
}
}
| 35.434783 | 177 | 0.790184 | [
"Apache-2.0"
] | nv-ksavaria/Uno | src/Uno.UWP/Generated/3.0.0.0/Windows.Media.SpeechRecognition/SpeechContinuousRecognitionResultGeneratedEventArgs.cs | 815 | C# |
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using System.Numerics;
using Windows.UI.Core;
using Windows.UI.Input.Inking;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace SDKTemplate
{
/// <summary>
/// This scenario demonstrates how to work with InkPresenterRuler in a ScrollViewer.
/// -- Repositioning the InkPresenterRuler on demand
/// -- Integrating a custom button with ruler functionality alongside the InkToolbar
/// </summary>
public sealed partial class Scenario7 : Page
{
InkPresenterRuler ruler;
public Scenario7()
{
this.InitializeComponent();
inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
ruler = new InkPresenterRuler(inkCanvas.InkPresenter);
// Customize Ruler
ruler.BackgroundColor = Windows.UI.Colors.PaleTurquoise;
ruler.ForegroundColor = Windows.UI.Colors.MidnightBlue;
ruler.Length = 800;
}
private void InkToolbar_IsRulerButtonCheckedChanged(InkToolbar sender, object args)
{
var rulerButton = (InkToolbarRulerButton)inkToolbar.GetToggleButton(InkToolbarToggle.Ruler);
BringIntoViewButton.IsEnabled = rulerButton.IsChecked.Value;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
// Make the ink canvas larger than the window, so that we can demonstrate
// scrolling and zooming.
inkCanvas.Width = Window.Current.Bounds.Width * 2;
inkCanvas.Height = Window.Current.Bounds.Height * 2;
}
void OnBringIntoView(object sender, RoutedEventArgs e)
{
// Set Ruler Origin to Scrollviewer Viewport origin.
// The purpose of this behavior is to allow the user to "grab" the
// ruler and bring it into view no matter where the scrollviewer viewport
// happens to be. Note that this is accomplished by a simple translation
// that adjusts to the zoom factor. The additional ZoomFactor term is to
// make ensure the scale of the InkPresenterRuler is invariant to Zoom.
Matrix3x2 viewportTransform =
Matrix3x2.CreateScale(ScrollViewer.ZoomFactor) *
Matrix3x2.CreateTranslation(
(float)ScrollViewer.HorizontalOffset,
(float)ScrollViewer.VerticalOffset) *
Matrix3x2.CreateScale(1.0f / ScrollViewer.ZoomFactor);
ruler.Transform = viewportTransform;
}
}
}
| 40.727273 | 109 | 0.622449 | [
"MIT"
] | HerrickSpencer/Windows-universal-samples | Samples/SimpleInk/cs/Scenario7.xaml.cs | 3,062 | C# |
using System;
using CompScie.ConsoleApp.Demos.StackDemo.Operations;
using CompScie.ConsoleApp.Utilities;
using CompScie.Core;
namespace CompScie.ConsoleApp.Demos.BinarySearchTreeDemo.Operations
{
public class RemoveOperation : IOperation
{
private readonly Tree tree;
public RemoveOperation(Tree tree) => this.tree = tree;
public void Perform()
{
try
{
ConsoleUtilities.Prompt($"\nZadejte hodnotu: ");
tree.Remove(ConsoleUtilities.GetUserInput());
ConsoleUtilities.Prompt("\n");
tree.TraversePreOrder();
ConsoleUtilities.Prompt("\n");
}
catch (Exception exception)
{
ConsoleUtilities.Prompt($"\nCHYBA: {exception.Message}\n");
return;
}
}
}
}
| 26.787879 | 75 | 0.570136 | [
"MIT"
] | ilya-zhidkov/compscie | Source/CompScie.ConsoleApp/Demos/BinarySearchTreeDemo/Operations/RemoveOperation.cs | 886 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// </auto-generated>
namespace Microsoft.Azure.Management.Monitor.Fluent.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime;
using System.Runtime.Serialization;
/// <summary>
/// Defines values for ResultType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ResultType
{
[EnumMember(Value = "Data")]
Data,
[EnumMember(Value = "Metadata")]
Metadata
}
internal static class ResultTypeEnumExtension
{
internal static string ToSerializedValue(this ResultType? value)
{
return value == null ? null : ((ResultType)value).ToSerializedValue();
}
internal static string ToSerializedValue(this ResultType value)
{
switch( value )
{
case ResultType.Data:
return "Data";
case ResultType.Metadata:
return "Metadata";
}
return null;
}
internal static ResultType? ParseResultType(this string value)
{
switch( value )
{
case "Data":
return ResultType.Data;
case "Metadata":
return ResultType.Metadata;
}
return null;
}
}
}
| 27.559322 | 82 | 0.568881 | [
"MIT"
] | Azure/azure-libraries-for-net | src/ResourceManagement/Monitor/Generated/Models/ResultType.cs | 1,626 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MusicPlayer : MonoBehaviour
{
AudioSource audioSource;
// Start is called before the first frame update
void Start()
{
DontDestroyOnLoad(this);
audioSource = GetComponent<AudioSource>();
audioSource.volume = PlayerPrefsController.GetMasterVolume();
}
public void SetVolume(float volume)
{
audioSource.volume = volume;
}
}
| 21 | 69 | 0.687371 | [
"BSD-3-Clause"
] | kristof7/ProjectBeta | Assets/Scripts/Options/MusicPlayer.cs | 485 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Text.Json;
using Azure.Core;
namespace Azure.Management.Resources.Models
{
public partial class OperationDisplay
{
internal static OperationDisplay DeserializeOperationDisplay(JsonElement element)
{
string provider = default;
string resource = default;
string operation = default;
string description = default;
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("provider"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
provider = property.Value.GetString();
continue;
}
if (property.NameEquals("resource"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
resource = property.Value.GetString();
continue;
}
if (property.NameEquals("operation"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
operation = property.Value.GetString();
continue;
}
if (property.NameEquals("description"))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
description = property.Value.GetString();
continue;
}
}
return new OperationDisplay(provider, resource, operation, description);
}
}
}
| 32.03125 | 89 | 0.459024 | [
"MIT"
] | LeighS/azure-sdk-for-net | sdk/resources/Azure.Management.Resources/src/Generated/Models/OperationDisplay.Serialization.cs | 2,050 | C# |
namespace OpenVIII.Fields.Scripts.Instructions
{
internal sealed class DScroll : JsmInstruction
{
#region Fields
private readonly IJsmExpression _arg0;
private readonly IJsmExpression _arg1;
#endregion Fields
#region Constructors
public DScroll(IJsmExpression arg0, IJsmExpression arg1)
{
_arg0 = arg0;
_arg1 = arg1;
}
public DScroll(int parameter, IStack<IJsmExpression> stack)
: this(
arg1: stack.Pop(),
arg0: stack.Pop())
{
}
#endregion Constructors
#region Methods
public override string ToString() => $"{nameof(DScroll)}({nameof(_arg0)}: {_arg0}, {nameof(_arg1)}: {_arg1})";
#endregion Methods
}
} | 23.2 | 118 | 0.570197 | [
"MIT"
] | Sebanisu/OpenVIII | Core/Field/JSM/Instructions/DScroll.cs | 814 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class GreaterofTwoValues
{
static void Main(string[] args)
{
var type = Console.ReadLine();
if (type == "int")
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int max = GetMax(a, b);
Console.WriteLine(max);
}
else if (type == "char")
{
char a = char.Parse(Console.ReadLine());
char b = char.Parse(Console.ReadLine());
char max = GetMax(a, b);
Console.WriteLine(max);
}
else
{
string a = Console.ReadLine();
string b = Console.ReadLine();
string max = GetMax(a, b);
Console.WriteLine(max);
}
//Console.WriteLine(GetMax("a", "b"));
}
public static int GetMax(int a, int b)
{
return Math.Max(a, b);
}
public static char GetMax(char a, char b)
{
return (char)GetMax((int)a, (int)b);
}
public static string GetMax(string a, string b)
{
if (a.CompareTo(b) < 0)
{
return b;
}
else
{
return a;
}
}
}
| 22.9 | 53 | 0.468705 | [
"MIT"
] | Gandjurov/CSharp-ProgrammingFundamentals | 02. Methods/08.GreaterOfTwoValues/GreaterofTwoValues.cs | 1,376 | C# |
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("ConsoleApplication14")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication14")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("38356d9c-70ac-4e65-9dfd-966a8027b999")]
// 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")]
| 38.189189 | 84 | 0.748054 | [
"MIT"
] | bramborman/Area42 | C#/School/IT3/ConsoleApplication14/ConsoleApplication14/Properties/AssemblyInfo.cs | 1,416 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.