Initial Landscape orientation issue on iOS solved

I have searched for a solution how to implement a ViewController that supports only LandscaleLeft and LandscapeRight mode. Most solutions I found on stackoverflow and other forums using a setOrientationMode selector on the device object: NSNumber *value = [NSNumber numberWithInt: UIInterfaceOrientationLandscapeLeft]; [[UIDevice currentDevice] setValue:value forKey:@”orientation”]; this could probably work for you, but it uses a non official selector. You may think of this: it is impossible for the program to actually physically turn around your device, but that is what Continue reading Initial Landscape orientation issue on iOS solved

Objective-C Memory Management

Every object that is derived from NSObject has the ability to be managed by retain counting. When an object is created (alloc) the system will allocate memory for the object and set a retain count to 1. The count can be incremented when a new instance of this object exist (assignment for example) and decrement when an object instance is released. Once the retain count is going to zero the object will be destructed and the memory gets freed. This post is Continue reading Objective-C Memory Management

Disconnect SVN repository

If you want to “disconnect” your SVN repository from your current project you could use the export function of svn: cd /path/to/your/project svn export But this will just export the repository. All uncommitted changes will be lost. The other (in my opinion better) way is just to delete all SVN folders. if you are unsure what this script is really doing you could check via “echo” cd /path/to/your/project find . -name .svn | while read; do echo rm -Rf “$REPLY”; Continue reading Disconnect SVN repository

Fast realtime shadows in Unity

Unity comes with built-in shadow map support, but you shouldn”t expect cutting edge technology. No soft shadows on mobile devices and at least for my current project it is too slow on the GPU. Unfortunately Unity 4.x does not provide many other solutions for realtime shadows. However there is hope that there will be improvements for shadows in Unity 5, but you can’t develop a game on hope can you? I decided to have a fallback solution that is fast Continue reading Fast realtime shadows in Unity

Lua Enum

When start scripting with Lua one may notice that its functional range is some what reduced to a tiny set of essential basics. One thing I was missing at least is an enum type. But we could implement something very close. Before we start I want to recommend the online demo at lua.org. Just paste your lua code into the lua-shell window and press “run” to see if it works. A very simple enum function could be something like this: Continue reading Lua Enum

Adreno 320 GPU GLSL shader issues on Android

It seems that they didn’t spend much time in coding the graphic card drivers for Andreno 320 GPU. In my latest project I encountered a crash on linking some GLSL shader programs. It really took a while to figure out the cause. After a while could break down the shader code to something that looks like: struct _Diffuse_Type { lowp vec4 Color; sampler2D Texture; }; uniform _Diffuse_Type Diffuse; varying vec4 v_vtxColor; varying vec2 v_texcoord0; #ifdef VERTEX uniform mat4 u_modelViewProjection; attribute Continue reading Adreno 320 GPU GLSL shader issues on Android