글

Setting up Cocos2d-x for Android Game Development

이미지
(From : developers circle) As cocos2d-x is ported to C++, now you can develop game for both iOS and Android platform. In the previous tutorial I have discussed on how to setting up cocos2d-x game engine in OSX for iOS game development. Now, in this tutorial I will discuss on Android game development using cocos2d-x. This tutorial asumes that you have a fully functional Android development environment using Eclipse IDE and Android SDK. If you do not, please go through  " Setting up Android Development Environment "  from Android Official Developers Site first, which provides a step by step procedure on setting up a dedicated Android Application Development environment and install various prerequisite softwares. After completing the previous steps you are now all set to follow the described steps later in this tutorials. Develop Android games in cocos2d-x is some how complex comparison to iOS game development. The most complex and trickiest ...

Swap Command and Alt keys on USB keyboard

Swap Command and Alt keys on USB keyboard  Jun 01, '11 07:30:00AM • Contributed by: Anonymous Today I ruined my silver Apple keyboard by spilling coffee on it and had to switch back to an old PC keyboard with a German layout. Which is a fine keyboard with one very annoying attribute: the Control (Windows) and Alt keys are swapped, the bottom keys are from left to right: Ctrl - Windows(Command) - Alt - Space. It can drive you crazy. So I searched for a solution but it was not as obvious as I had expected. With Snow Leopard the mapping can be changed via System Preferences » Keyboard , there choose 'Modifier keys...' and in the Dialog remap Alt (Option) and Command. However, some applications, like Eclipse, do not get these changes. So, I would like to swap the modifiers further down at the input driver level. There are descriptions how to modify AppleUSBKeyboard.kext . That seems to be outdated since I can not find AppleUSBKeyboard.kext on S...

mediacodec

Hello, I'm using android's MediaCodec to render a movie to a texture created in Unity. I do this by attaching the texture from Unity to a framebuffer object and then rendering to it using the texture drawn to by android SurfaceTexture. The movie was rendering fine until I switched to Development build and then switched back to Production. Now, the image from SurfaceTexture only shows up when I use Development build. What changes in terms of OpenGL when I switch to development build? Or am I messing up the gl context somehow? Below is the native code I call every frame where I think has the highest probability of having errors. public void DrawFrame () {   synchronized ( this ) { if ( updateSurface ) { //GLES20.glActiveTexture(GLES20.GL_TEXTURE0); mSurfaceTexture . updateTexImage ();   mSurfaceTexture . getTransformMatrix ( mSTMatrix ); updateSurface = false ; ...

HowTo compile native C codes to a library for iOS development in Xcode

이미지
HowTo compile native C codes to a library for iOS development in Xcode Posted on 2011/10/30 by allen For iOS development, sometimes you want to use a existed native C codes for help. Objective-C is a superset of C so it’s easy to combine C codes in your Objective-C project. But for a library usage, it only support compiling C code to a static library by now. In this tutorial, I take an open source project MQTT message broker Mosquitto as an example to demo how to compile it into a static library in Xcode. Environments * Xcode 4.1 * MacOSX Lion * mosquitto 0.13 Tutorial 1. Download mosquito form < http://mosquitto.org/files/source/mosquitto-0.13.tar.gz >. Here is the whole directory structure: 2. Create a new project by template C/C++ Library * Choose static type 3. Import(or just drap and drop) C codes(include .h and .c) to the project 4. Check the “Build settings” in project * “Base SDK” => Latest iOS * “Architecture...

Creating iOS plugins for Unity

from  ← Introducing Rain’s Hack Upstate    Creating iOS plugins for Unity This is just a quick starter tutorial on making a simple iOS plugin for Unity. In your Unity project, create a folder Assets/Plugin/iOS. Files directly in that folder (can’t be in a subfolder) automatically get added to your iOS project when you have Unity create an iOS build. We’ll create a testplugin.mm file in that folder. In that file, we put the code for the iOS side of the plugin. Unity needs the plugins to be c named. So, we wrap it in an extern “C”. Here is an example plugin:        extern "C" { int _pow2 ( int x ) { // Just a simple example of returning an int value return x * x ; } // Returns a char* (a string to Unity) char * _helloWorldString () { // We can use NSString and go to the c string that Unity wants NSString * helloString = @ "Hello World" ; ...

ffmpeg ios build

이미지
After a couple of days I have made step by step instructions for this install: FFmpeg Build Instructions MAC 10.8 or better Copy ffmpeg-2.0.tar.bz2 ( https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2 , https://ffmpeg.org/download.html ) and Unzip to Documents folder Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components Install gas-preprocessor Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor . Copy gas-preprocessor.pl to /usr/bin directory. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all. Bug in xcrun starting in version 10.8 open terminal and paste in following command and press enter: export DEVELOPER_DIR = "/Applications/Xcode.app/Contents/Developer/" cd to ffmpeg-2 folder and paste in following command and press enter: mkdir armv7 mkdir armv7s mkdir i386 mkdir - p universal / lib To config armv...

When MacBook Pro Retina too hot, on body and keyborad

I have experienced my mac book pro retina is too hot to touch it. The reason is, surely Apple should fix this!, the heat of GPU (GeForce) for retina mode is hot. So, 1. Turn on Energy Saver instead of running screen saver. (Don't run especially high quality screen saver) 2. Use smcFanControl, download http://www.eidac.de/?p=243 When I ran the application first, I saw the temperature of my mac book was 89~90 degree, then the application cools down it to 59~75.