Skip to content

Instantly share code, notes, and snippets.

View jesusdesantos's full-sized avatar

Jesus de Santos Garcia jesusdesantos

View GitHub Profile
@jesusdesantos
jesusdesantos / gist:8306629
Created January 7, 2014 20:47
Getting symbol names from the DLL export table
// If no symbol information is found because the .pdb is missing we try the alternative
// of finding the nearest exported symbol from the DLL. Although it can be inaccurate it is
// better than displaying nothing and usually our clients do not have our pdbs because they
// send us minidumps.
else if (MapAndLoad_ != 0 && UnMapAndLoad_ != 0 && ImageDirectoryEntryToData_ != 0 &&
ImageRvaToVa_ != 0 && UnDecorateSymbolName_ != 0)
{
_LOADED_IMAGE loadedImage;
if (MapAndLoad_(moduleInfo.ImageName, 0, &loadedImage, TRUE, TRUE))
{
How do we detect when Unity recreates the GL context?
1. By using XXXGetCurrentContext (eg: glXGetCurrentContext). Problem: sometimes the context is different but the pointer returned by XXXGetCurrentContext is the same.
2. By using glIsBuffer(name) against a VAO. This is not 100% safe because 'name' could be a valid handle in the current context, one created by Unity for example.
3. Using the native callback API (UnityGfxDeviceEventType). Problem: not implemented.
@jesusdesantos
jesusdesantos / NoesisGUI.xaml
Created April 9, 2016 09:11
NoesisGUI animated logo
<Grid
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"
mc:Ignorable="d"
Background="#FF124C7A"
d:DesignWidth="1280" d:DesignHeight="720">
<Grid.Resources>
<Storyboard x:Key="Intro">
@jesusdesantos
jesusdesantos / RenderDevice.h
Last active August 9, 2016 20:07
NoesisGUI Rendering Device abstraction
////////////////////////////////////////////////////////////////////////////////////////////////////
// Noesis GUI - http://www.noesisengine.com
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __RENDER_RENDERDEVICE_H__
#define __RENDER_RENDERDEVICE_H__
#include <Noesis.h>
@jesusdesantos
jesusdesantos / gist:5371743
Created April 12, 2013 12:42
A benchmark for several allocators used in Noesis
------------------------------------------------------------------------
Memory Allocator perfomance benchmark
------------------------------------------------------------------------
local_n = n threads allocating and deallocating random blocks of max
size. Deallocations always happening in the same thread that
the corresponding allocation.
share_n = n threads allocating and deallocating random blocks of max
size from a shared list. Deallocation may happen in different
thread that the allocation one
@jesusdesantos
jesusdesantos / Main.xaml
Created February 21, 2020 18:50
HelloWorld
<UserControl
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:local="clr-namespace:HelloWorld"
mc:Ignorable="d"
FontSize="24"
Background="#FF124C7A">
@jesusdesantos
jesusdesantos / Main.xaml
Last active February 21, 2020 19:00
Coding Ape
<Grid
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" mc:Ignorable="d"
Background="Black"
d:DesignWidth="758" d:DesignHeight="460">
<Grid.Resources>
<Storyboard x:Key="anim" Duration="0:0:2.48">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="RenderTransform.Y" Storyboard.TargetName="Layer20">
@jesusdesantos
jesusdesantos / main.cpp
Created January 8, 2019 14:10
NoesisGUI minimal sample using GLUT
#include <GLUT/glut.h>
#include <Noesis_pch.h>
static Noesis::IView* _view;
static void NoesisInit()
{
auto logHandler = [](const char*, uint32_t, uint32_t level, const char*, const char* message)
{
// [TRACE] [DEBUG] [INFO] [WARNING] [ERROR]
@jesusdesantos
jesusdesantos / Main.xaml
Last active December 23, 2021 10:40 — forked from s-fernandez-v/Main.xaml
Christmas '21
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
Background="White">
<Viewbox>
<Canvas Width="1480" Height="1480" Background="Transparent" Margin="0,0,0,-200">
<Canvas.Resources>
<Storyboard x:Key="AnimLogo">
@jesusdesantos
jesusdesantos / Main.xaml
Created November 3, 2022 10:02
Right-To-Left TextBlock
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<StackPanel>
<TextBlock Background="DarkBlue" Foreground="LightBlue" FontSize="20" FlowDirection="LeftToRight">
This is a Left-To-Right TextBlock
</TextBlock>
<TextBlock Background="LightBlue" Foreground="DarkBlue" FontSize="20" FlowDirection="RightToLeft">
هذا كتلة نصية من اليمين إلى اليسار
</TextBlock>
</StackPanel>
</Page>