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
#ifdef _MSC_VER | |
#pragma warning(disable : 4503) | |
#endif | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <algorithm> |
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
from collections import defaultdict | |
class Transition: | |
def __init__(self, label, ins, outs): | |
self.label = label | |
self.inputs = frozenset(ins) | |
self.outputs = frozenset(outs) | |
def __repr__(self): |
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
import os | |
import sys | |
def printf(fmt, *args): | |
print(fmt.format(*args), end='') | |
REPOS = [ | |
'https://github.com/eliasdaler/imgui-sfml', | |
'https://github.com/ocornut/imgui', |
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
local io = require'io' | |
local math = require'math' | |
local function push(s, v) s[#s + 1] = v; return v end | |
local function top(s) return s[#s] end | |
local function pop(s) local r = top(s); s[#s] = nil; return r end | |
local function empty(s) return #s == 0 end | |
local function fixtoplist(stack) | |
local oldtop = top(stack) |
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 <SFML/Graphics.hpp> | |
#include <Windows.h> | |
#include <iostream> | |
int main(int argc, char ** argv) | |
{ | |
sf::RenderWindow app(sf::VideoMode(640u, 480u), "DoubleClick"); | |
app.setFramerateLimit(60u); | |
sf::String title; | |
sf::WindowHandle winhandle = app.getSystemHandle(); |
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 <SFML/Graphics.hpp> | |
int main(int argc, char ** argv) | |
{ | |
sf::RenderWindow app(sf::VideoMode(640u, 480u), "DoubleClick"); | |
app.setFramerateLimit(60u); | |
while(app.isOpen()) | |
{ | |
sf::Event eve; | |
while(app.pollEvent(eve)) |
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 <iostream> | |
class Ensurer | |
{ | |
public: | |
void bind(int ptr, bool texturing) | |
{ | |
std::printf("bind(%d, %s)\n", ptr, texturing ? "true" : "false"); | |
if(ptr != m_ptr) |
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 <SFML/Graphics.hpp> | |
static void loadXorTextureInto(sf::Texture& tex) | |
{ | |
sf::Image img; | |
img.create(256u, 256u); | |
for(unsigned x = 0u; x < img.getSize().x; ++x) | |
for(unsigned y = 0u; y < img.getSize().y; ++y) | |
img.setPixel(x, y, sf::Color(x ^ y, x ^ y, x ^ y)); |
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 <SFML/Graphics.hpp> | |
#include <cstdio> | |
static void loadXorTextureInto(sf::Image& img) | |
{ | |
img.create(256u, 256u); | |
for(unsigned x = 0u; x < img.getSize().x; ++x) | |
for(unsigned y = 0u; y < img.getSize().y; ++y) | |
img.setPixel(x, y, sf::Color(x ^ y, x ^ y, x ^ y)); | |
} |
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 <SFML/Window.hpp> | |
#include <iostream> | |
#include <Windows.h> | |
LONG_PTR originalsfmlcallback = 0x0; | |
LRESULT CALLBACK mycallback(HWND handle, UINT message, WPARAM wParam, LPARAM lParam) | |
{ | |
if(message == WM_DROPFILES) | |
{ |