Skip to content

Instantly share code, notes, and snippets.

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 / 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 ++++++++++++++++++
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include "ResourcePath.hpp"
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include "ResourcePath.hpp"
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
namespace sf {
namespace priv { void ensureExtensionsInit(); }
}