Skip to content

Instantly share code, notes, and snippets.

@galloscript
galloscript / BorderlessWindowMacOSXFile.m
Last active May 17, 2020 04:22
Frameless GLFW/ImGui window in MacOSX
//Get the native window
NSWindow* cocoaWindow = glfwGetCocoaWindow(glfwWindowPtr);
NSUInteger lWindowStyle = NSWindowStyleMaskTitled |
NSWindowStyleMaskClosable |
NSWindowStyleMaskMiniaturizable |
NSWindowStyleMaskResizable |
NSWindowStyleMaskUnifiedTitleAndToolbar |
NSWindowStyleMaskFullSizeContentView;
//Set the style mask
@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active April 5, 2024 05:40
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@ongamex
ongamex / ImguiMayaStyle.cpp
Created December 29, 2016 12:05
ImGui style that look like Maya
ImGuiStyle& style = ImGui::GetStyle();
style.ChildWindowRounding = 3.f;
style.GrabRounding = 0.f;
style.WindowRounding = 0.f;
style.ScrollbarRounding = 3.f;
style.FrameRounding = 3.f;
style.WindowTitleAlign = ImVec2(0.5f,0.5f);
style.Colors[ImGuiCol_Text] = ImVec4(0.73f, 0.73f, 0.73f, 1.00f);

Common game localizations https://docs.google.com/spreadsheets/d/135HgMYcRDt6vnJN0d-xFMEZUeWjVbc61ETf8uVwHERE/edit#gid=339250473

Polyglot Gamedev Project : Master Sheet 0.9.0 https://docs.google.com/spreadsheets/d/17f0dQawb-s_Fd7DHgmVvJoEGDMH_yoSd8EYigrb0zmM/edit#gid=310116733

Game UI common translation https://docs.google.com/spreadsheets/d/197GYEhPpk0DQTEO0r80v_k_bkGVtUgBB08PP--hqCIA/edit#gid=0

Raw text files containing characters used in different languages such as English, French, German, Chinese, Japanese, Korean.

#include <imgui.h>
#include "imgui_impl_glfw.h"
#include <stdio.h>
#include <GLFW/glfw3.h>
static void error_callback(int error, const char* description)
{
fprintf(stderr, "Error %d: %s\n", error, description);
}
@FelixK15
FelixK15 / shader_processing_thoughts.txt
Created August 15, 2016 20:31
Shader processing (non API specific)
Shader file (e.g. vertex shader):
----
float4 TransformVertex(in float4 pos : POSITION,
in float2 uvIn : TEXCOORD0,
in float4x4 worldMatrix : WORLDMATRIX,
in float4x4 projMatrix : PROJECTIONMATRIX,
in float4x4 viewMatrix : VIEWMATRIX,
out float2 uvOut : TEXCOORD0)
{
@harold-b
harold-b / dear imgui, selectable popup example
Created August 6, 2016 18:39
A functional selectable pseudo-popup window example using dear imgui, for use with autocomplete or input history.
const int ENTRY_COUNT = 10;
const char* ENTRIES[ENTRY_COUNT] =
{
"Entry 0",
"Entry 1",
"Entry 2",
"Entry 3",
"Entry 4",
"Entry 5",
@flibitijibibo
flibitijibibo / flibitPackaging.md
Created June 17, 2016 16:00
Hope you like reading ldd output!

A week ago I was CC'd in on a thread about Linux packaging, and how to avoid doing it the wrong way (i.e. RPM, Deb, etc.). I've always used MojoSetup and I've never forced distributions to do any additional work, but this is still a new concept to a lot of people. Additionally, Amos suggested that I expand on Itch's FNA appendix, so here's a guide on how I package my games.

This is a bit of an expansion on my MAGFest 2016 presentation, which you can find here:

http://www.flibitijibibo.com/magfest2016/

https://www.youtube.com/watch?v=B83CWUh0Log

I would recommend looking at that first! After that, read on...

@galloscript
galloscript / imgui_color_gradient.cpp
Last active June 6, 2024 15:23
Gradient color generator and editor for ImGui
//
// imgui_color_gradient.cpp
// imgui extension
//
// Created by David Gallardo on 11/06/16.
#include "imgui_color_gradient.h"
#include "imgui_internal.h"
@rygorous
rygorous / gist:e0f055bfb74e3d5f0af20690759de5a7
Created May 8, 2016 06:54
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.