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
REM AST generation from MSVC | |
cl /analyze /d1Aprintast %1 > %1.ast |
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
constexpr bool constexpr_strequal(const char * a, const char * b) | |
{ | |
// Assume that NULL != NULL | |
if (!a || !b) { | |
return false; | |
} | |
// If pointers are equal, values are equal | |
if (a == b) { | |
return true; |
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
#include <QtWidgets> | |
static uchar pixel_buffer[512 * 512 * 4]; | |
class MyWidget : public QWidget { | |
Q_OBJECT | |
private: | |
QImage * _image = nullptr; |
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
// | |
// Compile with: em++ test-threads.cpp -o test-threads.html -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=2 -s USE_SDL=2 | |
// | |
// Expected behavior: program starts with a black screen, smoothly fades it to | |
// green, then resets (show black screen, fades-in green, rinse and repeat). | |
// | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <pthread.h> |
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
/* | |
A proposal to reduce io2d's namespace, by combining 'basic_FOO' and 'FOO' typenames, to 'FOO' | |
Author: David Ludwig <[email protected]> | |
Version: 1 | |
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
include(vcpkg_common_functions) | |
vcpkg_from_github( | |
OUT_SOURCE_PATH SOURCE_PATH | |
REPO cpp-io2d/P0267_RefImpl | |
REF 51fb21aaf4d2d4ef96d6e13ce3a2880a024a3058 | |
SHA512 6080e7ebd6de186801ab9ca5da01c4ed08c5b58de611e8f8323d449794a91a30897a746761f86de7f0f2786eac46bbcb69afd0d542736be1e9c5385853636ba7 | |
HEAD_REF master | |
) | |
file(INSTALL ${SOURCE_PATH}/P0267_RefImpl/P0267_RefImpl DESTINATION ${CURRENT_PACKAGES_DIR}/include) |
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
#include <io2d.h> | |
#include <mutex> | |
using namespace std; | |
using namespace std::experimental; | |
using namespace std::experimental::io2d; | |
static output_surface & display() { | |
static auto surface = output_surface{500, 500, format::argb32, scaling::none, refresh_style::fixed, 30.f}; | |
return surface; |
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
// | |
// ShowBitmap_Mac68k.cpp | |
// by David Ludwig <[email protected]> | |
// | |
// Shows a 1-bit, XBM bitmap on an emulated (via pce-macplus) 4 MB Mac Plus. | |
// | |
// Compiled with g++ flags: | |
// -Os -o romtest.o -fno-builtin -m68000 -nostdlib -mpcrel -Xlinker --oformat=binary |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "fedora/26-cloud-base" | |
config.vm.box_version = "20170705" | |
config.vm.provider "virtualbox" do |vb| | |
# Display the VirtualBox GUI when booting the machine | |
vb.gui = true |
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
void DrawTestPattern_OpenGL1(float w, float h) | |
{ | |
glCullFace(GL_FRONT_AND_BACK); | |
glBegin(GL_TRIANGLES); | |
glColor3f(1, 0, 0); // top-left | |
glVertex2f(-w, h); // triangle 1 | |
glVertex2f(-w, 0); | |
glVertex2f( 0, 0); | |
glVertex2f( 0, 0); // triangle 2 | |
glVertex2f( 0, h); |
NewerOlder