Posts Tagged ‘Code Snippet’

Posts that have small parts from a bigger code.

OpenGL: Configuring GLFW and GLEW in Visual C++ Express

Click here to read OpenGL: Configuring GLFW and GLEW in Visual C++ Express

This post shows how to configure Visual C++ Express 2010 with GLFW (version 3.0.1) and GLEW (version 1.9.0)[1].

There are many tutorials on the internet that explains how to configure Visual C++ Express with those exact same libraries[2]. However, this one focus on how to proceed with this setup while avoiding copying any of the header and library files to the Visual C++ Express installation folders, system folders or the Windows SDK folder.

To put it into a summarized manner, all you have to do is to download and install the Visual C++ Express; download and extract the GLFW and GLEW binaries; create a project; configure the project so it can locate the GLFW and GLEW header and lib files; and initialize and use both libraries in your application.

Therefore, this tutorial is divided into 8 parts: (more…)

Unity: GUI Toggle Pair

Click here to read Unity: GUI Toggle Pair

This new (and brief) Unity programming post explains how to create a pair of GUI.Toggles that modifies the value of a single boolean. This means that, when one toggle is selected, the other one should be automatically set to unselected. This is best explained with an example, which can downloaded at the end of the post.

(more…)

Unity: animated ellipsis

Click here to read Unity: animated ellipsis

We have all seen it on loading screens of a variety of games and applications. I’m talking about animated ellipses, the animated three dots () on the end of a sentence which indicates that the game or software is being loaded.

This post explains how to make exactly that, an animated ellipsis in Unity. Here’s a video showing what the script on this post will do:

(more…)

Android: hexadecimal color input using an EditText

Click here to read Android: hexadecimal color input using an EditText

This Android programming tutorial shows how to create a simple application that takes the value of a hexadecimal color at an EditText field and displays it as an ImageView. In order to do so, this post goes into detail on how to correctly parse the EditText String as 32 bit hexadecimal Integer. Additionally, it explains the part of the code that constrains the characters between A to F and 0 to 9 at the EditText. Finally, it tries to solve some of the EditText problems when applying these constrains.

The application in this post has been tested on Android 2.1, 2.3 and 4.0.

So, here’s a screenshot of the example project application in action:

Hexadecimal Color Input

A screenshot of the example project. It’s available for download at the end of the post.

(more…)

Android: ADB remote emulator access

Click here to read Android: ADB remote emulator access

This post shows how to access an emulated Android device over a local area network, so you can test and debug applications on another computer. It’s a step by step explanation based on this thread on Stack Overflow. The main goal behind this post is to show just one of the possible ways of doing it. So, if you have a suggestion on how to improve or make this process more secure, please, feel free to comment below.

The technique described on this post has been tested on a computer with Windows 7 64 bit (the one that executes the emulator) and an Ubuntu virtual machine running on another computer. The Ubuntu PC is the one that is running Eclipse and the one where the applications are being coded. For the sake of simplicity, this tutorial will reference it as “dev machine“. The other PC, the one running Windows 7 64 bit, will execute the Android emulator, which will be remotely accessed. This PC will be referenced as “remote machine” from now on.

(more…)