Login  Register

struct and vector

Posted by Siassei on Aug 01, 2010; 6:18pm
URL: https://forum.jogamp.org/struct-and-vector-tp1013748.html

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