REBOL 3.0

Comments on: Update on Graphics in Host-Kit

Carl Sassenrath, CTO
REBOL Technologies
2-Jul-2010 18:52 GMT

Article #0324
Main page || Index || Prior Article [0323] || Next Article [0325] || 10 Comments || Send feedback

Here's a quick update on the status of graphics in the Host-Kit.

  • The window management and window-event handling code has been exported to the Host-Kit. You will find this C code to be crisp and clean (and ready to be ported to OX X, Linux, and what-have-you.)
  • A new boot extension module (in the Host-Kit) has been added to the initialization in the main program. This module contains the native graphics functions as command functions (externalized native functions.)
  • The graphics related mezzanine functions have also been exported to this boot module, for example VIEW and UNVIEW. So, everything is together now in the open source side of the system, allowing simultaneous changes and eliminating dependencies.
  • A small script has been created that bundles the commands and mezzanines into a single module that is given a module header and converted to a C-code string for boot extension processing.
  • DRAW commands (e.g. box, circle, etc.) are processed by the command block evaluator (currently called DO-COMMANDS). This evaluator is accessible from both REBOL code and C code.
  • For each GOB (graphical object) the graphics compositor calls the command block evaluator with the GOB's DRAW block, which calls back into the deeper graphics library (currently AGG) function base, for example, to add a rectangle to the graphics rendering stack. The C-based Reb_Do_Commands accepts a data reference pointer to make it possible to recurse in this way over different GOBs, nested as needed.
  • A few of the basic DRAW commands have been converted for testing purposes.

Some simple test scripts are now running to show that the graphics compositing is working as desired. An important milestone.

Example drawing:

which was created by this code:

view/no-wait main: make gob! [color: black offset: 0x0 size: 500x500]
repeat n 32 [
    sz: random 100x100
    append main make gob! reduce/no-set [
        draw: reduce [
            'pen random 255.255.255 
            'fill-pen random 255.255.255.255
            'circle sz sz/x * 95% sz/y * 95%
        ]
        offset: random 300x300
        size: sz * 2
    ]
]
show main
wait 1

The next steps in the project will involve working with Cyphre (Richard) to add back all remaining DRAW commands.

There are a few other tasks, minor I hope, to get the open graphics system ready for merging with other on-going GUI developments. For example, we'll want to support the translation of DELECT dialects (unordered optional argument call sequences) into command block sequences.

10 Comments

Comments:

Paul
2-Jul-2010 19:22:27
Congrats to the team. Great achievement.
-pekr-
3-Jul-2010 18:35:18
I hope DELECT still remains available for those, who want unordered arguments in their dialects?

Is the delayed boot of gfx enggine first sign of delayed modules you mentioned some time ago?

Nick
4-Jul-2010 0:33:51
F - A - N - T - A - S - T - I - C !
Gregg Irwin
4-Jul-2010 19:36:07
Very cool.

Typo found: OX X

Endo
5-Jul-2010 3:56:12
Good news!
Maxim Olivier-Adlhoch
5-Jul-2010 13:19:18
VERY good news, keep up the good work!
ShadWolf
6-Jul-2010 0:00:26
I will let the C boring side to the other and i will do Rebol fun side...
tangdongjun
7-Jul-2010 5:23:35
this is a good news!
RobertS
18-Jul-2010 17:51:02
Offer to port/build/test graphics/host-kit on i386 ubuntu
shadwolf
25-Aug-2010 17:45:30
how do we know 255.255.255.255 is a color RGBA and not an ip adress or an ip mask ( ok the draw context ...) ?

Post a Comment:

You can post a comment here. Keep it on-topic.

Name:

Blog id:

R3-0324


Comment:


 Note: HTML tags allowed for: b i u li ol ul font span div a p br pre tt blockquote
 
 

This is a technical blog related to the above topic. We reserve the right to remove comments that are off-topic, irrelevant links, advertisements, spams, personal attacks, politics, religion, etc.

REBOL 3.0
Updated 24-Apr-2024 - Edit - Copyright REBOL Technologies - REBOL.net