Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Script editor for oF Live Coding
C++ C Other
Branch: master

README.md

ofxGLEditor

image

Copyright © Dan Wilcox & Akira Hayasaka 2011-2015

GNU Public License v2.

For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "LICENSE.txt," in this distribution.

This is a rewrite of the GLEditor from Fluxus Copyright © 2005 Dave Griffiths

Uses:

  • fontstash for text rendering
  • PrintChar21 font from Kreative Software (used in examples)

See https://github.com/Akira-Hayasaka/ofxGLEditor for documentation as well as the OF forum post on ofxGLEditor

Description

Sample Lua syntax highlighting:
image

ofxEditor provides a rewrite of the Fluxus live coding environment's OpenGL-based text editor for OpenFrameworks including simple syntax highlighting, a file browser, and a Read-Eval-Print Loop console. The ofxGLEditor provides all of the above including 9 editor buffers, so it should be easy to use this as a basis for live coding, scripting, parameter tweaking, etc. Further, ofxEditorSyntax & ofxEditorColorScheme provide simple language specific syntax highlighting.

See a video of the livecodingExample which demonstrates the basic ofxEditor class with syntax highlighting using ofxLua.

Variable width font and full unicode glyph support (here using Arial Unicode.tff):
image

Open file dialog:
image

Read-Eval-Print Loop console:
image

Build Requirements

To use ofxGLEditor, first you need to download and install OpenFrameworks. Development is against the latest version of OpenFrameworks on github. Checkout a tag if you need an earlier, stable version.

OF github repository

On Mac OSX, you will need to install Xcode.

On Linux, you can use Makefiles and/or Codeblocks project files (without the "_win" suffix).

On Win, you will need either Microsoft Visual Studio C++ or Codeblocks+MiniGW and the Win Codeblocks OF package. Use the Codeblocks projects files with the "_win" suffix.

Installation

Place ofxGLEditor within a folder in the addons folder of the OF dir tree:

openframeworks/addons/ofxGLEditor

Usage

See the examples in editorSyntaxExample, glEditorExample, glslExample, livecodingExample, and the source headers in ofxGLEditor/src.

Examples

Project files for the examples are not included so you will need to generate the project files for your operating system and development environment using the OF ProjectGenerator which is included with the OpenFrameworks distribution.

Point the ProjectGenerator to addons/ofxGLEditor, change the project name to the exact name of the example you want to generate (ie editorExample), and make sure to choose ofxGLEditor from the addons. Hitting "Generate Project" will populate that example with the project files you will need to build it.

glslExample

This is a simple GLSL fragment (pixel) shader editor including GLSL syntax highlighting. The shader is reloaded whenever it is saved or evaluated (MD key + e).

liveCodingExample

This is a simple livecoding example using ofxLua including lua keyword syntax highlighting. Also, you will need to select ofxLua from the addons list when you generate the project files for this example.

Syntaxes

A growing set of language syntax xml files can be found in the syntaxes folder. Additions or updates are welcome.

Font

You will need a monospaced font as variable width fonts are not currently supported. PrintChar21.ttf is included with the example projects. Unicode glyphs are supported if your font has them.

Something went wrong with that request. Please try again.