Skip to content

Instantly share code, notes, and snippets.

@Foaly
Foaly / spacing.cpp
Created January 1, 2016 20:07
Character and line spacing
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "Character Spacing Example");
window.setFramerateLimit(60);
// load font
sf::Font font;
#define _USE_MATH_DEFINES
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <iterator>
#include <algorithm>
@Foaly
Foaly / patch.diff
Created September 17, 2015 18:16
Started Linux implementation
diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt
index 3fc7586..a43350b 100644
--- a/src/SFML/Window/CMakeLists.txt
+++ b/src/SFML/Window/CMakeLists.txt
@@ -81,9 +81,9 @@ elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
${SRCROOT}/Unix/InputImpl.hpp
${SRCROOT}/Unix/ScopedXcbPtr.hpp
${SRCROOT}/Unix/ScopedXcbPtr.inl
+ ${SRCROOT}/Unix/ScreenImpl.cpp
${SRCROOT}/Unix/SensorImpl.cpp
@Foaly
Foaly / ofxNetworkMacros.diff
Created February 25, 2015 13:00
Fixes the erros in ofxNetwork when compiling.
diff --git a/addons/ofxNetwork/src/ofxNetworkUtils.h b/addons/ofxNetwork/src/ofxNetworkUtils.h
index 6244f6b..33aed35 100644
--- a/addons/ofxNetwork/src/ofxNetworkUtils.h
+++ b/addons/ofxNetwork/src/ofxNetworkUtils.h
@@ -83,13 +83,13 @@ inline int ofxNetworkCheckErrno(const string & file, const string & line){
case OFXNETWORK_ERROR(INPROGRESS):
ofLogWarning("ofxNetwork") << file << ": " << line << " EINPROGRESS: the socket is non-blocking and the connection could not be established immediately";
break;
- case EALREADY:
+ case OFXNETWORK_ERROR(ALREADY):
@Foaly
Foaly / compilationFix
Last active August 29, 2015 14:15
Diff for ofxSimpleGuiToo
diff --git a/src/Controls/ofxSimpleGuiButton.cpp b/src/Controls/ofxSimpleGuiButton.cpp
index cc3e137..23050e9 100644
--- a/src/Controls/ofxSimpleGuiButton.cpp
+++ b/src/Controls/ofxSimpleGuiButton.cpp
@@ -58,7 +58,7 @@ void ofxSimpleGuiButton::onRelease(int x, int y, int button) {
}
void ofxSimpleGuiButton::draw(float x, float y) {
- setPos(x, y);
+ setPosition(x, y);