Skip to content

Instantly share code, notes, and snippets.

View deccer's full-sized avatar
👾

Josu Obzedat deccer

👾
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Pdb;
namespace InsertExportSymbolForNvidiaOptimus
/rex$ cat log.log
[2019-10-13 21:20:30] [thread_pool/info] | starting pool with 4 threads
[2019-10-13 21:20:30] [thread_pool/info] | starting thread 1
[2019-10-13 21:20:30] [thread_pool/info] | starting thread 2
[2019-10-13 21:20:30] [thread_pool/info] | starting thread 3
[2019-10-13 21:20:30] [thread_pool/info] | starting thread 4
[2019-10-13 21:20:30] [thread_pool/info] | started pool with 4 threads (took 0.42 ms)
[2019-10-13 21:20:30] [global/verbose] | 0x55c00f28be60 init: system/half
[2019-10-13 21:20:30] [global/verbose] | 0x55c00f28ccd8 init: cvars/gl4.anisotropy
[2019-10-13 21:20:30] [console/info] | registered 'gl4.anisotropy'
auto t1 = glfwGetTime();
auto deltaTimeAverage = 0.0f;
auto deltaTimeAverageSquared = 0.0f;
auto framesToAverage = 100;
auto frameCounter = 0;
glfwSwapInterval(0);
<Window x:Class="Editor.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Editor.ViewModels"
xmlns:otkc="clr-namespace:OpenTK.Wpf;assembly=GLWpfControl"
WindowStartupLocation="CenterScreen"
d:DataContext="{d:DesignInstance viewModels:MainViewModel}"
mc:Ignorable="d"
public class DelegateCommand : ICommand
{
private readonly Action _action;
private readonly Func<bool> _canExecute;
public event EventHandler CanExecuteChanged
{
add => CommandManager.RequerySuggested += value;
remove => CommandManager.RequerySuggested -= value;
}
using System;
using System.Collections.Generic;
using System.Numerics;
using SharpDX.Mathematics.Interop;
using Xacor.Game;
using Xacor.Graphics;
using Xacor.Graphics.DX;
using Xacor.Platform;
namespace Xacor.Demo
#define DIRECTINPUT_VERSION 0x0800
#include <d3d11.h>
#include <dinput.h>
#include <functional>
#include <string>
#include <windows.h>
template <typename t>
std::string hex_number(t number, size_t hex_len = sizeof(t) << 1)
public static void GetVerticesAndIndicesFromModel(Model model, out Vector3[] vertices, out int[] indices)
{
var verticesList = new List<Vector3>();
var indicesList = new List<int>();
var transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);
Matrix transform;
foreach (ModelMesh mesh in model.Meshes)
{
namespace Xacor.Graphics
{
public class Shader : IDisposable
{
public class VirtualShaderFile
{
public string Name { get; }
public string Text { get; }
public VirtualShaderFile(string name, string text)
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (requestCode == IntentRequestCodes.OpenFolderForRawImportRequestCode)
{
var folderUri = data.Data;
var documentFolderUri = DocumentsContract.BuildChildDocumentsUriUsingTree(folderUri, DocumentsContract.GetTreeDocumentId(folderUri));
var projection = new[]