#axLib
A C++ cross-platform framework to build highly customizable platform-independent graphical user interface.
- 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.
axButton | axSlider | axKnob | axToggle | axMenu |
---|---|---|---|---|
axNumberBox | axGrid | axPopupMenu | axDropMenu | axScrollBar |
- Use the build-in axButton with and without custom skins.
- Basic example of simple axEvent.
- Overload axButton virtual function.
- Use of axTimer object.
![MidiSequencer] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/MidiSequencer.png) ![Calculator] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/Calculator.png)
![SoundEditor] (https://dl.dropboxusercontent.com/u/26931825/axLibWebData/SoundEditor.png)
-
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/
-
Create new Project Cocoa application with Objective-C language.
-
Delete test folder in project navigator and click on move to trash.
-
Then go in project option under Targets List right click and delete test target.
-
Delete these files in project navigator and move to trash.
- AppDelegate.h
- AppDelegate.m
- MainMenu.xib
-
Drag or include these folders in project navigator.
- axLib/include/
- axLib/source/
- axLib/axWidgets/
- axLib/axMac/
-
Add these folder to Search Paths tab under Header Search Paths in project configuration.
- /usr/local/include/
- /usr/local/include/freetype2/
-
Add this folder to Search Paths tab under Library Search Paths in project configuration.
- /usr/local/lib/
-
Add these flags to Linking tab under Other Linker Flags still in project configuration.
- -lfreetype
- -lpng15
-
Change Per-configuration Build Products Path in Build Locations tab to :
- $(SRCROOT)/Debug/
- $(SRCROOT)/Release/
-
Then copy axLib/ressources/axFonts/FreeSans.ttf into each folder created (Debug and Release).
-
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.
-
Create a AX_LIB path variable to axLib main folder in Control Panel under System.
-
Compile FreeType2 in axLib/libs/freetype-2.5.3/builds/windows/vc2010/.
-
Compile LibPng in axLib/libs/lpng1610/projects/vstudio/.
-
Create a C++ Emtpy Project in visual studio.
-
Add these folders to project.
- axLib/include/
- axLib/source/
- axLib/axWidgets/
- axLib/axWin32/
-
Add these folders in Configuration Properties under C/C++ General.
- $(AX_LIB)/include/
- $(AX_LIB)/axWin32/
- $(AX_LIB)/axWidgets/
- $(AX_LIB)/libs/freetype-2.5.3/include/
- $(AX_LIB)/libs/lpng1610/
-
Add these folders in Configuration Properties under Linker General in Additional Library Directories.
- $(AX_LIB)/libs/lpng1610/projects/vstudio/Debug/
- $(AX_LIB)/libs/freetype-2.5.3/objs/win32/vc2010/
-
Then add these lines to Linker Input in Additional Dependencies.
- opengl32.lib
- glu32.lib
- libpng16.lib
- zlib.lib
- freetype253_D.lib
-
Add this macro in Configuration Properties under C/C++ Preprocessor.
- _CRT_SECURE_NO_WARNINGS
-
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.
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));
}
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