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
Last summer Apple introduced Metal, a new 3D graphics API for iOS devices featuring faster, more detailed access to the graphics hardware. In this session we will introduce programmers to the Metal API. We will start with a high level overview of Metal and how it compares to OpenGL, comparing the two and seeing what the cost is for the extra graphics speed. We will look at using Metal for GPU based computation, using the Metal Shading Language for rendering, and how to combine them for intense GPU powered apps. |
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
-(void)initOffscreenContext | |
{ | |
CGSize layerSize = [self bounds].size; | |
layerSize.height = floorf(layerSize.height); | |
layerSize.width = floorf(layerSize.width); | |
if (layerSize.height <= 0 || layerSize.width <=0) | |
{ | |
self.offscreenContext = nil; | |
return; |
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
#!/usr/bin/env python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
#pragma mark - iCloud | |
- (BOOL)hasiCloud | |
{ | |
BOOL hasiCloud = ([self ubiquitousDocumentsURL] != nil); | |
return hasiCloud; | |
} | |
- (void)setUseiCloud:(BOOL)value | |
{ |
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
GLfloat boxVerts[] = { | |
// left side | |
-1.0, -1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, 1.0, 1.0, | |
// right side |
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
for (BNRNerd *nerd in self.nerds) { | |
[self.geocodeQueue addOperationWithBlock:^{ | |
NSOperationQueue *managingQueue = [NSOperationQueue currentQueue]; | |
[geocoder geocodeAddressString:nerd.locationStr completionHandler:^(NSArray *placemarks, NSError *error) { | |
CLPlacemark *placemark = placemarks[0]; | |
nerd.location = placemark.location; | |
[self fetchWeatherForNerd:nerd]; | |
[managingQueue setSuspended:NO]; | |
}]; | |
[managingQueue setSuspended:YES]; |
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 RANGE (700.0f) | |
// RANGE is the range of values that are OK | |
#define B_MARGIN (10.0f) | |
// B_MARGIN is the bottom margin in points | |
#define T_MARGIN (10.0f) | |
// T_MARGIN is the top margin in points | |
#define H_GAP (10.4f) |
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
GLuint cubeTriIndicesBottomTop[] = { | |
// Bottom | |
0, 1, 2, 0, 2, 3, | |
// Top | |
4, 5, 6, 4, 6, 7, | |
}; | |
GLuint cubeTriIndicesFrontBack[] = { | |
// Front | |
0, 4, 1, 4, 1, 5, |
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
GLfloat vertices[] = { | |
// left side | |
-1.0, -1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, 1.0, 1.0, | |
// right side | |
1.0, -1.0, -1.0, |
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
// | |
// BNRPerson.h | |
// SalesReport | |
// | |
// Created by Jonathan Blocksom on 4/1/13. | |
// Copyright (c) 2013 Jonathan Blocksom. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
NewerOlder