Press "Enter" to skip to content

Chris Mills Posts

New Game Conference 2011

Last week I was fortunate enough to be able to go to the New Game Conference in San Francisco despite being extremely busy at work and simply put, it was awesome. As expected there were a lot of web developers, but there were more console / pc game developers than I had anticipated. I have to give a huge thanks to +Seth Ladd and +Darius Kazemi for putting together such an amazing event and to all the presenters, there really wasn’t a single talk I didn’t get something out of. If you’re looking for slides, code and talk specific write…

River Trail and Web Workers

A few weeks ago I wrote a post comparing different implementations of a frustum culling algorithm between Chrome and Firefox. The purpose of that post was to investigate the differences between the two browsers with respect to how the code was laid out. In that post I mention that the next step was to compare River Trail with Web Workers. The starting point for this will be the code from the divergentcoder.com post on River Trail. To make sure it’s an even test, I’ve included output for Web Workers, River Trail, and sequential JavaScript. The sphere count has been increased…

JavaScript Frustum View Culling Performance

At work the other day a buddy (+Chris Lentini) wrote a simple little JavaScript frustum culling program, checking 16384 spheres. On an aside, check out his very cool River Trail post based on this same starting code. Also I’d like to point out that this code was not meant to be elegant, or for high performance, just to get a basic idea for something he was working. Even with that, what peaked my interest though was the difference in timing between Chrome v13 and Firefox 6.0.2. My first guess was that the function calling was killing it and taking most of…

UIView Drop Shadow with Rounded Corners

Looking up a completely separate problem, I was running across a considerable amount of people asking how to apply a drop shadow to a UIView or how to round the corners. I previously did a post on something similar, but I wanted to take the time and build a small demo that shows how to accomplish both these things in a very easy way. Essentially we’re going to use the CALayer in the UIView to do all the work for us and not even bother with renderInContext:UIGraphicsGetCurrentContext(). Suppose we have a view we want to round and apply a drop shadow to…

Making a PDF from a UIWebView

Update – If Brent Nycum made a great little helper class to make printing PDFs from WebViews easy. Check it out over on GitHub While working on a project I needed a way to generate a pdf from some in app html to a for emailing and printing purposes. This seemed like a rather easy task, however the pdf generated was always empty. After digging around the web I kept coming back to this post on StackOverflow. A bit more searching I came across this great post by Brent Nycum which became my starting point. As Brent points out, this…

Basic Delegate Example

There are two things that I have recently grown to love when it comes to writing iOS code and those are Protocols and Delegates. If you written anything with a UITableView in it , then you’ve used Protocols before. For instance, cellForRowAtIndexPath is in fact a method that is defined in the UITableViewDataSource protocol. You’ve been using protocols this whole time and didn’t even know it, or maybe you did. So how do you make your own Protocol and Delegates? It’s actually fairly boilerplate and super simple. Here is a simple example. Definition [sourcecode language=”objc”] #import <Foundation/Foundation.h> @protocol MyClassDelegate <NSObject>…

Goodbye Tumblr

It’s finally happened, I’ve left Tumblr. In the past few months I’ve left SquareSpace and now Tumblr for WordPress. I think each of these services fill a niche that really helps everyone find the service that’s right for them. I see them working like this, Tumblr: Small quick posts, almost like Twitter but with no character limit. More about sharing than blogging. WordPress (no custom server): Fantastic blogging engine. Though you can have multiple pages, I feel without your own server it’s more geared towards just blogging, not having a full site. If you want to blog with some pretty…

UIGraphicsGetCurrentContext() Performance

In an app I’m currently working on I had two choices, either make 135 small thumbnail images or I auto-generate them by flattening the UIView into a single UIImage then use that as the background the UIButton. Having never done this, I figured it would be a great chance to learn. I’m not even going to consider making it a UILabel (title), UIImageView (icon), UIImageView (shadow), UIButton (actual hidden button) as scrolling through the 135 buttons would be unbearable. My first attempt was very naive and rather brute force-ish since I was doing this for each of the 135 buttons. Also…