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
- (UIImage*) takePicture { | |
int s = 1; | |
UIScreen* screen = [UIScreen mainScreen]; | |
if ([screen respondsToSelector:@selector(scale)]) { | |
s = (int) [screen scale]; | |
} | |
GLint viewport[4]; | |
glGetIntegerv(GL_VIEWPORT, viewport); |
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
/* | |
* cocos2d for iPhone: http://www.cocos2d-iphone.org | |
* | |
* Copyright (c) 2010 Ricardo Quesada | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
/* | |
===== IMPORTANT ===== | |
This is sample code demonstrating API, technology or techniques in development. | |
Although this sample code has been reviewed for technical accuracy, it is not | |
final. Apple is supplying this information to help you plan for the adoption of | |
the technologies and programming interfaces described herein. This information | |
is subject to change, and software implemented based on this sample code should | |
be tested with final operating system software and final documentation. Newer |
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
Framebuffer | |
Multisampled colour render buffer attached to a texture | |
Multisampled depth buffer | |
But you cannot do this. D: You have to have the following: | |
Multisampled framebuffer: |
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
#!/bin/bash | |
VERSION_NUMBER="1.0 beta" | |
VERSION="$0 version ${VERSION_NUMBER} | |
Original name: make_dmg.sh | |
Author: Valentine Silvansky <[email protected]>" | |
LICENSE="This software is distibuted under GNU GPLv3 license. | |
Visit http://www.gnu.org/licenses/gpl-3.0.txt for more information." |
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
lowp float RGBToL(lowp vec3 color) | |
{ | |
lowp float fmin = min(min(color.r, color.g), color.b); //Min. value of RGB | |
lowp float fmax = max(max(color.r, color.g), color.b); //Max. value of RGB | |
return (fmax + fmin) / 2.0; // Luminance | |
} | |
lowp vec3 RGBToHSL(lowp vec3 color) | |
{ |
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 renderSphere(float cx, float cy, float cz, float r, int p) | |
{ | |
float theta1 = 0.0, theta2 = 0.0, theta3 = 0.0; | |
float ex = 0.0f, ey = 0.0f, ez = 0.0f; | |
float px = 0.0f, py = 0.0f, pz = 0.0f; | |
GLfloat vertices[p*6+6], normals[p*6+6], texCoords[p*4+4]; | |
if( r < 0 ) | |
r = -r; | |
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
/*/../bin/ls > /dev/null | |
COMPILED=${0%.*} | |
clang $0 -o $COMPILED -framework Foundation; | |
$COMPILED; rm $COMPILED; exit; | |
*/ | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) |
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
/*/../bin/ls > /dev/null | |
COMPILED=${0%.*} | |
clang $0 -o $COMPILED -framework Foundation; | |
$COMPILED; rm $COMPILED; exit; | |
*/ | |
#import <Foundation/Foundation.h> | |
@class CNSObject; |
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
typedef struct FontHeader { | |
int32_t fVersion; | |
uint16_t fNumTables; | |
uint16_t fSearchRange; | |
uint16_t fEntrySelector; | |
uint16_t fRangeShift; | |
}FontHeader; | |
typedef struct TableEntry { | |
uint32_t fTag; |
OlderNewer