This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ShipEntitySystem.h" | |
ShipEntitySystem::ShipEntitySystem(sf::RenderWindow &window) | |
: mRenderWindow(window) | |
{ | |
} | |
ShipEntitySystem::~ShipEntitySystem() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
... | |
#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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <Windows.h> | |
#include <NuiApi.h> | |
int main() { | |
INuiSensor *nuiSensor; | |
HRESULT hr; | |
HANDLE mHandleSkeletonStream; | |
HANDLE mHandleNextSkeletonEvent; | |
int sensorCount = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +furkanzmc is my blockchain ID. https://onename.com/furkanzmc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Date.prototype.getWeekNumber = function() { | |
// Create a copy of this date object | |
var target = new Date(this.valueOf()); | |
// ISO week date weeks start on monday, so correct the day number | |
var dauNumber = (this.getDay() + 6) % 7; | |
// Set the target to the thursday of this week so the | |
// target date is in the right year | |
target.setDate(target.getDate() - dauNumber + 3); | |
// ISO 8601 states that week 1 is the week with january 4th in it |
OlderNewer