Skip to content

Instantly share code, notes, and snippets.

View Furkanzmc's full-sized avatar
🏣
Working from the office

Furkan Üzümcü Furkanzmc

🏣
Working from the office
View GitHub Profile
@Furkanzmc
Furkanzmc / gist:8336889
Created January 9, 2014 16:17
*.pro File for SFML
INCLUDEPATH += D:\SFML2\include
LIBS += D:\SFML2\lib\sfml-system.lib \
D:\SFML2\lib\sfml-window.lib \
D:\SFML2\lib\sfml-graphics.lib \
D:\SFML2\lib\sfml-audio.lib \
D:\SFML2\lib\sfml-network.lib
@Furkanzmc
Furkanzmc / mainKinect.cpp
Last active January 2, 2016 19:49
Go through all Kinects...
#include <iostream>
#include <Windows.h>
#include <NuiApi.h>
int main() {
INuiSensor *nuiSensor;
HRESULT hr;
HANDLE mHandleSkeletonStream;
HANDLE mHandleNextSkeletonEvent;
int sensorCount = 0;
@Furkanzmc
Furkanzmc / SpriteComponent.h
Last active August 29, 2015 13:58
A component definition
#ifndef SPRITECOMPONENT_H
#define SPRITECOMPONENT_H
#include "BaseComponent.h"
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Texture.hpp>
class SpriteComponent : public zmc::BaseComponent, public sf::Sprite
{
public:
SpriteComponent(int componentType)
@Furkanzmc
Furkanzmc / ShipEntitySystem.cpp
Last active August 29, 2015 13:58
An Entity System that inherits BaseEntitySystem
#include "ShipEntitySystem.h"
ShipEntitySystem::ShipEntitySystem(sf::RenderWindow &window)
: mRenderWindow(window)
{
}
ShipEntitySystem::~ShipEntitySystem()
{
@Furkanzmc
Furkanzmc / main.cpp
Last active August 29, 2015 13:58
main.cpp file for the zmcEntitySystem tutorial
#include <iostream>
#include <memory>
#include "EntityManager.h"
#include "Example/ShipEntitySystem.h"
#include "Example/SpriteComponent.h"
#include <SFML/Graphics.hpp>
#include "ComponentManager.h"
using namespace std;
using namespace zmc;
@Furkanzmc
Furkanzmc / OpenBR.sh
Created July 12, 2014 16:07
OpenBR Cmake Command Parameters
C:\Program Files (x86)\CMake\bin\cmake.exe -G "Visual Studio 12 2013" -DCMAKE_PREFIX_PATH="D:/OpenCV/build;C:/Qt/Qt5.3.1/5.3/msvc2013" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release ..
void adjustFontSize(Label *label, const float &desiredSize)
{
std::string str = label->getString();
const float estimatedCharSize = label->getBoundingBox().size.width / label->getStringLength();
const float columnNumberToWrap = desiredSize / estimatedCharSize;
const float numberOfTimesToWrap = label->getBoundingBox().size.width / desiredSize;
for (int i = 1; i < numberOfTimesToWrap; i++) {
const int index = columnNumberToWrap * i;
std::string splitter = std::isspace(str.at(index)) ? "\n" : "-\n";
@Furkanzmc
Furkanzmc / VSyncForCocos2dX.cpp
Last active August 29, 2015 14:17 — forked from daltondotgd/VSyncForCocos2dX.cpp
To enable VSync for WIN32 in cocos2d-x, modify initWithRect(...) function in CCGLView.cpp, so it contains this code right before 'initGlew();'
...
...
...
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// Turn on vertical screen sync under Windows.
// (I.e. it uses the WGL_EXT_swap_control extension)
typedef BOOL(WINAPI *PFNWGLSWAPINTERVALEXTPROC)(int interval);
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
@Furkanzmc
Furkanzmc / FindKinectSDKv2.cmake
Created May 22, 2015 08:43
Cmake file to find Kinect SDK v2 library on Windows
set(KinectSDK2_FOUND OFF CACHE BOOL "Kinect 2.x SDK found")
set(KINECTSDK20_DIR "NOT FOUND" CACHE PATH "Kinect 2.x SDK path")
if(WIN32)
if(EXISTS $ENV{KINECTSDK20_DIR})
message(KINECT_FOUND)
set(KinectSDK2_FOUND ON CACHE BOOL "Kinect 2.x SDK found" FORCE)
set(KinectSDK2_DIR $ENV{KinectSDK2_DIR} CACHE PATH "Kinect 2.x SDK path" FORCE)
if(EXISTS $ENV{KINECTSDK20_DIR}/inc)
set(KinectSDK2_INCLUDE_DIRS $ENV{KINECTSDK20_DIR}/inc)
@Furkanzmc
Furkanzmc / Onename Verification.txt
Created January 8, 2016 07:37
Onename Verification
Verifying that +furkanzmc is my blockchain ID. https://onename.com/furkanzmc