aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/ogl/CgWrapper.c
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2005-10-17 22:56:23 +0000
committerKevin Rushforth <[email protected]>2005-10-17 22:56:23 +0000
commit356bbf2bd325380e16fd77d34fffd084dc1c0928 (patch)
tree1d67b61e1a427baa49047341ee825bca9b423553 /src/native/ogl/CgWrapper.c
parent68449b2071392af151a75f90610026465c426401 (diff)
Merged changes from dev-1_4 branch into the main trunk.
NOTE: all 1.4 development will now proceed on the main trunk. The dev-1_4 branch is closed. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@445 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/ogl/CgWrapper.c')
-rw-r--r--src/native/ogl/CgWrapper.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/native/ogl/CgWrapper.c b/src/native/ogl/CgWrapper.c
new file mode 100644
index 0000000..55c2c64
--- /dev/null
+++ b/src/native/ogl/CgWrapper.c
@@ -0,0 +1,56 @@
+/*
+ * $RCSfile$
+ *
+ * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * $Revision$
+ * $Date$
+ * $State$
+ */
+
+/*
+ * Note: since this is just a wrapper around the CG functions, it
+ * won't be compiled or linked unless the CG library is
+ * available. This means we don't need to use "#ifdef COMPILE_CG".
+ */
+
+#if defined(LINUX)
+#define _GNU_SOURCE 1
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gldefs.h"
+#include "CgWrapper.h"
+
+/*
+ * Setup the function pointers
+ */
+JNIEXPORT void
+j3dLoadCgFunctionPointers(CgWrapperInfo *cgWrapperInfo)
+{
+ cgWrapperInfo->cgCreateContext = &cgCreateContext;
+ cgWrapperInfo->cgGLIsProfileSupported = &cgGLIsProfileSupported;
+ cgWrapperInfo->cgGetError = &cgGetError;
+ cgWrapperInfo->cgGetErrorString = &cgGetErrorString;
+ cgWrapperInfo->cgGetLastListing = &cgGetLastListing;
+ cgWrapperInfo->cgCreateProgram = &cgCreateProgram;
+ cgWrapperInfo->cgDestroyProgram = &cgDestroyProgram;
+ cgWrapperInfo->cgGLLoadProgram = &cgGLLoadProgram;
+ cgWrapperInfo->cgGLBindProgram = &cgGLBindProgram;
+ cgWrapperInfo->cgGLUnbindProgram = &cgGLUnbindProgram;
+ cgWrapperInfo->cgGLEnableProfile = &cgGLEnableProfile;
+ cgWrapperInfo->cgGLDisableProfile = &cgGLDisableProfile;
+ cgWrapperInfo->cgGetNamedParameter = &cgGetNamedParameter;
+ cgWrapperInfo->cgGetParameterType = &cgGetParameterType;
+ cgWrapperInfo->cgGetArrayDimension = &cgGetArrayDimension;
+ cgWrapperInfo->cgGetArrayType = &cgGetArrayType;
+ cgWrapperInfo->cgGetArraySize = &cgGetArraySize;
+ cgWrapperInfo->cgGetArrayParameter = &cgGetArrayParameter;
+ cgWrapperInfo->cgSetParameter1f = &cgSetParameter1f;
+
+ return;
+}