Login  Register

Re: struct and vector

Posted by Michael Bien on Aug 01, 2010; 9:55pm
URL: https://forum.jogamp.org/struct-and-vector-tp1013748p1014105.html

Hi,

gluegen does not yet support non standard C types. But you could use the struct accessors of the julia3d example as template and implement it yourself. If you use the right offset and just create your own setters it should work just fine. StructAccessors are just a direct ByteBuffer with a few getters and setters.

please file a bugreport or RFE if you have time.

hope that helps,
regards,
michael

On 08/01/2010 08:18 PM, Siassei [via jogamp] wrote:
Hello,

I have no idea how I can do as follows
opencl.cl
[code]struct Sphere {
    int infoCode;
    double  radius;
    double3 position, emission, color;
    ReflectionType refl;
} __attribute__ ((packed));

enum ReflectionType {
    Diffuse = 0,
    Specular = 1,
    Refr = 2
} __attribute__ ((aligned (1)));

__kernel void compute(__global struct Sphere *sp, ...) {
 // ...
}[/code]
Ok. I have found the julia3d demo and creates the class files for the struct. But
- How I handle a enum?
- Does jogamp support the vector types? e.g. float3

Thanks, Thomas


View message @ http://jogamp.762907.n3.nabble.com/struct-and-vector-tp1013748p1013748.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.