GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
TestStructGen01.java
Go to the documentation of this file.
1package com.jogamp.gluegen.test.junit.structgen;
2
3import com.jogamp.common.os.Platform;
4import com.jogamp.junit.util.SingletonJunitCase;
5
6import org.junit.Assert;
7import org.junit.BeforeClass;
8import org.junit.Test;
9import org.junit.FixMethodOrder;
10import org.junit.runners.MethodSorters;
11
12@FixMethodOrder(MethodSorters.NAME_ASCENDING)
13public class TestStructGen01 extends SingletonJunitCase {
14
15 @BeforeClass
16 public static void init() {
17 // Enforce dependency,
18 // i.e. CStruct annotation processor to generate the types 'RenderingConfig' etc.
21 }
22
23 @Test
24 public void test01() {
25 final RenderingConfig config = RenderingConfig.create();
26 final Vec3f dir = config.getCamera().getDir();
27 dir.setX(0.5f);
28 dir.setY(0.6f);
29 dir.setZ(0.7f);
30 final Vec3f dir2 = Vec3f.create(dir.getBuffer());
31 Assert.assertEquals(dir.getX(), dir2.getX(), 0.0001f);
32 Assert.assertEquals(dir.getY(), dir2.getY(), 0.0001f);
33 Assert.assertEquals(dir.getZ(), dir2.getZ(), 0.0001f);
34 }
35
36 @Test
37 public void test02() {
38 final Camera cam = Camera.create();
39 final Vec3f cam_dir = cam.getDir();
40 final Vec3f cam_orig = cam.getOrig();
41 cam_dir.setX(1);
42 cam_dir.setY(2);
43 cam_dir.setZ(3);
44 cam_orig.setX(0);
45 cam_orig.setY(1);
46 cam_orig.setZ(2);
47 }
48
49 public static void main(final String args[]) {
50 final String tstname = TestStructGen01.class.getName();
51 org.junit.runner.JUnitCore.main(tstname);
52 }
53
54}
Utility class for querying platform specific properties.
Definition: Platform.java:58
static void initSingleton()
kick off static initialization of platform property information and native gluegen_rt lib loading
Definition: Platform.java:359
Class simply triggering CStruct annotation processor to generate the types 'RenderingConfig' etc.