This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
char *map = | |
"xxxxxx000xxxxxx" | |
"xxxxxx0r0xxxxxx" | |
"xxxxxx0r0xxxxxx" | |
"xxxxxx0r0xxxxxx" | |
"xxxxxx0r0xxxxxx" | |
"xxxxxx0r0xxxxxx" |
This file contains hidden or 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
#define CROSS_Z(a, b) ((a.x*b.y) - (a.y*b.x)) | |
bool LinesIntersect(GLKVector2 p, GLKVector2 p_plus_r, GLKVector2 q, GLKVector2 q_plus_s) { | |
/* Calculate q - p */ | |
GLKVector2 q_p = { | |
q.x - p.x, | |
q.y - p.y | |
}; | |
/* Calculate r */ |
This file contains hidden or 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
// | |
// DebugHelper.h | |
// HideousGameEngine | |
// | |
// Created by Sid on 06/06/13. | |
// Copyright (c) 2013 whackylabs. All rights reserved. | |
// | |
#ifndef __HideousGameEngine__DebugHelper__ | |
#define __HideousGameEngine__DebugHelper__ |
This file contains hidden or 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
// | |
// main.m | |
// OGL_Basic | |
// | |
// Created by Sid on 21/08/13. | |
// Copyright (c) 2013 whackylabs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
#import <QuartzCore/QuartzCore.h> |
This file contains hidden or 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<fstream> | |
using namespace std; | |
struct test | |
{ | |
short sss; | |
char ccc; | |
int iii; |
This file contains hidden or 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
// unique_ptr | |
// Case 1: Array of type | |
// Case 2: Array of pointer to type | |
#include <iostream> | |
#include <memory> | |
class Bar { | |
public: | |
Bar(float b) : bb(b) { |
This file contains hidden or 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
// Thank you std::unique_ptr! | |
// Compile with | |
// clang++ unique_ptr.cpp -o unique_ptr -std=c++11 -stdlib=libc++ && ./unique_ptr | |
/* OUTPUT: | |
--- START --- | |
Game | |
--- MAIN --- | |
Screen | |
MainScreen |
This file contains hidden or 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
<html> | |
<head> | |
<title>Texture Coordinates</title> | |
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
<script type="text/javascript" src="glMatrix-0.9.5.min.js"></script> | |
<script type="text/javascript" src="webgl-utils.js"></script> | |
<script id="shader-fs" type="x-shader/x-fragment"> |
This file contains hidden or 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
// | |
// EventLoop.h | |
// HideousGameEngine | |
// | |
// Created by Sid on 27/03/13. | |
// Copyright (c) 2013 whackylabs. All rights reserved. | |
// | |
#ifndef __HideousGameEngine__EventLoop__ | |
#define __HideousGameEngine__EventLoop__ |
This file contains hidden or 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
// Using std::function for callback | |
#include <iostream> | |
#include <utility> | |
class Client; | |
// Calculator server | |
class Server{ | |
public: | |
typedef void (Client::*CB)(int result); |