Skip to content

Instantly share code, notes, and snippets.

Eleni Maria Stea hikiko

Block or report user

Report or block hikiko

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
@hikiko
hikiko / xor.vert.frag
Last active Apr 13, 2020
xor pattern shader (the comment) :p
View xor.vert.frag
#version 430
#extension GL_ARB_separate_shader_objects : enable
const vec2 vdata[] = vec2[] (
vec2(1.0, 1.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(0.0, 0.0));
void main()
@hikiko
hikiko / dump_ppm.c
Created Apr 7, 2020
the code I use to dump ppm because I always forget those P6, P3 etc :p
View dump_ppm.c
{
unsigned char pix[160 * 160 * 4];
FILE *fp;
int i;
glBindTexture(GL_TEXTURE_2D, gl_tex);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pix);
if ((fp = fopen("/tmp/foo.ppm", "wb"))) {
//fprintf(fp, "P6\n160 160\n255\n");
@hikiko
hikiko / . iso_env.sh
Last active Jun 3, 2020
script to create an "isolated" environment in my igalia/install dir where I've installed mesa, the vulkan loader, layers, tools etc (run as . iso_env.sh)
View . iso_env.sh
#!/bin/bash
PS1="[isolated] $PS1"
export PATH=$PATH:/home/eleni/igalia/install/bin
export LD_LIBRARY_PATH=/home/eleni/igalia/install/lib:/home/eleni/igalia/install/lib/x86_64-linux-gnu
export LD_RUN_PATH=/home/eleni/igalia/install/lib:/home/eleni/igalia/install/lib/x86_64-linux-gnu
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/home/eleni/igalia/install/share
export LIBGL_DRIVERS_PATH=/home/eleni/igalia/install/lib/x86_64-linux-gnu/dri/
export MESA_DEBUG=1
#intel specific
@hikiko
hikiko / . build_mesa.sh
Last active Mar 25, 2020
a quick script to build mesa (need to modify the meson params for special builds)
View . build_mesa.sh
#!/bin/bash
PS1="[isolated] $PS1"
export VK_ICD_FILENAMES=$HOME/igalia/install/share/vulkan/icd.d/intel_icd.x86_64.json
#export VK_ICD_FILENAMES=$HOME/igalia/install/share/vulkan/icd.d/radeon_icd.x86_64.json
export PATH=$PATH:$HOME/igalia/install/bin
export LD_LIBRARY_PATH=$HOME/igalia/install/lib
export LD_RUN_PATH=$HOME/igalia/install/lib
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$HOME/igalia/install/share
@hikiko
hikiko / palshow.asm
Created Sep 29, 2019
DOS/asm: Showing the default palette
View palshow.asm
bits 16
; DOS loads COM programs at offset 100h (256) of the program segment
; therefore we need to let the assembler know, that everything should
; start from address 100h
org 100h
; video bios (10h) call 00h: set video mode
; ah: 00h, al: video mode number
mov ax, 13h ; mode 13h (320x200 8bpp)
int 10h
@hikiko
hikiko / palset.asm
Created Sep 29, 2019
Asm/DOS: setting custom palette
View palset.asm
; vi:filetype=nasm:
bits 16
; DOS loads COM programs at offset 100h (256) of the program segment
; therefore we need to let the assembler know, that everything should
; start from address 100h
org 100h
; video bios (10h) call 00h: set video mode
; ah: 00h, al: video mode number
mov ax, 13h ; mode 13h (320x200 8bpp)
@hikiko
hikiko / Makefile
Created Sep 29, 2019
Makefile for dosbox asm (nasm)
View Makefile
test.com: test.asm
%.com: %.asm
nasm -o $@ -f bin $<
.PHONY: clean
clean:
rm -f test.com
@hikiko
hikiko / main.rs
Created Sep 15, 2019
my helloworld in Rust (not proud)
View main.rs
extern crate sdl2;
extern crate gl;
extern crate image;
use sdl2::video::GLProfile;
use gl::types::*;
use image::GenericImageView;
static WIN_W : u32 = 800;
static WIN_H : u32 = 800;
@hikiko
hikiko / helloworld.asm
Last active Jul 26, 2019
ASM helloworld (nasm)
View helloworld.asm
;32bit x86 code
[bits 32]
[section .text]
global _start
_start:
;linux specific
;interrupt 80hex for system calls
View nasm Makefile
obj = helloworld.o
bin = helloworld
$(bin): $(obj)
ld -m elf_i386 -o $@ $(obj)
%.o: %.asm
nasm -o $@ -f elf32 $<
.PHONY: clean
You can’t perform that action at this time.