Skip to content

Instantly share code, notes, and snippets.

@mantognini
mantognini / .vimrc
Last active May 9, 2018 05:47
My .vimrc
" .vimrc
" https://gist.github.com/mantognini/7120776
set shell=bash
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@mantognini
mantognini / clang-formater.py
Created October 23, 2013 15:26
VIM python script for clang-format
# FROM http://clang-developers.42468.n3.nabble.com/Slightly-improved-clang-format-vim-integration-td4034463.html
# V4 BY Steffen Prohaska
#
# EDITED by Marco Antognini:
# 2013.10.23 empty range (or rather: one line range) -> full file
#
# CLANG FORMAT STYLE OPTION: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
From 37d455a746983975ae17ee12215dd1f381d6096f Mon Sep 17 00:00:00 2001
From: Marco Antognini <antognini.marco@gmail.com>
Date: Wed, 23 Apr 2014 11:26:44 +0200
Subject: [PATCH] Added OS X impl of requestFocus and hasFocus
---
src/SFML/Window/OSX/SFViewController.mm | 18 ++++++++++++++++++
src/SFML/Window/OSX/SFWindowController.mm | 15 +++++++++++++++
src/SFML/Window/OSX/WindowImplCocoa.hpp | 17 +++++++++++++++++
src/SFML/Window/OSX/WindowImplCocoa.mm | 14 ++++++++++++++
@mantognini
mantognini / crashlog1.txt
Last active August 29, 2015 14:01
soundstream crashing
Thread 1, Queue : com.apple.main-thread
#0 0x00007fff99fe0a3a in __semwait_signal ()
#1 0x00007fff92b1d7f3 in pthread_join ()
#2 0x000000010001814c in sf::priv::ThreadImpl::wait() at /Users/m/Prog/Libraries/C++/SFML/git/SFML/src/SFML/System/Unix/ThreadImpl.cpp:55
#3 0x000000010001719d in sf::Thread::wait() at /Users/m/Prog/Libraries/C++/SFML/git/SFML/src/SFML/System/Thread.cpp:61
#4 0x00000001000ad0f0 in sf::SoundStream::stop() at /Users/m/Prog/Libraries/C++/SFML/git/SFML/src/SFML/Audio/SoundStream.cpp:134
#5 0x000000010009c162 in ~Music at /Users/m/Prog/Libraries/C++/SFML/git/SFML/src/SFML/Audio/Music.cpp:51
#6 0x000000010009c135 in ~Music at /Users/m/Prog/Libraries/C++/SFML/git/SFML/src/SFML/Audio/Music.cpp:49
#7 0x0000000100001815 in main at /Users/m/Prog/Tests/C++/SFML/TestMultithreadMusic/TestMultithreadMusic/main.cpp:18
#8 0x0000000100001744 in start ()
@mantognini
mantognini / main.cpp
Created May 25, 2014 22:44
Test SFML Events
#include <SFML/Graphics.hpp>
#include <map>
#include <deque>
#include <cassert>
#include <iostream>
#ifdef SFML_SYSTEM_MACOS
#include "ResourcePath.hpp"
@mantognini
mantognini / notify_user.diff
Last active August 29, 2015 14:01
Fix OS X request focus
diff --git a/src/SFML/Window/OSX/SFViewController.mm b/src/SFML/Window/OSX/SFViewController.mm
index 56c1b89..ee7f7eb 100644
--- a/src/SFML/Window/OSX/SFViewController.mm
+++ b/src/SFML/Window/OSX/SFViewController.mm
@@ -192,6 +192,9 @@
// The user has to make sure events are forwarded to the view
// with the usual responder chain.
[[m_view window] makeKeyAndOrderFront:nil];
+
+ // In case the app is not active, make it's dock icon bounce for one sec
@mantognini
mantognini / build_deps
Last active December 10, 2018 23:13
Build ogg, vorbis, vorbisfile, vorbisenc, flac and OpenAL frameworks
#!/usr/bin/env fish
##
## build ogg, vorbis, vorbisfile, vorbisenc and flac frameworks
##
rm -fr build_deps
mkdir -p build_deps
cd build_deps
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.xz
@mantognini
mantognini / main.cpp
Last active August 29, 2015 14:09
mixing SFML and SFGUI
#include <SFGUI/SFGUI.hpp>
#include <SFML/Graphics.hpp>
#ifdef SFML_SYSTEM_MACOS
#include "ResourcePath.hpp"
#else
std::string resourcePath(void)
{
return "";
-W#warnings
-Wc++11-long-long
-Wcast-align
-Wconversion
-Wcovered-switch-default
-Wdirect-ivar-access
-Wdisabled-macro-expansion
-Wdocumentation
-Wdocumentation-unknown-command
-Wexit-time-destructors
@mantognini
mantognini / doc_version.diff
Created December 22, 2014 21:20
add SFML version to the doc header
From d1dbe789bc4b3223d33fe9a1d958bfe40d43bb58 Mon Sep 17 00:00:00 2001
From: Marco Antognini <antognini.marco@gmail.com>
Date: Mon, 22 Dec 2014 22:19:38 +0100
Subject: [PATCH] add version in title
---
doc/CMakeLists.txt | 1 +
doc/doxyfile.in | 2 +-
doc/header.html | 18 ------------------
doc/header.html.in | 18 ++++++++++++++++++