Skip to content

Instantly share code, notes, and snippets.

View abidanBrito's full-sized avatar

Abidán Brito abidanBrito

  • UPV
  • Canary Islands
View GitHub Profile
@malustewart
malustewart / imgui_consultas_2020_1C.md
Last active September 2, 2023 19:53
Consultas de ImGui para EDA 1er cuatrimestre 2020

ImGui consultas 2020 1C

> ¿Cómo cambio el tamaño de las fonts?

En DemoWindow > Configuration > Fonts :

  • Para cambiar el tamaño de la font de una sola ventana, existe ImGui::SetWindowFontScale(window_scale), donde window_scale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).
  • Para cambiar el tamaño de una font en todas las ventanas, alcanza con modificar io.FontGlobalScale. io es el contexto de ImGui que se obtiene en la inicialización. FontGlobalScale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).

Ver líneas 3324 a 3327 de imgui_demo.cpp

> ¿Cómo fijo la posición de las ventanas?

This note simply gathers some info and thoughts on building Node Editor, especially in an
immediate mode setting.
Q: How does imgui render rounded rects?
Check imgui AddRectFilled
Imgui drawing api is closer to nanoVG
- Path is kept
- Contents are modified based on path
@vurtun
vurtun / _readme_quarks.md
Last active December 9, 2023 12:03
Quarks: Graphical user interface

gui

void printOpenGLDebugInfo()
{
int majorVersion, minorVersion;
glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
std::cout << "OpenGL Version: " << majorVersion << "." << minorVersion
<< std::endl;
int work_grp_cnt[3];
@alaingalvan
alaingalvan / screenspacebentconesao.glsl
Last active December 27, 2023 20:53
GPU Pro 3 sample of bent cones screen space ambient occlusion.
void main()
{
vec3 positionX = backproject(depthTexture(pixelCoordinateI), inverseViewProjectionMatrix);
vec3 normalX = normalTexture(pixelCoordinateI);
// get ONB to transform samples
mat3 orthoNormalBasis = computeONB(normalX);
// select samples for pixel out of pattern
int patternOffset = getPatternOffset(pixelCoordinateI);
float ao = 0.0;
@alaingalvan
alaingalvan / bevel-normals.glsl
Created August 3, 2017 17:29
Some bevel shader magic. :3
void rng_seed(output int rng, int seed)
{
int chash = seed;
if (chash == 0) chash = 1;
rng = chash * 30391861;
}
float rng_uniform(output int rng)
{
float res = rng / float(2137483647) * 0.5 + 0.5;
@mmozeiko
mmozeiko / win32_webgpu.c
Last active February 19, 2024 20:20
setting up and using WebGPU in C using Dawn
// example how to set up WebGPU rendering on Windows in C
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest
#include "webgpu.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define _USE_MATH_DEFINES
@mmozeiko
mmozeiko / upng.h
Last active February 25, 2024 08:08
uncompressed png writer & reader
#pragma once
// uncompressed png writer & reader
// supports only 8-bit and 16-bit formats
// Performance comparison for 8192x8192 BGRA8 image (256MB)
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument
//
// For libpng (compressed) uses default libpng/zlib compression settings
// For libpng (uncompressed) case following two functions are used:
@rmitton
rmitton / toolbar.cpp
Created March 13, 2019 06:20
How to do a toolbar in Dear ImGui.
// How to do a toolbar in Dear ImGui.
const float toolbarSize = 50;
void DockSpaceUI()
{
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos + ImVec2(0, toolbarSize));
ImGui::SetNextWindowSize(viewport->Size - ImVec2(0, toolbarSize));
ImGui::SetNextWindowViewport(viewport->ID);
@Wumpf
Wumpf / cfd.md
Last active April 10, 2024 22:39
Notes on CFD