Skip to content
Freeman Zhang edited this page May 3, 2015 · 1 revision

Compile with BlendInt

Here's a quick guide of how to compile your code with BlendInt.

Suppose the BlendInt was installed to /usr/local, and you want to compile the "Hello World" code in main.cpp.

#include <blendint/gui/window.hpp>
#include <blendint/gui/message-box.hpp>

int main(int argc, char* argv[])
{
  using namespace BlendInt;

  if(Window::Initialize()) {

    Window win(240, 180, "Tutorial 01");

    MessageBox* message = new MessageBox("Hello World!",
                                         "Click the \"close\" button.");
    // 'message' will be destroyed when the window is closed.
    win.AddFrame(message);
    message->MoveTo(
        (win.size().width() - message->size().width()) / 2,
        (win.size().height() - message->size().height()) / 2);

    win.Exec();
    Window::Terminate();
  }

  return 0;
}

In command

In OS X:

$ clang++ `pkg-config --cflags --libs blendint` main.cpp -o hello_world

In Linux:

$ g++ `pkg-config --cflags --libs blendint` main.cpp -o hello_world

Use Xcode

  1. Create a new Xcode project
  2. Select "Command Line Tool" project
  3. Select "C++" language
  4. In project property page -> "Linking" -> "Other Linker Flags", fill in "-lblendint -lboost_filesystem-mt -lboost_system-mt -lboost_thread-mt"
  5. In project property page -> "Search Paths" -> "Header Search Paths", add /usr/local/include, /usr/local/include/blendint, /usr/local/include/freetype2
  6. In project property page -> "Search Paths" -> "Library Search Paths", add /usr/local/lib

Use Eclipse

Table of Contents

  1. Home
  2. Roadmap
  3. Known Issues
  4. Build from Source
  5. Using BlendInt
    • H/W Requirements
    • Fontconfig and Fonts
    • Compile with BlendInt
      • "Hello World" example
      • Eclipse
      • Xcode
    • Tips
      • Use BlendInt in real time app
      • Use BlendInt in non-real time app
  6. Gallery
  7. Programming Guide
    • Basic Class Diagrams
    • Layout
    • Draw
      • Draw with OpenGL APIs
      • Draw with Predefined Shaders
    • Use event framework
    • Process HID events from window system
    • Memory Management
    • MVC for ListView/TreeView
    • Off-screen Render with FBO
    • Write your custom Widget
    • Write your custom Container
    • Themes
  8. API Reference
  9. Development
  10. FAQ
Clone this wiki locally