Skip to content

Instantly share code, notes, and snippets.

View PieroCastillo's full-sized avatar
🎯
Focusing

Piero Castillo PieroCastillo

🎯
Focusing
  • Lima, Perú
View GitHub Profile
//on load
Surface = new Surface(new LTSize(800,600), IntPtr handle);
//on render
Surface.GetCanvas().something();
[ERROR] [Vulkan] Validation Error: [ VUID-VkPhysicalDeviceProperties2-pNext-pNext ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xdd73dbcf | vkGetPhysicalDeviceProperties2KHR: pProperties->pNext chain includes a structure with une
xpected VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR; Allowed structures are [VkPhysicalDeviceAccelerationStructurePropertiesKHR, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT, VkPhysicalDeviceConservativeRasteri
zationPropertiesEXT, VkPhysicalDeviceCooperativeMatrixPropertiesNV, VkPhysicalDeviceCustomBorderColorPropertiesEXT, VkPhysicalDeviceDepthStencilResolveProperties, VkPhysicalDeviceDescriptorIndexingProperties, VkPhysicalDeviceDeviceGeneratedCommandsPropertie
sNV, VkPhysicalDeviceDiscardRectanglePropertiesEXT, VkPhysicalDeviceDriverProperties, VkPhysicalDeviceExternalMemoryHostPropertiesEXT, VkPhysicalDeviceFloatControlsProperties, VkPhysicalDeviceFragmentDensityMap2PropertiesEXT, VkPhysicalDeviceFragment
@PieroCastillo
PieroCastillo / StyledPropertySnippet.snippet
Created April 7, 2021 03:34
Avalonia Styled Property Snippet for VisualStudio
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Define an StyledProperty</Title>
<Shortcut>styledprop</Shortcut>
<Description>Code snippet for a property using DependencyProperty as the backing store</Description>
<Author>Piero Castillo</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
@PieroCastillo
PieroCastillo / Minimal SharpAudio Program.cs
Created March 18, 2021 19:33
Minimal Program using SharpAudio
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using SharpAudio.Codec;
namespace SharpAudio.Sample
{
class Program
{
@PieroCastillo
PieroCastillo / Lighter or Darker a Color.cs
Created February 7, 2021 22:32 — forked from zihotki/Lighter or Darker a Color.cs
.net C# make a color lighter or darker
/// <summary>
/// Creates color with corrected brightness.
/// </summary>
/// <param name="color">Color to correct.</param>
/// <param name="correctionFactor">The brightness correction factor. Must be between -1 and 1.
/// Negative values produce darker colors.</param>
/// <returns>
/// Corrected <see cref="Color"/> structure.
/// </returns>
public static Color ChangeColorBrightness(Color color, float correctionFactor)
@PieroCastillo
PieroCastillo / SimpleSoundPlayer.cs
Created September 25, 2020 16:45 — forked from jtbrower/SimpleSoundPlayer.cs
Play a Sound Wave File in .Net, NetCore and Net5.0 without additional Media Libraries
namespace Gist
{
using System.Runtime.InteropServices;
//NOTICE : Applicable only to Windows and wav files
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// A class that uses PInvoke to play a wave file in DotNet Core, .Net and Net5.0. This function
/// will not work on non Windows platforms, but does work on alternative UI frameworks such as