Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

RUSshy

🌴
On vacation
Block or report user

Report or block RUSshy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Input.cs
public enum Keys
{
ANY_KEY = -1,
NUM_0 = 7,
NUM_1 = 8,
NUM_2 = 9,
NUM_3 = 10,
NUM_4 = 11,
NUM_5 = 12,
NUM_6 = 13,
View Pg.cs
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using Oid = System.UInt32;
using pqbool = System.Byte;
using pg_int64 = System.Int64;
namespace Arc.Bindings.PostgreSql
{
View DBConnection.cs
public class DBConnection : IDisposable
{
private IntPtr _connection;
public void connect(string host, string user, string pass, string db)
{
var connectionStr = $"host={host} dbname={db} user={user} password={pass} client_encoding=utf8";
_connection = Pg.PQconnectdb(connectionStr);
if (Pg.PQstatus(_connection) != Pg.ConnStatusType.CONNECTION_OK)
View DBConnection.cs
public class DBConnection : IDisposable
{
private IntPtr _connection;
public void connect(string host, string user, string pass, string db)
{
var connectionStr = $"host={host} dbname={db} user={user} password={pass} client_encoding=utf8";
_connection = Pg.PQconnectdb(connectionStr);
if (Pg.PQstatus(_connection) != ConnStatusType.CONNECTION_OK)
{
@RUSshy
RUSshy / greedyvoxelmeshing
Created Aug 4, 2019 — forked from Vercidium/greedyvoxelmeshing
Greedy Voxel Meshing ported to C#
View greedyvoxelmeshing
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implemenetation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)
View imgui.cs
private void renderDrawData()
{
var data = ImGui.GetDrawData();
Gl.Enable(EnableCap.Blend);
Gl.BlendEquation(BlendEquationMode.FuncAdd);
Gl.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
Gl.Disable(EnableCap.CullFace);
Gl.Disable(EnableCap.DepthTest);
View test.d
public class Renderable
{
public Mat4 worldTransform;
public MeshPart meshPart = new MeshPart;
public Material material;
public Environment environment;
public Mat4[] bones;
public IShader shader;
}
View LinkedList.d
module robikstuff.LinkedList;
import std.algorithm;
/**
* Represents doubly linked list.
*
* Adding or removing elements at both list ends is constant time,
* accessing element at specified index takes O(n).
* List length is cached internally, so accessing list length is always O(1).
View ConsoleApp3.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{73DC8DE9-3244-4859-AA8F-6D34F5F431DF}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp3</RootNamespace>
<AssemblyName>ConsoleApp3</AssemblyName>
View ConsoleApp1.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BDF52DD2-689D-4452-996B-1FA5DE07B5E4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp1</RootNamespace>
<AssemblyName>ConsoleApp1</AssemblyName>
You can’t perform that action at this time.