Update of /cvsroot/csdopenglnet/csdOpenGL/GL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21768/GL Added Files: AssemblyInfo_csdGL.cs AssemblyInfo_csdGLGtk.cs Exceptions.cs Makefile PublicKeyFile.snk csdGL.cs gtkArea.cs gtkContext.cs Log Message: Cg binding --- NEW FILE: gtkArea.cs --- namespace csDragons { namespace OpenGL { using Gdk; using Gtk; using System; using System.Diagnostics; /** \brief OpenGL-widget * * This class is an OpenGL-widget for Gtk#. */ public class GtkGLArea : DrawingArea { /** \brief each widget must have a type */ static GLib.GType type = RegisterGType (typeof (GtkGLArea)); /** \brief OpenGL context*/ protected GdkGLContext context; /** \brief default constructor * * This constructor uses default settings for createn a GLX context */ public GtkGLArea() : base(type) { Debug.Indent(); Debug.WriteLine( "Entering GtkGLArea()" ); DoubleBuffered = false; Debug.WriteLine( "Init context" ); context = new GdkGLContext(); Debug.WriteLine( "Exiting GtkGLArea()" ); Debug.Unindent(); } /** * This constructor creates the GLX context with the specified parameters * @param attr GLX parameter list */ public GtkGLArea( uint[] attr) : base(type) { Debug.Indent(); Debug.WriteLine( "Entering GtkGLArea(uint[])" ); DoubleBuffered = false; Debug.WriteLine( "Init context" ); context = new GdkGLContext( attr ); Debug.WriteLine( "Entering GtkGLArea(uint[])" ); Debug.Unindent(); } /** \brief activate OpenGL context * * This method marks the associated GL context as active, so that * all following OpenGL statements will alter it. */ public bool MakeCurrent() { Debug.Indent(); Debug.WriteLine( "Entering GtkGLArea.MakeCurrent()" ); bool result = context.MakeCurrent( GdkWindow ); Debug.WriteLine( "Entering GtkGLArea.MakeCurrent()*" ); Debug.Unindent(); return result; } /** \brief OpenGL swapBuffers() * * This method causes OpenGL to swap buffers if possible, */ public void SwapBuffers() { Debug.Indent(); Debug.WriteLine( "Entering GtkGLArea.SwapBuffers()" ); context.SwapBuffers( GdkWindow ); Debug.WriteLine( "Entering GtkGLArea.SwapBuffers()" ); Debug.Unindent(); } } } } --- NEW FILE: AssemblyInfo_csdGL.cs --- using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: AssemblyTitle("csDragons.OpenGL")] [assembly: AssemblyDescription("Wrapper-Library for OpenGL")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("csDragons")] [assembly: AssemblyProduct("csDragons OpenGL.NET")] [assembly: AssemblyCopyright("(C)Copyright 2004 by Tim Rädisch & Kai Reichert")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.1.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(true)] [assembly: AssemblyKeyFile("PublicKeyFile.snk")] --- NEW FILE: gtkContext.cs --- namespace csDragons { namespace OpenGL { using Gdk; using System; using System.Diagnostics; using System.Runtime.InteropServices; public class GdkGLContext : csdGLXTokens { IntPtr xdisplay; // the Xlib Display used IntPtr glxcontext; // the Xlib GLXContext used [ DllImport( "X11" ) ] static extern void XFree( IntPtr reference ); [ DllImport( "GL" ) ] static extern IntPtr glXCreateContext( IntPtr display, IntPtr visualInfo, IntPtr shareList, bool direct ); [ DllImport( "GL" ) ] static extern IntPtr glXChooseVisual( IntPtr display, int screen, uint[] attribList ); [ DllImport( "gdk-x11-2.0" ) ] static extern IntPtr gdk_x11_get_default_xdisplay(); [ DllImport( "gdk-x11-2.0" ) ] static extern int gdk_x11_get_default_screen(); [ DllImport( "GL" ) ] public static extern IntPtr glXGetCurrentContext(); [ DllImport( "GL" ) ] public static extern void glXDestroyContext( IntPtr display, IntPtr context ); [ DllImport( "gdk-x11-2.0" ) ] static extern int gdk_x11_drawable_get_xid( IntPtr drawable ); [ DllImport( "GL" ) ] static extern bool glXMakeCurrent ( IntPtr display, int drawableID, IntPtr glxcontext ); [ DllImport( "GL" ) ] static extern void glXSwapBuffers ( IntPtr display, int drawableID ); protected static uint[] stdInitializerOrig = { GLX_RGBA, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, GLX_DOUBLEBUFFER, 0 }; protected static uint[] stdInitializer = { GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, 0 }; public GdkGLContext() : this ( stdInitializer ) { Debug.Indent(); Debug.WriteLine( "Entering GdkGLContext()" ); Debug.WriteLine( "Exiting GdkGLContext()" ); Debug.Unindent(); } public GdkGLContext( uint[] attributeList ) { Debug.Indent(); Debug.WriteLine( "Entering GdkGLContext(uint[])" ); // choose the visual based on attribute list Debug.WriteLine( "gdk_x11_get_default_xdisplay" ); Debug.Write( "preX11get: " ); Debug.WriteLine( xdisplay.ToString() ); xdisplay = gdk_x11_get_default_xdisplay(); if (xdisplay==IntPtr.Zero) throw new NoXDisplayException(); Debug.Write( "postX11get: " ); Debug.WriteLine( xdisplay.ToString() ); Debug.WriteLine( "glXChooseVisual" ); IntPtr visualInfo = glXChooseVisual( xdisplay, gdk_x11_get_default_screen(), attributeList ); if (visualInfo==IntPtr.Zero) throw new NoGLContextException(); try { Debug.WriteLine( "glXCreateContext" ); Debug.Write( "preCreate: " ); Debug.WriteLine( glxcontext.ToString() ); glxcontext = glXCreateContext( xdisplay, visualInfo, IntPtr.Zero, true ); Debug.Write( "postCreate: " ); Debug.WriteLine( glxcontext.ToString() ); } catch (Exception e) { Debug.Write( "==> " ); Debug.WriteLine( e.ToString() ); } finally { Debug.WriteLine( "XFree" ); XFree( visualInfo ); } Debug.WriteLine( "Exiting GdkGLContext(uint[])" ); Debug.Unindent(); } ~GdkGLContext() { Debug.Indent(); Debug.WriteLine( "Entering ~GdkGLContext(uint[])" ); if (glxcontext==glXGetCurrentContext()) { Debug.WriteLine( "glXMakeCurrent" ); glXMakeCurrent( xdisplay, 0, IntPtr.Zero ); } Debug.WriteLine( "glXDestroyContext" ); glXDestroyContext( xdisplay, glxcontext ); Debug.WriteLine( "Exiting ~GdkGLContext()" ); Debug.Unindent(); } public bool MakeCurrent( Window window ) { Debug.Indent(); Debug.WriteLine( "Entering GdkGLContext.MakeCurrent(Window)" ); bool result = false; if (window==null) { Debug.WriteLine( "window not initialized" ); result = false; } else { Debug.WriteLine( "gdk_x11_drawable_get_xid" ); int id = gdk_x11_drawable_get_xid( window.Handle ); Debug.WriteLine( "glXMakeCurrent" ); result = glXMakeCurrent( xdisplay, id, glxcontext ); Debug.WriteLine( "Exiting GdkGLContext.MakeCurrent(Window)*" ); Debug.Indent(); } return result; } public void SwapBuffers( Window window ) { Debug.Indent(); Debug.WriteLine( "Entering GdkGLContext.SwapBuffers(Window)" ); if (window==null) { Debug.WriteLine( "window not initialized" ); } else { Debug.WriteLine( "gdk_x11_drawable_get_xid" ); int id = gdk_x11_drawable_get_xid( window.Handle ); Debug.WriteLine( "glXSwapBuffers" ); glXSwapBuffers( xdisplay, id ); } Debug.WriteLine( "Exiting GdkGLContext.SwapBuffers(Window)" ); Debug.Unindent(); } } } } --- NEW FILE: PublicKeyFile.snk --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Makefile --- FILES=csdGLBase.cs csdGL.cs csdGLUBase.cs csdGLUTBase.cs Exceptions.cs GTKLIBS=glib-sharp.dll gtk-sharp.dll gdk-sharp.dll GTKLIBOPTS=$(foreach lib,$(GTKLIBS),-r $(lib)) GEN=mono ../generator/csdGenerator.exe CC=mcs DEBUG=/d:DEBUG DEBUG= OPTS=$(DEBUG) -lib:/usr/lib/mono/gtk-sharp MCS=$(CC) $(OPTS) PACKAGE=csDragons GAC=gacutil $(GACUTIL_FLAGS) all: csdGL.dll csdGL_Gtk.dll csdGL.dll: AssemblyInfo_csdGL.cs $(FILES) $(MCS) -target:library $^ -out:$@ csdGL_Gtk.dll: gtkContext.cs csdGLXTokens.cs gtkArea.cs AssemblyInfo_csdGLGtk.cs $(FILES) $(MCS) -target:library $(GTKLIBOPTS) $^ -out:$@ csdGLXTokens.cs: glxtokens_8h.xml $(GEN) glxtokens_8h.xml libcsdGL.so csdGLXTokens System.Object csdGLXTokens.cs csdGLBase.cs: gl_8h.xml glut_8h.xml $(GEN) gl_8h.xml libcsdGL.so csdGLBase System.Object csdGLBase.cs csdGLUBase.cs: gl_8h.xml glu_8h.xml $(GEN) glu_8h.xml libcsdGL.so csdGLUBase csdGLBase csdGLUBase.cs gl_8h.xml csdGLUTBase.cs: gl_8h.xml glut_8h.xml $(GEN) glut_8h.xml libcsdGL.so csdGLUTBase csdGLUBase csdGLUTBase.cs gl_8h.xml gl_8h.xml: ln -sf ../doxygen/xml/gl_8h.xml . glu_8h.xml: ln -sf ../doxygen/xml/glu_8h.xml . glut_8h.xml: ln -sf ../doxygen/xml/glut_8h.xml . glxtokens_8h.xml: ln -sf ../doxygen/xml/glxtokens_8h.xml . install: install-gac install-gac: csdGL.dll csdGL_Gtk.dll $(GAC) /i csdGL.dll /f /package $(PACKAGE) $(GAC) /i csdGL_Gtk.dll /f /package $(PACKAGE) uninstall: uninstall-gac uninstall-gac: $(GAC) /u csdGL $(GAC) /u csdGL_Gtk clean: rm -f *.exe rm -f *.dll rm -f csdGLBase.cs rm -f csdGLUBase.cs rm -f csdGLUTBase.cs rm -f csdGLXTokens.cs .IGNORE: clean .EXPORT_ALL_VARIABLES: .PHONY: clean --- NEW FILE: csdGL.cs --- using System; using System.Diagnostics; namespace csDragons { namespace OpenGL { /** \brief Main class for csdGL * * This class combines all OpenGL functionality. */ public class csdGL : csdGLUTBase { /** \brief control flag for type of error handling * * If this attribute is set to true then the extended * OpenGL methods will automatically check for errors and * raise Exceptions. */ public bool raiseExceptions = true; /** \brief check OpenGL-Error flag * * This method checks the OpenGL error flag and raises the corresponding * Exception if an error is available. */ public void checkErrors() { Debug.Indent(); Debug.WriteLine( "Entering csdGL.checkErros()" ); uint error = glGetError(); if (error==GL_INVALID_ENUM) { Debug.WriteLine( "OpenGL-Error: GL_INVALID_ENUM" ); throw new GLInvalidEnumException(); } else if (error==GL_INVALID_VALUE) { Debug.WriteLine( "OpenGL-Error: GL_INVALID_VALUE" ); throw new GLInvalidValue(); } else if (error==GL_INVALID_OPERATION) { Debug.WriteLine( "OpenGL-Error: GL_INVALID_OPERATION" ); throw new GLInvalidOperation(); } else if (error==GL_STACK_OVERFLOW) { Debug.WriteLine( "OpenGL-Error: GL_STACK_OVERFLOW" ); throw new GLStackOverflow(); } else if (error==GL_STACK_UNDERFLOW) { Debug.WriteLine( "OpenGL-Error: GL_STACK_UNDERFLOW" ); throw new GLStackUnderflow(); } else if (error==GL_OUT_OF_MEMORY) { Debug.WriteLine( "OpenGL-Error: GL_OUT_OF_MEMORY" ); throw new GLOutOfMemory(); } Debug.WriteLine( "Exiting csdGL.checkErros()" ); Debug.Unindent(); } /** \brief retrieve errors and ignore them * * This method resets the OpenGL error flag and ignores * the error. */ public void ignoreErrors() { Debug.Indent(); Debug.WriteLine( "Entering csdGL.ignoreErros()" ); try { checkErrors(); } catch ( GLException e ) { Debug.WriteLine( e.ToString() ); } Debug.WriteLine( "Exiting csdGL.ignoreErrors()" ); Debug.Unindent(); } /** \brief get OpenGL flag * * This methode returns the value of a flag. It calls checkErrors() for * error handling * @param flag Specifies a symbolic constant indicating a GL capability */ protected bool getFlag( uint flag ) { Debug.Indent(); Debug.WriteLine( "Entering csdGL.getFlag( uint )" ); bool result = GL_TRUE==glIsEnabled( flag ); if (raiseExceptions) { checkErrors(); } Debug.WriteLine( "Exiting csdGL.getFlag( uint )*" ); Debug.Unindent(); return result; } /** \brieg set OpenGL flag * * This methode sets the state for a specific OpenGL flag. It calls * checkErrors() for error handling. * @param flag specifies a symbolic constant indicating a GL capability * @param state specifies whether the flag shall be turned on or off */ protected void setFlag( uint flag, bool state ) { Debug.Indent(); Debug.WriteLine( "Entering csdGL.setFlag( uint, bool )" ); if (state) { glEnable( flag ); } else { glDisable( flag ); } if (raiseExceptions) { checkErrors(); } Debug.WriteLine( "Exiting csdGL.setFlag( uint, bool )" ); Debug.Unindent(); } /** \brief If enabled, do alpha testing. */ public bool AlphaTest { get { return getFlag( GL_ALPHA_TEST ); } set { setFlag( GL_ALPHA_TEST, value ); } } /** \brief If enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. */ public bool AutoNormal { get { return getFlag( GL_AUTO_NORMAL ); } set { setFlag( GL_AUTO_NORMAL, value ); } } /** \brief If enabled, blend the incoming RGBA color values with the values in the color buffers. */ public bool Blend { get { return getFlag( GL_BLEND ); } set { setFlag( GL_BLEND, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 0. */ public bool ClipPlane0 { get { return getFlag( GL_CLIP_PLANE0 ); } set { setFlag( GL_CLIP_PLANE0, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 1. */ public bool ClipPlane1 { get { return getFlag( GL_CLIP_PLANE1 ); } set { setFlag( GL_CLIP_PLANE1, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 2. */ public bool ClipPlane2 { get { return getFlag( GL_CLIP_PLANE2 ); } set { setFlag( GL_CLIP_PLANE2, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 3. */ public bool ClipPlane3 { get { return getFlag( GL_CLIP_PLANE3 ); } set { setFlag( GL_CLIP_PLANE3, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 4. */ public bool ClipPlane4 { get { return getFlag( GL_CLIP_PLANE4 ); } set { setFlag( GL_CLIP_PLANE4, value ); } } /** \brief If enabled, clip geometry against user-defined clipping plane 5. */ public bool ClipPlane5 { get { return getFlag( GL_CLIP_PLANE5 ); } set { setFlag( GL_CLIP_PLANE5, value ); } } /** \brief If enabled, have one or more material parameters track the current color. */ public bool ColorMaterial { get { return getFlag( GL_COLOR_MATERIAL ); } set { setFlag( GL_COLOR_MATERIAL, value ); } } /** \brief If enabled, cull polygons based on their winding in window coordinates. */ public bool CullFace{ get { return getFlag( GL_CULL_FACE ); } set { setFlag( GL_CULL_FACE, value ); } } /** \brief If enabled, do depth comparisons and update the depth buffer. */ public bool DepthTest { get { return getFlag( GL_DEPTH_TEST ); } set { setFlag( GL_DEPTH_TEST, value ); } } /** \brief If enabled, dither color components or indices before they are written to the color buffer. */ public bool Dither { get { return getFlag( GL_DITHER ); } set { setFlag( GL_DITHER, value ); } } /** \brief If enabled, blend a fog color into the posttexturing color. */ public bool Fog { get { return getFlag( GL_FOG ); } set { setFlag( GL_FOG, value ); } } /** \brief If enabled, include light 0 in the evaluation of the lighting equation. */ public bool Light0 { get { return getFlag( GL_LIGHT0 ); } set { setFlag( GL_LIGHT0, value ); } } /** \brief If enabled, include light 1 in the evaluation of the lighting equation. */ public bool Light1 { get { return getFlag( GL_LIGHT1 ); } set { setFlag( GL_LIGHT1, value ); } } /** \brief If enabled, include light 2 in the evaluation of the lighting equation. */ public bool Light2 { get { return getFlag( GL_LIGHT2 ); } set { setFlag( GL_LIGHT2, value ); } } /** \brief If enabled, include light 3 in the evaluation of the lighting equation. */ public bool Light3 { get { return getFlag( GL_LIGHT3 ); } set { setFlag( GL_LIGHT3, value ); } } /** \brief If enabled, include light 4 in the evaluation of the lighting equation. */ public bool Light4 { get { return getFlag( GL_LIGHT4 ); } set { setFlag( GL_LIGHT4, value ); } } /** \brief If enabled, include light 5 in the evaluation of the lighting equation. */ public bool Light5 { get { return getFlag( GL_LIGHT5 ); } set { setFlag( GL_LIGHT5, value ); } } /** \brief If enabled, include light 6 in the evaluation of the lighting equation. */ public bool Light6 { get { return getFlag( GL_LIGHT6 ); } set { setFlag( GL_LIGHT6, value ); } } /** \brief If enabled, include light 7 in the evaluation of the lighting equation. */ public bool Light7 { get { return getFlag( GL_LIGHT7 ); } set { setFlag( GL_LIGHT7, value ); } } /** \brief If enabled, use the current lighting parameters to compute the vertex color or index. Otherwise, simply associate the current color or index with each vertex. */ public bool Lighting { get { return getFlag( GL_LIGHTING ); } set { setFlag( GL_LIGHTING, value ); } } /** \brief If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. */ public bool LineSmooth { get { return getFlag( GL_LINE_SMOOTH ); } set { setFlag( GL_LINE_SMOOTH, value ); } } /** \brief If enabled, use the current line stipple pattern when drawing lines. */ public bool LineStipple { get { return getFlag( GL_LINE_STIPPLE ); } set { setFlag( GL_LINE_STIPPLE, value ); } } /** \brief If enabled, apply the currently selected logical operation to the incoming and and color buffer indices. */ public bool LogicOp { get { return getFlag( GL_LOGIC_OP ); } set { setFlag( GL_LOGIC_OP, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate RGBA values. */ public bool Map1Color4 { get { return getFlag( GL_MAP1_COLOR_4 ); } set { setFlag( GL_MAP1_COLOR_4, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate color indices. */ public bool Map1Index { get { return getFlag( GL_MAP1_INDEX ); } set { setFlag( GL_MAP1_INDEX, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate normals. */ public bool Map1Normal { get { return getFlag( GL_MAP1_NORMAL ); } set { setFlag( GL_MAP1_NORMAL, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s texture coordinates. */ public bool Map1TectureCoord1 { get { return getFlag( GL_MAP1_TEXTURE_COORD_1 ); } set { setFlag( GL_MAP1_TEXTURE_COORD_1, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s and t texture coordinates. */ public bool Map1TectureCoord2 { get { return getFlag( GL_MAP1_TEXTURE_COORD_2 ); } set { setFlag( GL_MAP1_TEXTURE_COORD_2, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s, t and r texture coordinates. */ public bool Map1TectureCoord3 { get { return getFlag( GL_MAP1_TEXTURE_COORD_3 ); } set { setFlag( GL_MAP1_TEXTURE_COORD_3, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s, t, r and q texture coordinates. */ public bool Map1TectureCoord4 { get { return getFlag( GL_MAP1_TEXTURE_COORD_4 ); } set { setFlag( GL_MAP1_TEXTURE_COORD_4, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate x, y and z vertex coordinates. */ public bool Map1Vertex3 { get { return getFlag( GL_MAP1_VERTEX_3 ); } set { setFlag( GL_MAP1_VERTEX_3, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate homogeneous x, y, z and w vertex coordinates. */ public bool Map1Vertex4 { get { return getFlag( GL_MAP1_VERTEX_4 ); } set { setFlag( GL_MAP1_VERTEX_4, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate RGBA values. */ public bool Map2Color4 { get { return getFlag( GL_MAP2_COLOR_4 ); } set { setFlag( GL_MAP2_COLOR_4, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate color indices. */ public bool Map2Index { get { return getFlag( GL_MAP2_INDEX ); } set { setFlag( GL_MAP2_INDEX, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate normals. */ public bool Map2Normal { get { return getFlag( GL_MAP2_NORMAL ); } set { setFlag( GL_MAP2_NORMAL, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s texture coordinates. */ public bool Map2TectureCoord1 { get { return getFlag( GL_MAP2_TEXTURE_COORD_1 ); } set { setFlag( GL_MAP2_TEXTURE_COORD_1, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s and t texture coordinates. */ public bool Map2TectureCoord2 { get { return getFlag( GL_MAP2_TEXTURE_COORD_2 ); } set { setFlag( GL_MAP2_TEXTURE_COORD_2, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s, t and r texture coordinates. */ public bool Map2TectureCoord3 { get { return getFlag( GL_MAP2_TEXTURE_COORD_3 ); } set { setFlag( GL_MAP2_TEXTURE_COORD_3, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate s, t, r and q texture coordinates. */ public bool Map2TectureCoord4 { get { return getFlag( GL_MAP2_TEXTURE_COORD_4 ); } set { setFlag( GL_MAP2_TEXTURE_COORD_4, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate x, y and z vertex coordinates. */ public bool Map2Vertex3 { get { return getFlag( GL_MAP2_VERTEX_3 ); } set { setFlag( GL_MAP2_VERTEX_3, value ); } } /** \brief If enabled, calls to glEvalCoord1, glEvalMesh1 and glEvalPoint1 will generate homogeneous x, y, z and w vertex coordinates. */ public bool Map2Vertex4 { get { return getFlag( GL_MAP2_VERTEX_4 ); } set { setFlag( GL_MAP2_VERTEX_4, value ); } } /** \brief If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. */ public bool Normalize { get { return getFlag( GL_NORMALIZE ); } set { setFlag( GL_NORMALIZE, value ); } } /** \brief If enabled, draw points with proper filtering. Otherwise, draw aliased points. */ public bool PointSmooth { get { return getFlag( GL_POINT_SMOOTH ); } set { setFlag( GL_POINT_SMOOTH, value ); } } /** \brief If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. */ public bool PolygonSmooth { get { return getFlag( GL_POLYGON_SMOOTH ); } set { setFlag( GL_POLYGON_SMOOTH, value ); } } /** \brief If enabled, use the current polygon stipple patttern when rendering polygons. */ public bool PolygonStipple { get { return getFlag( GL_POLYGON_STIPPLE ); } set { setFlag( GL_POLYGON_STIPPLE, value ); } } /** \brief If enabled, discard fragments that are outside the scissor rectangle. */ public bool ScissorTest { get { return getFlag( GL_SCISSOR_TEST ); } set { setFlag( GL_SCISSOR_TEST, value ); } } /** \brief If enabled, do stencil testing and update the stencil buffer. */ public bool StencilTest { get { return getFlag( GL_STENCIL_TEST ); } set { setFlag( GL_STENCIL_TEST, value ); } } /** \brief If enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). */ public bool Texture1D { get { return getFlag( GL_TEXTURE_1D ); } set { setFlag( GL_TEXTURE_1D, value ); } } /** \brief If enabled, two-dimensional texturing is performed. */ public bool Texture2D { get { return getFlag( GL_TEXTURE_2D ); } set { setFlag( GL_TEXTURE_2D, value ); } } /** \brief If enabled, the q texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current q texture coordinate is used. */ public bool TextureGenQ { get { return getFlag( GL_TEXTURE_GEN_Q ); } set { setFlag( GL_TEXTURE_GEN_Q, value ); } } /** \brief If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current r texture coordinate is used. */ public bool TextureGenR { get { return getFlag( GL_TEXTURE_GEN_R ); } set { setFlag( GL_TEXTURE_GEN_R, value ); } } /** \brief If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current s texture coordinate is used. */ public bool TextureGenS { get { return getFlag( GL_TEXTURE_GEN_S ); } set { setFlag( GL_TEXTURE_GEN_S, value ); } } /** \brief If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current t texture coordinate is used. */ public bool TextureGenT { get { return getFlag( GL_TEXTURE_GEN_T ); } set { setFlag( GL_TEXTURE_GEN_T, value ); } } } } } --- NEW FILE: AssemblyInfo_csdGLGtk.cs --- using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following // attributes. // // change them to the information which is associated with the assembly // you compile. [assembly: AssemblyTitle("csDragons.OpenGL")] [assembly: AssemblyDescription("Wrapper-Library for OpenGL with Gtk#-Widget")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("csDragons")] [assembly: AssemblyProduct("csDragons OpenGL.NET")] [assembly: AssemblyCopyright("(C)Copyright 2004 by Tim Rädisch & Kai Reichert")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has following format : // // Major.Minor.Build.Revision // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): [assembly: AssemblyVersion("0.1.*")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. // This is not required, if you don't want signing let these attributes like they're. [assembly: AssemblyDelaySign(true)] [assembly: AssemblyKeyFile("PublicKeyFile.snk")] --- NEW FILE: Exceptions.cs --- using System; namespace csDragons { namespace OpenGL { /** \brief General OpenGL Error * * This class is the base class for all OpenGL Exceptions */ public class GLException : Exception {}; /** \brief Invalid OpenGL enumeration value * * An unacceptable value is specified for an enumerated argument. * The offending command is ignored, having no side effect other than to set the error flag. */ public class GLInvalidEnumException : GLException {}; /** \brief Invalid OpenGL argument value * * A numeric argument is out of range. The offending command is ignored, * having no side effect other than to set the error flag. */ public class GLInvalidValue : GLException {}; /** \brief Invalid OpenGL operation * * The specified operation is not allowed in the current state. * The offending command is ignored, having no side effect other than to set the error flag. */ public class GLInvalidOperation : GLException {}; /** \brief Stack Overflow * * This command would cause a stack overflow. The offending command is * ignored, having no side effect other than to set the error flag. */ public class GLStackOverflow : GLException {}; /** \brief Stack Underflow * * This command would cause a stack underflow. The offending command is * ignored, having no side effect other than to set the error flag. */ public class GLStackUnderflow : GLException {}; /** \brief Out of Memory * * There is not enough memory left to execute the command. The state of * the GL is undefined, except for the state of the error flags, after this error is recorded. */ public class GLOutOfMemory : GLException {}; /** \brief No GL Context available * * This Exception is raised if there is an fatal error * during obtaining the OpenGL context. */ public class NoGLContextException : GLException {} /** \brief No X Display available * * This Exception is raised if no XDisplay can be used. */ public class NoXDisplayException : GLException {} } } |