Introduction

Today is a bit of a milestone. We’ve been able to create an iPad/iPhone app using the Interface Vision Framework. The cool thing… The framework requires no coding to use. Ok, that isn’t exactly true but read on…

About the Video

The video shows a very simple OpenGl demo program running on an iPad. Nothing new there. The new thing is that everything about the program was created using configuration code: about 460 lines of it. Currently, this involves a lot of calls to constructors and the setting of properties. However, in the future, the configuration will be stored in json and serialization used to create instances (this is when the no coding part is realized).

Example Configuration

Here is an example configuration. In this case, it is the OpenGl shaders:

ISimpleClass shaderList = new AggregateArrayList {};
shaderList.actionInsert = new ProgramShaderNative {
  shadingScript = new Vision.Core.String {
    withString = @"
      attribute vec4 position;
      attribute vec4 color;
      varying vec4 colorVarying;
      uniform float translate;
      void main() {
        gl_Position = position;
        gl_Position.y += sin(translate) / 2.0;
        colorVarying = color;
      }"
  },
  shaderType = ShaderType.vertexShader
};
shaderList.actionInsert = new ProgramShaderNative {
  shadingScript = new Vision.Core.String {
    withString = @"
      varying lowp vec4 colorVarying;

      void main() {
        gl_FragColor = colorVarying;
      }"
  } ,
  shaderType = ShaderType.fragmentShader
};

Here is an example of the OpenGL “camera”:

ISimpleClass result = new Camera
  sceneToRender = new ProgramGlslNative {
    uniforms = uniformList,
    attributes = attributeList,
    shaders = shaderList
  } ,
  onCameraSetup = new GlClearColorNative {
    color = new Vec4f {
      r = 0.0f,
      g = 0.0f,
      b = 0.0f,
      a = 1.0f
    }
  },
  onSceneRenderBefore = new GlClearNative {
    clearValue = ClearBufferMask.colorBufferBit
  }
};

Future

There is a chicken and egg problem with all of this. Eventually, we hope to be able to configure behaviour of Interface Vision within Interface Vision itself. However, for now, we have to resort to the Macintosh to finish out the framework and setup the configuration files.

Conclusion

For us, this is quite exciting. It is a good test of the framework. The fact it takes so few lines of configuration code to get a program up and running in OpenGL on an iPad with user interaction is a great test of the technology behind Interface Vision.



blog comments powered by Disqus