From 47319dab5b769a5a685bc329c8e5a37a710e1687 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 5 Aug 2009 09:57:37 -0700 Subject: Fix: Allow all constanst defined by enums; Add PFD_ defines. --- src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java | 2 +- src/java/com/sun/gluegen/opengl/GLEmitter.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java b/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java index 0ede95e88..a31a98760 100644 --- a/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java +++ b/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java @@ -100,7 +100,7 @@ public class BuildStaticGLInfo protected static int defineIdentifierGroup = 1; protected static Pattern definePattern = - Pattern.compile("\\#define ([CEW]?GL[XU]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)\\s*"); + Pattern.compile("\\#define (([CEW]?GL[XU]?|PFD)_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)\\s*"); // Maps function / #define names to the names of the extensions they're declared in protected Map declarationToExtensionMap = new HashMap(); diff --git a/src/java/com/sun/gluegen/opengl/GLEmitter.java b/src/java/com/sun/gluegen/opengl/GLEmitter.java index 9e3202658..935706bd2 100644 --- a/src/java/com/sun/gluegen/opengl/GLEmitter.java +++ b/src/java/com/sun/gluegen/opengl/GLEmitter.java @@ -320,7 +320,15 @@ public class GLEmitter extends ProcAddressEmitter StringBuffer newComment = new StringBuffer(); newComment.append("Part of "); if(0==addExtensionsOfSymbols2Buffer(newComment, ", ", symbolRenamed, def.getAliasedNames())) { - // Note: All GL enums must be contained within an extension marker ! + if(def.isEnum()) { + String enumName = def.getEnumName(); + if(null!=enumName) { + newComment.append(enumName); + } else { + newComment.append("ENUM"); + } + } else { + // Note: All GL defines must be contained within an extension marker ! // #ifndef GL_EXT_lala // #define GL_EXT_lala 1 // ... @@ -331,6 +339,7 @@ public class GLEmitter extends ProcAddressEmitter System.err.println("Dropping marker: "+sb.toString()); } return; + } } newComment.append(""); -- cgit v1.2.3