Skip to content

Instantly share code, notes, and snippets.

Mārtiņš Možeiko mmozeiko

  • San Jose, CA
Block or report user

Report or block mmozeiko

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
@mmozeiko
mmozeiko / raspbian_buster.txt
Last active Jul 20, 2019
OpenGL info on Raspberry Pi 4
View raspbian_buster.txt
EGL_VENDOR = Mesa Project
EGL_VERSION = 1.4
EGL_CLIENT_APIS = OpenGL OpenGL_ES
EGL_EXTENSIONS = EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export
// GLES API
GL_VENDOR = Broadcom
GL_RENDERER = V3D 4.2
GL_VERSION = OpenGL ES 3.0 Mesa 19.1.2
@mmozeiko
mmozeiko / win32_handmade.cpp
Created Dec 13, 2014
win32_handmade.cpp with WASAPI from Day 19
View win32_handmade.cpp
/* ========================================================================
$File: $
$Date: $
$Revision: $
$Creator: Casey Muratori $
$Notice: (C) Copyright 2014 by Molly Rocket, Inc. All Rights Reserved. $
======================================================================== */
/*
TODO(casey): THIS IS NOT A FINAL PLATFORM LAYER!!!
@mmozeiko
mmozeiko / win32_crt_float.cpp
Last active Jun 30, 2019
Visual C/C++ CRT functionality
View win32_crt_float.cpp
extern "C"
{
int _fltused;
#ifdef _M_IX86 // following functions are needed only for 32-bit architecture
__declspec(naked) void _ftol2()
{
__asm
{
@mmozeiko
mmozeiko / test.c
Last active Jun 25, 2019
SetForegroundWindow
View test.c
#include <windows.h>
#include <stdio.h>
LRESULT CALLBACK WindowProc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if (msg == WM_TIMER)
{
printf("press SPACE now\n");
DWORD tid = GetWindowThreadProcessId(wnd, NULL);
@mmozeiko
mmozeiko / sort.cpp
Last active Jun 16, 2019
radix sort benchmark, compile with C++11
View sort.cpp
#include <stdint.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <chrono>
typedef int32_t s32;
typedef uint32_t u32;
typedef float r32;
@mmozeiko
mmozeiko / incbin.c
Last active Jun 7, 2019
Include binary file with gcc
View incbin.c
#include <stdio.h>
#define STR2(x) #x
#define STR(x) STR2(x)
#define INCBIN(name, file) \
__asm__(".section .rodata\n" \
".global incbin_" STR(name) "_start\n" \
".type incbin_" STR(name) "_start, @object\n" \
".balign 16\n" \
@mmozeiko
mmozeiko / test.c
Last active Jun 4, 2019
switch vs computed goto
View test.c
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#define HALT 0
#define LOAD 1
#define INC 2
#define DEC 3
#define ADD_7 4
#define SUB_7 5
@mmozeiko
mmozeiko / crt.cpp
Created Jan 16, 2017
MSVC CRT startup
View crt.cpp
#include <windows.h>
extern "C"
{
#pragma section(".CRT$XIA",long,read)
#pragma section(".CRT$XIZ",long,read)
#pragma section(".CRT$XCA",long,read)
#pragma section(".CRT$XCZ",long,read)
#pragma section(".CRT$XPA",long,read)
#pragma section(".CRT$XPZ",long,read)
@mmozeiko
mmozeiko / test.cpp
Created Aug 2, 2015
Testing performance
View test.cpp
#include <stdint.h>
#include <stdio.h>
#if _WIN32
#include <intrin.h>
#elif ANDROID
#include <unistd.h>
You can’t perform that action at this time.