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 / 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 / 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 / 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">
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 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))
{
@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