Skip to content

Instantly share code, notes, and snippets.

@mmj-the-fighter
mmj-the-fighter / readme.txt
Last active January 28, 2025 03:46
useful for software rendering techniques.
SDL3 Fast Pixel Manipulation Example
************************************
This project demonstrates dynamic Texture Updates
*************************************************
Updates a streaming texture on every frame using either locked or lockless pixel manipulation techniques.
Performance Analysis
********************
#include <string>
#include <map>
#include <functional>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using Message = std::string;
using Topic = std::string;
@mmj-the-fighter
mmj-the-fighter / interpolator.hpp
Last active April 16, 2025 11:07
Linear Interpolator C++ class for graphics programming
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
@mmj-the-fighter
mmj-the-fighter / atm.cpp
Last active July 13, 2022 05:41
Automated Teller Machine sim
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
struct MoneyBundle
{
int denomination;
int count;
//Copyright © 2010 - 2024 Manoj M J and Oskar Schramm
//All Rights Reserved
[Game Development]
[Foundations]
[TOC]
Introduction
Platforms
Programming
@mmj-the-fighter
mmj-the-fighter / SlideCameraOnCollision.cs
Last active August 5, 2017 15:48
A method to slide camera along an obstacle in a 3D world.
//Copyright © 2017 Manoj M J
//All Rights Reserved
/*
A method to slide camera along an obstacle.
Note: This script uses Unity3D game engine api and libraries.
*/
void SlideCameraOnCollision(
Vector3 obstacleNormal,
Vector3 cameraForward,
@mmj-the-fighter
mmj-the-fighter / broadcastclient.c
Last active January 16, 2024 14:36
server and client for udp broadcasting, useful for server discovery.
#if defined(_WIN32)
#define BUILD_FOR_WINDOWS
#endif
#ifdef BUILD_FOR_WINDOWS
#pragma warning(disable:4996)
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
#include <stdio.h>
@mmj-the-fighter
mmj-the-fighter / ComponentLister.cs
Last active August 5, 2017 14:27 — forked from AngryAnt/ComponentLister.cs
An extension to example code for "Where did that component go?" from AngryAnt
/*
* Displays gameobjects linked to each script present in a scene, useful for development and debugging.
* Added features:
* You can search for a particular component, and turn off UnityEngine componets from displaying.
* While searching you don't have to type the entire name.
*/
using UnityEngine;
using UnityEditor;
using System.Collections;
Here in this file, I am explaining the reasons for putting
"All Rights Reserved" notice.
This may be because of some or all of the following reasons.
- I cannot put the code in public domain, some one else may copy it and copyright it and there after I may not modify and redistribute it.
- The code I made may be not of professional quality.
- I am only demonstrating an idea and / or an approach of problem solving
- Or it is a mere collection of some data useful for development purpose
- Or it may be a work in progress, published only for preview
@mmj-the-fighter
mmj-the-fighter / TransformTreePreOrderTraversor.cs
Last active August 27, 2017 23:00
Algorithm for traversing a game object hierarchy tree in pre-order in Unity3D
//Copyright © 2015 Manoj M J
//All Rights Reserved
using UnityEngine;
using System.Collections;
public class TransformTreePreOrderTraversor : MonoBehaviour
{
void Start () {
TraverseInPreOrder(this.gameObject.transform);