This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ObservedSerialization | |
{ | |
/// <summary> | |
/// Like SerializerMode | |
/// </summary> | |
enum ThingMode | |
{ | |
SwapValues, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Downloads this texture from the GPU. | |
/// </summary> | |
/// <returns>A bitmap representing this texture. You are responsible for disposing it.</returns> | |
public Bitmap Download() | |
{ | |
Bitmap bitmap = null; | |
try | |
{ | |
bitmap = new Bitmap(Width, Height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace Protoscratch | |
{ | |
static class Oculus | |
{ | |
[DllImport("LibOVRDll64.dll", EntryPoint = "ovr_Initialize", CallingConvention=CallingConvention.Cdecl)] | |
[return: MarshalAs(UnmanagedType.I1)]//LibOVR uses 1 byte booleans | |
public static extern bool Initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#define NANOSECONDS_PER_SECOND ( 1000000000LL ) | |
#define NANOSECONDS_PER_TIMER ( 100LL ) | |
int main() | |
{ | |
LARGE_INTEGER begin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#define NANOSECONDS_PER_SECOND ( 1000000000LL ) | |
#define NANOSECONDS_PER_TIMER ( 100LL ) | |
int main() | |
{ | |
LARGE_INTEGER begin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <stdio.h> | |
void PrintDisplayDevice(DISPLAY_DEVICEA* displayDevice, const char* indent = "") | |
{ | |
printf("%sDeviceName: %s\n", indent, displayDevice->DeviceName); | |
printf("%sDeviceString: %s\n", indent, displayDevice->DeviceString); | |
printf("%sStateFlags:", indent); | |
if (displayDevice->StateFlags & DISPLAY_DEVICE_ACTIVE) { printf(" ACTIVE"); } | |
if (displayDevice->StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) { printf(" MIRRORING_DRIVER"); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
======= Display Device 0 ======= | |
DeviceName: \\.\DISPLAY1 | |
DeviceString: AMD Radeon HD 7800 Series | |
StateFlags: ACTIVE | |
DeviceID: PCI\VEN_1002&DEV_6819&SUBSYS_E221174B&REV_00 | |
Total display modes: 95 | |
======= Display Device 0,0 ======= | |
DeviceName: \\.\DISPLAY1\Monitor0 | |
DeviceString: Generic PnP Monitor | |
StateFlags: ACTIVE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void tsk_switch_handler() | |
{ | |
tm_current_slice--; //609 | |
if (tm_current_slice == 0) //610 | |
{ | |
//Timeslice exhausted, switch to another thread as long as we can get access to the kernel critical section... | |
if (kernel_critical_section) //612, 613 | |
{ | |
//Thread is in kernel critical section, so we give the thread | |
//some extra time to leave it. (We can't do anything until it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SharpYaml; | |
using SharpYaml.Events; | |
using SharpYaml.Serialization; | |
using SharpYaml.Serialization.Descriptors; | |
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Runtime.Serialization; | |
namespace YamlPlayground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Fody; | |
using Mono.Cecil; | |
using Mono.Cecil.Cil; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Evil.Fody | |
{ | |
public class ModuleWeaver : BaseModuleWeaver | |
{ |
OlderNewer