Skip to content

Instantly share code, notes, and snippets.

View yeaFern's full-sized avatar
🏠
Working from home

Fern yeaFern

🏠
Working from home
View GitHub Profile
@yeaFern
yeaFern / Shader.cpp
Created August 7, 2020 15:32
OpenGL Shader Program Caching
#include "graphics/Shader.h"
#include "graphics/ShaderCache.h"
namespace Kigu
{
Shader::Shader(const std::string name, const File& vertex, const File& fragment)
: m_Name(name), m_Program(glCreateProgram())
{
if (!ShaderCache::IsCachingSupported())
{
import React from 'react';
export type InlineCodeProps = {
children: React.ReactNode;
};
export default function InlineCode(props: InlineCodeProps) {
return (
<span className="font-mono bg-gray-300/75 rounded-md px-1">
{props.children}
@yeaFern
yeaFern / main.rs
Last active February 12, 2022 06:01
use polling::{Event, Poller};
use std::io::prelude::*;
use std::net::{Ipv4Addr, SocketAddrV4, TcpListener, TcpStream};
use std::time::Duration;
/// Represents the state of a frame in which the length component is being decoded.
struct LengthState {
/// Current value of the length component.
value: u32,
/// Amount to shift value down when reading new bytes.