Giter VIP home page Giter VIP logo

towngl's Introduction

Introduction

This is basic OpenGL based demo application.

Overview

This demo application was originally developed in C, around 1999 with OpenGL 1.1 and targed Windows systems.

I have recoded it as a means to keep myself updated with the C++11/C++14 changes and how to use to target Android systems with NDK and Open GL ES 2.0.

The graphics were kept as simple as the original one, because the main goal was to learn the said technologies and not to write a game engine.

Dependencies

This code requires the following libraries:

  • GLM (a C++ math library)
  • SDL (a C portable library for multimedia applications)
  • GLEW (OpenGL extensions loader, only required on Windows systems)

Building

Windows

Setting up

For building TownGL on Windows, a few steps are required:

  1. Download the binary relase of SDL for Windows from http://www.libsdl.org/
  2. Copy the SDL binaries into libs location
  3. Download GLM from http://glm.g-truc.net
  4. Copy the GLM source code into libs location
  5. Download the binary relase of GLEW for Windows from http://glew.sourceforge.net/
  6. Copy the GLEW binaries into libs location

Note: I only tested with 32bit binaries so far. In principle 64bit should work as well, but it hasn't been tested.

Building

  1. Open the Visual Studio 2013 project file
  2. Build the solution

Android

Setting up

For building TownGL with the NDK, a few steps are required:

  1. Download SDL from http://www.libsdl.org/
  2. Expand the package contents
  3. Copy the full SDL source code into app/jni location
  4. Copy the Java code from android-project/src into app/src/main/java
  5. Download GLM from http://glm.g-truc.net
  6. Copy GLM source code into app/jni location

Building on the command line

  1. Make sure ndk-build is on the PATH
  2. gradlew assembleDebug

Building with Android Studio

  1. Start Android Studio;
  2. Use import existing project for adding the project into the workspace;
  3. Verify that you have a valid path for the NDK at File->Project Structure->Android NDK location settings panel;
  4. Build the project
  5. Finally deploy it either to the emulator or plugged device

Since the demo makes use of OpenGL ES, it will only work in the emulator if the requirements are fullfiled:

  • HAXM is installed
  • The emulator is configured with an Intel CPU
  • The image has graphics accelaration via host GPU enabled

License

This code is under the GPL v2 license.

towngl's People

Contributors

pjmlp avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.