aboutsummaryrefslogtreecommitdiffstats
path: root/make/cg-common.cfg
blob: 246492a1fdc48b9addef4373fd278a315101caaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# This .cfg file provides common options used among all Cg glue code
# generated for Jogl on all platforms.
Package net.java.games.cg
ImplPackage net.java.games.cg.impl
JavaClass CgGL
Style AllStatic
JavaOutputDir ../build/gensrc/classes
NativeOutputDir ../build/gensrc/native/jogl_cg
HierarchicalNativeOutput false

# Generate "flattened" NIO variants for routines taking C primitive
# pointers that aren't of type void*
NioMode ALL_POINTERS

# Comment out FlattenNIOVariants since default is true
# FlattenNIOVariants true

# Generate Java primitive arrays for all C pointers, including void *
PrimitiveArrayExpansionMode ALL_POINTERS

# For expansion of C void* pointers, expand into the following Java
# primitive types: short, int, float, byte, double
VoidPointerExpansion short int float byte double

#
# Map const char* return values to Java strings for these functions
#
ReturnsString cgGetEnumString
ReturnsString cgGetErrorString
ReturnsString cgGetLastErrorString
ReturnsString cgGetLastListing
ReturnsString cgGetParameterName
ReturnsString cgGetParameterSemantic
ReturnsString cgGetProfileString
ReturnsString cgGetProgramString
ReturnsString cgGetResourceString
ReturnsString cgGetString
ReturnsString cgGetTypeString

ArgumentIsString cgCreateProgram 2 4 5
ArgumentIsString cgCreateProgramFromFile 2 4 5
ArgumentIsString cgGetEnum 0
ArgumentIsString cgGetNamedParameter 1
ArgumentIsString cgGetNamedProgramParameter 2
ArgumentIsString cgGetNamedStructParameter 1
ArgumentIsString cgGetNamedUserType 1
ArgumentIsString cgGetProfile 0
ArgumentIsString cgGetType 0
ArgumentIsString cgGetResource 0
ArgumentIsString cgSetParameterSemantic 1

# Opaque definitions
Opaque boolean CGbool

#
# FIXME!!!!  Ignore these functions for now because we can't
# automatically handle C callbacks
#
Ignore cgGetErrorCallback
Ignore cgSetErrorCallback

#
# FIXME!!!!  Ignore these functions for now because bugs in the
# emitter code can't handle them
#
Ignore cgGetParameterValues

#
# Need to import New IO for Buffer classes
#
Import java.nio.*
# and java.security.* to allow unsigned Cg applications
Import java.security.*

# Raise CgException instead of RuntimeException in glue code
RuntimeExceptionType CgException

#
# Make sure the right definitions and include files are added to the
# generated C code
#

CustomCCode #include <stdlib.h>
CustomCCode #include <Cg/cgGL.h>

IncludeAs CustomJavaCode CgGL cg-common-CustomJavaCode.java