Giter VIP home page Giter VIP logo

gbox's Introduction

gbox

The Graphic Box Library

No longer maintained

See new project: lanox2d

Introduction

gbox is a mutli-platform c graphic library.

It is now in the early stages of development only for reference and learning.

If you are interesting to this project, please view the source code.

Features

  • Support 2d vector drawing
  • Support matrix transform
  • Support fill and stroke for solid, gradient and image
  • Support custom path and drawing
  • Support float and fixed point computation
  • Provide custom drawing devices
  • Support OpenGL ES 1.0/2.0
  • Support soft algorithm for drawing
  • Implement mesh structure and algorithm
  • Implement complex polygon tessellator and triangulation
  • Support odd and nonzero fill
  • Implement polygon scanning algorithm
  • Provide multi-platform windows(.e.g glut, sdl and x11, framebuffer, ios, android in the feature)

In the plans

  • Draw svg images
  • Implement anti-aliasing
  • More drawing devices and windows
  • Draw text
  • Development ui and game engine

Build

please install xmake first: xmake

$ cd ./gbox
$ xmake

Run

$ xmake run core

Documents

Contacts

简介

GBOX是一个用c语言实现的多平台图形库,支持windows、linux、mac、ios、android以及其他嵌入式系统。

现在这个项目,正处于早期开发阶段,暂不提供使用,仅供参考学习

如果您感兴趣,可以阅读源码

已实现的功能

  • 矢量2d渲染,支持矩阵变换,画刷、画笔的设置和渲染
  • 支持复杂矢量路径渲染和填充
  • 支持纯色填充、梯度填充、图像填充(正在重构)
  • 支持全定点或者浮点计算(可配置切换)
  • 实现渲染设备扩展,目前支持gpu加速的opengl es 1.0/2.0设备、纯算法渲染的bitmap设备
  • 实现复杂多边形分割(三角形分割、凸多边形分割),支持奇偶填充、非零填充等填充规则(这个算法花了我一年时间 =。=)
  • 实现mesh结构和封装
  • 实现多边形扫描算法
  • 支持多平台窗口扩展,目前支持glut、sdl窗口,后续会支持(x11,framebuffer, ios/android,windows等原生窗口)

后续工作

  • svg矢量图形渲染(之前的版本实现过一整套,最近正在重构,所以暂时移除了)
  • 反走样支持
  • 实现更多平台窗口和渲染设备
  • 实现字体渲染
  • ui框架的实现
  • 有时间的话,再整整游戏引擎,当然这个是后话,看心情和时间了。

测试效果

  • 目前基于opengl的渲染设备,绘制tiger.svg可达到60fps
  • 基于bitmap的纯算法渲染设备,绘制tiger.svg可达到30-40fps(pc上测试,数据仅供参考)

编译

请先安装: xmake

cd ./gbox
xmake

运行

$ xmake run core

文档

联系

gbox's People

Contributors

gitter-badger avatar waruqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gbox's Issues

跨平台实现简单的弹窗,思路?

我在Windows上使用MessageBox函数实现弹窗提示,
Mac上可以直接调用系统API,不用qt之类的第三方框架吗?
项目使用C++编写,对界面要求只是弹窗输入框这些。有什么实现思路吗?
因为看到这个图形库暂不支持使用,所以在Mac简单实现弹窗可以怎么样呢

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.