Release 2.1.3

1 view
Skip to first unread message

Sergey Basalaev

unread,
Sep 7, 2013, 6:02:20 AM9/7/13
to Alchemy OS
This release includes a couple of bugfixes and M3G support.

To start writing programs using M3G install libm3g-dev package.
In a source you can just include the whole API with
use "m3g"

or an individual header like
use "m3g/Image2D"

To compile programs with M3G library pass the following options to compiler:
-lm3g -lm3g-ext

Download Alchemy OS
Download M3G library and headers

Kyle Alexander Buan

unread,
Sep 7, 2013, 7:23:06 AM9/7/13
to alche...@googlegroups.com
Great update! But no matter what I do, VertexArray.set always says,
"Illegal argument: Byte or Short array required". I'm sure my array is
Byte. How do I fix this?

Sergey Basalaev

unread,
Sep 7, 2013, 12:22:33 PM9/7/13
to Alchemy OS
2013/9/7 Kyle Alexander Buan <tar.s...@gmail.com>

Great update! But no matter what I do, VertexArray.set always says,
"Illegal argument: Byte or Short array required". I'm sure my array is
Byte. How do I fix this?

My fault. Functions VertexArray.get and VertexArray.set are bound
incorrectly. Please, wait for the fix.

Sergey Basalaev

unread,
Sep 7, 2013, 3:43:03 PM9/7/13
to Alchemy OS
Try with the new version

Kyle Alexander Buan

unread,
Sep 7, 2013, 10:10:18 PM9/7/13
to alche...@googlegroups.com
Trying.

On 9/8/13, Sergey Basalaev <sbas...@gmail.com> wrote:
> Try with the new version
>
> --
> You received this message because you are subscribed to the Google Groups
> "Alchemy OS discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to alchemy-os+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

Kyle Alexander Buan

unread,
Sep 8, 2013, 6:32:10 AM9/8/13
to alche...@googlegroups.com
I didn't try every function, but yes, it worked correctly.
Except, that if M3G is used by a program, and that program exited,
then running that program again says that: "M3G is used by another
process," though it is not.

Rephrase: When a program that uses M3G exits, we cannot use M3G again.
We have to restart Alchemy OS.

Here's my program: (sorry, I was in a hurry when I did this)

use "ui"
use "canvas"
use "m3g"
use "sys"

def main(a: [String]) {
var vposa = [
-1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1,
1, -1, -1, -1, 1, -1, 1, 1, -1 ]
var vpos = new [Byte](24)
for (var i=0, i<vposa.len, i+=1) vpos[i] = vposa[i]
var tind = [ 0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1 ]
var vb = new VertexBuffer()
var vp = new VertexArray(vpos.len/3, 3, 1)
vp.set(0, vpos.len/3, vpos)
vb.setPositions(vp, 1.0f, null)
var tsa = new TriangleStripArray(tind, [tind.len])
var cam = new Camera()
var can = new Canvas(false)
ui_set_screen(can)
var cg = can.graphics()
cam.setPerspective(30.0f,
can.width.cast(Float)/can.height.cast(Float), 1.0f, 1000.0f)
var ct = new Transform()
ct.postTranslate(0f, 0f, 10.0f)
m3g_setCamera(cam, ct)
m3g_bindTarget(cg)
m3g_clear(null)
m3g_render(vb, tsa, new Appearance(), null)
m3g_releaseTarget()
can.refresh()
sleep(5000) }

Kyle Alexander Buan

unread,
Sep 10, 2013, 7:50:32 AM9/10/13
to alche...@googlegroups.com
Sergey, how do I fix that problem?

Sergey Basalaev

unread,
Sep 11, 2013, 12:55:04 AM9/11/13
to Alchemy OS
Weird, process must release m3g context automatically on exit.
If it does not do so, this is a bug.

Sergey Basalaev

unread,
Sep 11, 2013, 1:01:10 AM9/11/13
to Alchemy OS
A tip on this code:


var vposa = [
  -1, -1,  1,    1, -1,  1,   -1,  1,  1,    1,  1,  1,   -1, -1, -1,
  1, -1, -1,   -1,  1, -1,    1,  1, -1 ]
var vpos = new [Byte](24)
for (var i=0, i<vposa.len, i+=1) vpos[i] = vposa[i]

You can create and fill byte array like that:

var vpos = new [Byte] {

Kyle Alexander Buan

unread,
Sep 11, 2013, 1:58:57 AM9/11/13
to alche...@googlegroups.com
If you say so, then yes, it's a bug.
Yes, I know that method, but I was just making sure that the array is Byte :)

On 9/11/13, Sergey Basalaev <sbas...@gmail.com> wrote:
> Weird, process must release m3g context automatically on exit.
> If it does not do so, this is a bug.
>

Kyle Alexander Buan

unread,
Sep 15, 2013, 3:03:19 AM9/15/13
to alche...@googlegroups.com
Sergey, what happened?

Sergey Basalaev

unread,
Sep 16, 2013, 3:29:21 AM9/16/13
to Alchemy OS
2013/9/15 Kyle Alexander Buan <tar.s...@gmail.com>
Sergey, what happened?

I just was busy with work last days. Do not worry, I'll post fixes
and more stuff in coming days.

Kyle Alexander Buan

unread,
Sep 16, 2013, 4:20:16 AM9/16/13
to alche...@googlegroups.com
Yay! Excited ^_^
Reply all
Reply to author
Forward
0 new messages