겨울팥죽 여름빙수
Google Iap Server Verification Error

1.Exceptions google api accessNotConfigured 403error The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console. { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured" } ], "code": 403, "message": "Access Not Configured" }} 2. Solutions Google Developer Console "Google Developer Console"..

c++ string tokenizer
게임을 만들자/C++ 2015. 1. 9. 22:08

1. ImplementThis code use string class instead of strtok included in . void StringTokenize(const string& str, vector& tokens, const string& delimiters) { // Skip delimiters at beginning. string::size_type lastPos = str.find_first_not_of(delimiters, 0); // Find first "non-delimiter". string::size_type pos = str.find_first_of(delimiters, lastPos); while (string::npos != pos || string::npos != last..

article thumbnail
cJSON parsing error using window utf-8 txt file, Remove UTF-8 BOM
게임을 만들자/C++ 2015. 1. 8. 12:28

Sometime we get error from cJSON. Window utf-8 txt file attach big-endian information [EF BB BF]. It cause error when we parse json or use setcookie in PHP. I removed this information using Notepad++.Download Link : http://notepad-plus-plus.org/ 1. Save txt file to UTF-8 File->Save to other -> Set encoding to UTF-8 2. Using Notepad ++ Open txt file in Notepad++. Select UTF-8 without BOM

Android ndk, unicode to utf-8 or utf-8 to unicode

1. utf-8 to unicode I referenced below site http://en.wikipedia.org/wiki/UTF-8 wstring Utf8ToUnicode(const string& source_str) { int dest_len = 0; int source_len = source_str.length(); const char* source = source_str.c_str(); wchar_t* dest = new wchar_t[source_len]; wstring value; for (int i = 0; i

article thumbnail
c++ Easing code
게임을 만들자/C++ 2014. 10. 16. 01:44

1. Easing Code Many games and App use Easing Algorithm like scrolling, character moving, etc. Blow show c++ code of Easing Algorithm. start_value : 0 frame's value.change_value : End frame's value - start_value inline float easeLinear(float current_frame, float start_value, float end_frame, float change_value) { return change_value*current_frame/end_frame + start_value; } inline float easeQuadra..

Java, Number Regular-Expression
게임을 만들자/Java 2014. 9. 27. 00:06

1. Overview In Java, [tryParse] is not supported like c#. When String text is not number, Integer.parseInt() or Float.parseFloat() don't return false but throw exception. So developer have to make this function. One way is using Regular-Expression. 2. Code Below code show Regular-Expression of getting number from String. String text = text_field.getText(); Pattern p = Pattern.compile("-?([\\d]+)..

article thumbnail
Android, NDK Log using __android_log

1. android/log.h In ndk library provide log functions that can be seen in LogCat. First you have to include . #include You can use two functions [__android_log_write] and [__android_log_vprint]. If you want to write log like printf, Use [__android_log_vprint]. It support parameters like %d, %f, %s.etc else [__android_log_write] only send a message. Below show example using [__android_log_write] ..

article thumbnail
Android, Draw text using system font OpenGLES 2.0

1. Typeface you can get typeface info by [Typeface.createFromAsset] method. You don't call this method every frame. Because it happen memory leak problem, so I recommend to use Map class to Manage font data. Below show code using Typeface.createFromAsset. Hashtable m_font_type_face = new Hashtable(); private ResourceManager() { m_font_type_face.put("CORBEL.TTF", Typeface.createFromAsset(MainActi..

article thumbnail
Android, NDK OpenGLES2.0 Texture

1. Load texture I used Android BitmapFactory to decode PNG texture. If you want one source multi flatform, Use libpng. This writing show example BitmapFactory decoding. First we have to load image. Theretofore we have to decide resource foloder. A. res/raw Many developer use assets foloder to manage resource, but I decide resource folder res/raw because res folder managed to R.java, there could ..

article thumbnail
OpenGLES2.0 GLSL, 2D Basic shader

1. Outline Recently, many developer use OpenGLES 2.0 to make a 2d graphics game. But it have little difficult because of OpenGLES1.0 & OpenglES 2.0 graphic-pipeline difference. Especially, when we meet GLSL shader first-time, it give little fear of programming. Follow writing show shader for someone who want to make 2d graphic game or app. 2. Vertex Shader vertex shader handle each vertex infos ..