This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.com: test.asm | |
%.com: %.asm | |
nasm -o $@ -f bin $< | |
.PHONY: clean | |
clean: | |
rm -f test.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;32bit x86 code | |
[bits 32] | |
[section .text] | |
global _start | |
_start: | |
;linux specific | |
;interrupt 80hex for system calls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj = helloworld.o | |
bin = helloworld | |
$(bin): $(obj) | |
ld -m elf_i386 -o $@ $(obj) | |
%.o: %.asm | |
nasm -o $@ -f elf32 $< | |
.PHONY: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[require] | |
fbsize 800 600 | |
[vertex shader passthrough] | |
[fragment shader] | |
#version 450 | |
float checkerboard(in vec2 uv) | |
{ | |
vec2 pos = floor(uv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[require] | |
fbsize 800 600 | |
[vertex shader passthrough] | |
[fragment shader] | |
#version 450 | |
layout(location = 0) out vec4 out_color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[require] | |
fbsize 800 600 | |
[vertex shader passthrough] | |
[fragment shader] | |
#version 450 | |
layout(location = 0) out vec4 out_color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[require] | |
vulkan 1.1.3 | |
fbsize 800 600 | |
[vertex shader passthrough] | |
[fragment shader] | |
#version 450 | |
#define T 0.001 //threshold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[require] | |
vulkan 1.1.3 | |
[vertex shader passthrough] | |
[fragment shader] | |
#version 430 | |
layout(location = 0) out vec4 out_color; |