Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesus de Santos Garcia jesusdesantos

View GitHub Profile
View Main.xaml
<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">
View Main.xaml
<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 Jan 8, 2019
NoesisGUI minimal sample using GLUT
View main.cpp
#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 / RenderDevice.h
Last active Aug 9, 2016
NoesisGUI Rendering Device abstraction
View RenderDevice.h
////////////////////////////////////////////////////////////////////////////////////////////////////
// Noesis GUI - http://www.noesisengine.com
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef __RENDER_RENDERDEVICE_H__
#define __RENDER_RENDERDEVICE_H__
#include <Noesis.h>
@jesusdesantos
jesusdesantos / NoesisGUI.xaml
Created Apr 9, 2016
NoesisGUI animated logo
View NoesisGUI.xaml
<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">
View Unity and GL context problems
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 / gist:8306629
Created Jan 7, 2014
Getting symbol names from the DLL export table
View gist:8306629
// 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))
{
@jesusdesantos
jesusdesantos / gist:5371743
Created Apr 12, 2013
A benchmark for several allocators used in Noesis
View gist:5371743
------------------------------------------------------------------------
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