Skip to content

Instantly share code, notes, and snippets.

Doug Binks dougbinks

Block or report user

Report or block dougbinks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ImGuiMarkdown.h
#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_ )
@dougbinks
dougbinks / ImGuiUtils.h
Created Nov 18, 2017
ImGuiUtils.h with TextURL
View ImGuiUtils.h
#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
View ImGuiUtils.h
#pragma once
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
namespace ImGui
{
inline void SetupImGuiStyle( bool bStyleDark_, float alpha_ )
{
View gist:ca4798e5a1a16bd23fd6
void CheckBoxFont( const char* name_, bool* pB_, const char* pOn_ = "[X]", const char* pOff_="[ ]" )
{
if( *pB_ )
{
ImGui::Text(pOn_);
}
else
{
ImGui::Text(pOff_);
}
View gist:cec967aefc739b8c0333
bool MenuItemCheckbox( const char* name_, bool* pB_ )
{
bool retval = ImGui::MenuItem( name_ );
ImGui::SameLine();
if( *pB_ )
{
ImGui::Text(ICON_FA_CHECK_SQUARE_O);
}
else
{
View gl_VertexID barycentric coords
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)
{
You can’t perform that action at this time.