Skip to content

Instantly share code, notes, and snippets.

View dotxnc's full-sized avatar

.xnc dotxnc

View GitHub Profile
#ifndef RAYNAMES_H
#define RAYNAMES_H
/* raylib.h */
#define vector2_t Vector2
#define vector3_t Vector3
#define vector4_t Vector4
#define matrix_t Matrix
#define color_t Color
/**********************************************************************************************
*
* rlgl - raylib OpenGL abstraction layer
*
* rlgl is a wrapper for multiple OpenGL versions (1.1, 2.1, 3.3 Core, ES 2.0) to
* pseudo-OpenGL 1.1 style functions (rlVertex, rlTranslate, rlRotate...).
*
* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal
* VBO buffers (and VAOs if available). It requires calling 3 functions:
* rlglInit() - Initialize internal buffers and auxiliar resources
#include "gbuffer.h"
/* gbuffer_t type
typedef struct gbuffer_t {
unsigned int id;
int width;
int height;
Texture2D color;
Texture2D normal;
Texture2D position;
#version 330
in vec2 fragTexCoord;
in vec4 fragColor;
in vec3 fragNormal;
in vec3 fragPos;
uniform sampler2D texture0;
uniform vec3 lightDirection = vec3(1.f, -0.3f, -0.5f);
@dotxnc
dotxnc / main.cpp
Created March 29, 2017 20:48
I was really lazy.
#include <stdio.h>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef __WIN32
#include <conio.h>
#define fstat _fstat64
#define stat _stat64
@dotxnc
dotxnc / vector.lua
Created February 17, 2017 08:55
vector math as a lua object
local vector = {x,y,z}
vector.__index = vector
vector.__add = function(lhs, rhs)
if rhs == nil then return lhs end
local _n = vector(0,0,0)
if type(rhs) == "number" then rhs = vector(rhs,rhs,rhs) end
_n.x = lhs.x + rhs.x
_n.y = lhs.y + rhs.y
_n.z = lhs.z + rhs.z
return _n
--[[
--
-- This is a lua jit wiringpi interface through luajit.
-- it's slow. it's bad. but it works.
--
-- (c) 2016-2017 Lumaio
--
--]]
@dotxnc
dotxnc / struct.h
Created January 14, 2017 04:56
rip old drop menu code
template <typename TYPE>
struct DropMenu {
std::vector<TYPE>* skins;
const wchar_t* name;
int index = 0;
bool thisdrop = false;
int x, y;
SourceEngine::EItemDefinitionIndex skinid;
bool needsupdate=true;
KeyToggle drop_click;
//
// Created by Lumaio on 12/28/2016.
// C API for pushbullet.
// Requires libcURL
//
#ifndef PUSHBULLET_H
#define PUSHBULLET_H
#include <stdio.h>
@dotxnc
dotxnc / lcd_game.lua
Last active February 12, 2017 03:55
#!/usr/bin/luajit
local wpi = require ("wiringlua")
local ADDR = 0x27
local BLEN = 1
local fd = 0
function write_word(data)
local temp = data