Skip to content

Instantly share code, notes, and snippets.

@ithmz
ithmz / yuv.cpp
Last active October 30, 2023 03:10
Upload YUV texture to OpenGL
// Get texture location in fragment shader
GLint locTexY = glGetUniformLocation(program, "textureY");
GLint locTexVU = glGetUniformLocation(program, "textureVU");
// Upload YUV data to texture buffer
GLuint textureID[2];
glGenTextures(1, &textureID[0]);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureID[0]);
@djfdyuruiry
djfdyuruiry / README.md
Last active October 8, 2024 04:54
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@joycemaferko
joycemaferko / condclockwait.c
Last active July 11, 2022 12:09
pthread_cond_clockwait implementation
/**
* @file
*
* @ingroup POSIXAPI
*
* @brief Waiting on a Condition
*/
/*
* Copyright (C) 2021 Matthew Joyce