This file contains hidden or 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
for v in soa_zip(_names, _surnames) { | |
fmt.println(v._0, " ", v._1) | |
} |
This file contains hidden or 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
#include <stdio.h> | |
#include <assert.h> | |
#include <stdint.h> | |
#include <SDL.h> | |
#include <glad/glad.h> | |
typedef uint32_t u32; | |
static const char* geGlErrStr(GLenum const err) | |
{ |
This file contains hidden or 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
#version 450 | |
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable | |
layout (local_size_x = 128) in; | |
layout(set = 0, binding = 0) uniform Unifs { | |
uniform int64_t start; | |
uniform int64_t n; | |
uniform int64_t N; | |
} unifs; |
This file contains hidden or 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
#include <windows.h> /* must include this before GL/gl.h */ | |
#include <GL/gl.h> /* OpenGL header file */ | |
#include <GL/glu.h> /* OpenGL utilities header file */ | |
#include <stdio.h> | |
#pragma comment (lib, "opengl32.lib") | |
void display() | |
{ | |
/* rotate a triangle around */ |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
typedef uint8_t u8; | |
typedef uint16_t u16; | |
typedef uint32_t u32; | |
typedef uint64_t u64; | |
typedef struct Elf64Header { |
This file contains hidden or 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
SECTION .text | |
global _start ; "global" means that the symbol can be accessed in other modules. In order to refer to a global symbol from another module, you must use the "extern" keyword | |
_start: | |
mov rax, 2 ; syscall: open | |
mov rdi, str_testFile | |
mov rsi, 0 ; flags | |
syscall | |
mov rdi, rax ; the file descriptor |
This file contains hidden or 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
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_ttf.h> | |
const SDL_Color WHITE = { 0xFF, 0xFF, 0xFF, 0 }; | |
int main() | |
{ | |
SDL_Window* window; | |
SDL_Renderer* renderer; | |
SDL_CreateWindowAndRenderer(200, 200, 0, &window, &renderer); |
This file contains hidden or 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
bool rayVsCircle(float& depth, | |
glm::vec2 rayOrig, glm::vec2 rayDir, | |
glm::vec2 circlePos, float circleRad) | |
{ | |
const float R = circleRad; | |
const glm::vec2 op = circlePos - rayOrig; | |
if(dot(op, op) < R*R) { // is rayOrigin inside the circle ? | |
depth = 0; | |
return true; | |
} |
This file contains hidden or 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
#include <glm/glm.hpp> | |
#include <glm/gtc/constants.hpp> | |
constexpr float PI = glm::pi<float>(); | |
using glm::vec3; | |
/*static void generateIcosahedronVerts(vec3 verts[12]) | |
{ | |
using glm::sqrt; | |
using glm::mat2; |
This file contains hidden or 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
const std = @import("std"); | |
const warn = std.debug.warn; | |
const fmt = std.fmt; | |
const c = @cImport({ | |
@cInclude("SDL2/SDL.h"); | |
}); | |
const assert = @import("std").debug.assert; | |
const SDL_WINDOWPOS_UNDEFINED = @bitCast(c_int, c.SDL_WINDOWPOS_UNDEFINED_MASK); |