Skip to content

Instantly share code, notes, and snippets.

View dougbinks's full-sized avatar

Doug Binks dougbinks

View GitHub Profile
#pragma once
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
namespace ImGui
{
inline void SetupImGuiStyle( bool bStyleDark_, float alpha_ )
{
@dougbinks
dougbinks / ImGuiUtils.h
Created November 18, 2017 13:53
ImGuiUtils.h with TextURL
#pragma once
#include "RuntimeImGui.h"
#include "RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE;
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
#include "PlatformUtils.h"
namespace ImGui
#pragma once
/*
// Example use on Windows with links opening in a browser
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include "Shellapi.h"
inline void LinkCallback( const char* link_, uint32_t linkLength_ )
One way to generate barycentric coordinates from a vertex stream is to use gl_VertexID. This requires that your vertices are ordered in the vertex buffer in a regular fashion as gl_VertexID is the vertex position in the buffer, so vertex optimization using an index buffer will likely break this.
Step 1 is to generate a vec3 in the vertex shader:
//VS
out vec3 ex_BarycentricCoords;
void main(void)
{
@dougbinks
dougbinks / gist:ca4798e5a1a16bd23fd6
Created October 30, 2015 10:01
ImGui CheckboxFont
void CheckBoxFont( const char* name_, bool* pB_, const char* pOn_ = "[X]", const char* pOff_="[ ]" )
{
if( *pB_ )
{
ImGui::Text(pOn_);
}
else
{
ImGui::Text(pOff_);
}
@dougbinks
dougbinks / gist:cec967aefc739b8c0333
Created October 30, 2015 09:59
ImGui MenuItemCheckbox
bool MenuItemCheckbox( const char* name_, bool* pB_ )
{
bool retval = ImGui::MenuItem( name_ );
ImGui::SameLine();
if( *pB_ )
{
ImGui::Text(ICON_FA_CHECK_SQUARE_O);
}
else
{