Coder Social home page Coder Social logo

eriser / axlib Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 3.0 855.76 MB

Graphic User Interface with OpenGL

License: MIT License

Makefile 0.35% C++ 14.23% HTML 48.23% CSS 0.13% JavaScript 0.18% Objective-C 0.16% Objective-C++ 0.45% CMake 0.08% Python 0.30% Shell 4.19% C 30.42% Java 0.23% PostScript 0.39% Perl 0.33% Mercury 0.01% Rebol 0.01% R 0.01% Awk 0.04% Groff 0.26% Perl 6 0.01%

axlib's Introduction

#axLib

A C++ cross-platform framework to build highly customizable platform-independent graphical user interface.

Features

  • Easy to setup.
  • Currently supports Mac OS X (10.10), Windows 7 and 8 and Linux (X11).
  • Extensive use of C++11 and Standard Template Library (STL) syntax.
  • Use of C++11 lambda functions and threads for event management.
  • Minimize interaction with operating systems.

Build in Widgets

axButton axSlider axKnob axToggle axMenu
axNumberBox axGrid axPopupMenu axDropMenu axScrollBar

Code examples

Create axButton

  • Use the build-in axButton with and without custom skins.
  • Basic example of simple axEvent.

Custom Animated Button

  • Overload axButton virtual function.
  • Use of axTimer object.

Project examples

![MidiSequencer] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/MidiSequencer.png) ![Calculator] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/Calculator.png)

axTB303

![SoundEditor] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/SoundEditor.png)

Buttons Toggles

Create Project

Mac OS 10.10 (Yosemite) - Xcode 6.1

  1. First you need to install freetype-2.4.0 library or newer version and libpng15.

    • Make sure they're located in /usr/local/include/ and /usr/local/lib/
  2. Create new Project Cocoa application with Objective-C language.

  3. Delete test folder in project navigator and click on move to trash.

    Delete test folder

  4. Then go in project option under Targets List right click and delete test target.

    Delete test

  5. Delete these files in project navigator and move to trash.

    • AppDelegate.h
    • AppDelegate.m
    • MainMenu.xib
  6. Drag or include these folders in project navigator.

    • axLib/include/
    • axLib/source/
    • axLib/axWidgets/
    • axLib/axMac/
  7. Add these folder to Search Paths tab under Header Search Paths in project configuration.

    • /usr/local/include/
    • /usr/local/include/freetype2/
  8. Add this folder to Search Paths tab under Library Search Paths in project configuration.

    • /usr/local/lib/
  9. Add these flags to Linking tab under Other Linker Flags still in project configuration.

    • -lfreetype
    • -lpng15
  10. Change Per-configuration Build Products Path in Build Locations tab to :

    • $(SRCROOT)/Debug/
    • $(SRCROOT)/Release/
  11. Then copy axLib/ressources/axFonts/FreeSans.ttf into each folder created (Debug and Release).

  12. Finally create new main.cpp and main.h files and add them to project.

    • Continue to Minimal implementation section and copy code below for bare minimum implementation.

Windows 7 and 8 - Visual Studio 2013

  1. Create a AX_LIB path variable to axLib main folder in Control Panel under System.

    System

  2. Compile FreeType2 in axLib/libs/freetype-2.5.3/builds/windows/vc2010/.

  3. Compile LibPng in axLib/libs/lpng1610/projects/vstudio/.

  4. Create a C++ Emtpy Project in visual studio.

    Empty

  5. Add these folders to project.

    • axLib/include/
    • axLib/source/
    • axLib/axWidgets/
    • axLib/axWin32/
  6. Add these folders in Configuration Properties under C/C++ General.

    Include

    • $(AX_LIB)/include/
    • $(AX_LIB)/axWin32/
    • $(AX_LIB)/axWidgets/
    • $(AX_LIB)/libs/freetype-2.5.3/include/
    • $(AX_LIB)/libs/lpng1610/
  7. Add these folders in Configuration Properties under Linker General in Additional Library Directories.

    Lib directory

    • $(AX_LIB)/libs/lpng1610/projects/vstudio/Debug/
    • $(AX_LIB)/libs/freetype-2.5.3/objs/win32/vc2010/
  8. Then add these lines to Linker Input in Additional Dependencies.

    Lib directory

    • opengl32.lib
    • glu32.lib
    • libpng16.lib
    • zlib.lib
    • freetype253_D.lib
  9. Add this macro in Configuration Properties under C/C++ Preprocessor.

    Lib directory

    • _CRT_SECURE_NO_WARNINGS
  10. Finally create new main.cpp and main.h files and add them to project.

    • Continue to Minimal implementation section and copy code below for bare minimum implementation.

Minimal implementation.

main.h

#ifndef __MINIMAL_PROJECT__
#define __MINIMAL_PROJECT__

#include "axLib.h"

class MyProject: public axPanel
{
public:
    MyProject(axWindow* parent,
              const axRect& rect);
private:
    // axEvents.
    virtual void OnPaint();
};

#endif // __MINIMAL_PROJECT__

main.cpp

#include "main.h"

MyProject::MyProject(axWindow* parent, const axRect& rect):
                     axPanel(parent, rect)
{
    
}

void MyProject::OnPaint()
{
    axGC* gc = GetGC();
    axRect rect0(axPoint(0, 0), GetRect().size);
    
    gc->SetColor(axColor(0.3, 0.3, 0.3, 1.0));
    gc->DrawRectangle(rect0);

    gc->SetColor(axColor(0.0, 0.0, 0.0, 1.0));
    gc->DrawRectangleContour(rect0);
}

void axMain::MainEntryPoint(axApp* app)
{
    MyProject* myProject = new MyProject(nullptr, axRect(0, 0, 500, 500));
}

Git instructions.

For now, all development is made on dev branch. But Release-xx.xx.xx branches will be use when new release approaches.

To add a new feature, you just need to create a new branch from dev.

git checkout -b myfeature dev

Then to incorporate a finished feature on dev.

git checkout dev
git merge --no-ff myfeature
git branch -d myfeature
git push origin dev

axlib's People

Stargazers

Tatsuya Shiozawa 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.