Skip to content

Instantly share code, notes, and snippets.

View MarioLiebisch's full-sized avatar

Mario Liebisch MarioLiebisch

View GitHub Profile
@MarioLiebisch
MarioLiebisch / outline.cpp
Created December 22, 2014 16:09
SFML Wall Drawing Example
#include <SFML/Graphics.hpp>
#include <vector>
struct wall {
float x1, y1, x2, y2;
wall(float x1, float y1, float x2, float y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};
@MarioLiebisch
MarioLiebisch / CMakeLists.txt
Last active August 20, 2018 08:46
A minimal CMakeLists.txt file for a SFML project
cmake_minimum_required(VERSION 3.10)
project(my_sfml_project)
# Find SFML and the given components
find_package(SFML 2.5 COMPONENTS graphics window system)
# Add the SFML include dir
include_directories(${SFML_INCLUDE_DIR})
@MarioLiebisch
MarioLiebisch / Win32 Clipboard access
Created September 3, 2014 14:55
Snippet from a custom SFML extension for direct clipboard access.
////////////////////////////////////////////////////////////
ClipboardImpl& ClipboardImpl::operator >> (sf::String& data)
{
data = "";
if (!OpenClipboard(NULL))
return *this;
if (IsClipboardFormatAvailable(CF_UNICODETEXT))
{