Giter Site home page Giter Site logo

june's Introduction

june

JUNE is a Nim binding of the JUCE framework, allowing fast prototyping JUCE applications in your favourite compiled programming language.

Build From Source

Build the JUCE shared library.

nimble juce_debug
# nimble juce_release

Then build the nim test (tweak nim.cfg if needed).

nimble app_debug
# nimble app_release

Example Application

A simple example application (subject to changes):

import june

{.emit: """/*INCLUDESECTION*/
#include <june.h>
""".}

defineCppClass TestApplication of JUCEApplication:
  window: ptr DocumentWindow

proc constructTestApplication*(): TestApplication =
  result = TestApplication()


proc createApplication(): ptr JUCEApplication =
  var application: ptr TestApplication = cnew constructTestApplication()
  application.window = nil

  application[].onGetApplicationName = bindClosure(proc(): String = "JUNE App")
  application[].onGetApplicationVersion = bindClosure(proc(): String = "0.1")

  application[].onInitialise = bindClosure(proc(commandLine: String) =
    var windowName = application[].getApplicationName()

    application[].window = newDocumentWindow(windowName, makeColour(50'u8, 62'u8, 68'u8, 255'u8), DocumentWindow_allButtons, true)
    application[].window[].onCloseButtonPressed = bindClosure(proc() = JUCEApplication.getInstance().systemRequestedQuit())
    application[].window[].setResizable(true, true)
    application[].window[].centreWithSize(640, 480)
    application[].window[].setVisible(true)
  )

  application[].onShutdown = bindClosure(proc() =
    cdelete(application[].window)
    application[].window = nil
  )

  application[].onSystemRequestedQuit = bindClosure(proc() = application[].quit())

  result = application

when isMainModule:
  START_JUCE_APPLICATION(createApplication)

Will look like this:

https://github.com/kunitoki/june/blob/main/assets/example_app.png?raw=true

june's People

Contributors

elijahr avatar gavinray97 avatar kunitoki 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.