You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(69) |
Sep
(120) |
Oct
(17) |
Nov
(7) |
Dec
|
---|
From: Tim R. <ti...@us...> - 2004-08-05 13:09:24
|
Update of /cvsroot/csdopenglnet/csdOpenGL/Cg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21768/Cg Added Files: Makefile Log Message: Cg binding --- NEW FILE: Makefile --- FILES=csdGLBase.cs csdGL.cs csdGLUBase.cs csdGLUTBase.cs Exceptions.cs 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: csdCgBase.cs cg_8h.xml: ln -sf ../doxygen/cg_xml/cg_8h.xml . csdCgBase.cs: cg_8h.xml $(GEN) cg_8h.xml libcsdGL.so csdCgBase System.Object csdCgBase.cs 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 csdCgBase.cs .IGNORE: clean .EXPORT_ALL_VARIABLES: .PHONY: clean |
From: Tim R. <ti...@us...> - 2004-08-05 13:09:24
|
Update of /cvsroot/csdopenglnet/csdOpenGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21768 Modified Files: Makefile Log Message: Cg binding Index: Makefile =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 31 Jul 2004 18:00:39 -0000 1.4 --- Makefile 5 Aug 2004 13:09:14 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- $(MAKE) -C cbonding $(MAKE) -C generator + $(MAKE) -C GL $(MAKE) -C math $(MAKE) -C tools *************** *** 12,23 **** $(MAKE) -C samples - install: ! $(MAKE) -C generator install $(MAKE) -C tools install $(MAKE) -C cbonding install uninstall: ! $(MAKE) -C generator uninstall $(MAKE) -C tools uninstall $(MAKE) -C cbonding uninstall --- 13,23 ---- $(MAKE) -C samples install: ! $(MAKE) -C GL install $(MAKE) -C tools install $(MAKE) -C cbonding install uninstall: ! $(MAKE) -C GL uninstall $(MAKE) -C tools uninstall $(MAKE) -C cbonding uninstall *************** *** 31,34 **** --- 31,35 ---- $(MAKE) -C samples clean $(MAKE) -C tools clean + $(MAKE) -C GL clean .IGNORE: |
From: Tim R. <ti...@us...> - 2004-08-05 12:58:42
|
Update of /cvsroot/csdopenglnet/csdOpenGL/GL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19773/GL Log Message: Directory /cvsroot/csdopenglnet/csdOpenGL/GL added to the repository |
From: Tim R. <ti...@us...> - 2004-08-05 12:58:30
|
Update of /cvsroot/csdopenglnet/csdOpenGL/Cg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19755/Cg Log Message: Directory /cvsroot/csdopenglnet/csdOpenGL/Cg added to the repository |
From: Tim R. <ti...@us...> - 2004-08-02 08:31:57
|
Update of /cvsroot/csdopenglnet/tutorials/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25834/gtk Added Files: Framework.cs Makefile lesson01.cs lesson02.cs Log Message: gtk widget --- NEW FILE: lesson01.cs --- using csDragons.OpenGL; using GLib; using GdkSharp; using Gtk; using GtkSharp; using System; using System.Diagnostics; public class Lesson01 : Framework { public Lesson01() : base( "Lesson 01" ) {} public static void Main( string[] args) { Debug.Listeners.Add( new TextWriterTraceListener( Console.Out ) ); Debug.AutoFlush = true; Lesson01 gl = new Lesson01(); } } --- NEW FILE: Framework.cs --- using csDragons.OpenGL; using GLib; using GdkSharp; using Gtk; using GtkSharp; using System; using System.Diagnostics; public class Framework : csdGL { protected Gtk.Window window; protected GtkGLArea glarea; protected Entry rotX_entry; protected Entry rotY_entry; protected Entry rotZ_entry; protected Entry speedX_entry; protected Entry speedY_entry; protected Entry speedZ_entry; protected Button reset_btn; protected ToggleButton animate_tglbtn; protected Button update_btn; protected float propRotX, propRotY, propRotZ; protected float propSpeedX, propSpeedY, propSpeedZ; protected bool propAnimate; protected bool stop = true; protected double mouseX = 0.0; protected double mouseY = 0.0; public Framework( string title ) : this() { window.Title = title; } public Framework() { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvaned()" ); Debug.WriteLine( "Init Application" ); Application.Init(); Debug.WriteLine( "Init Window" ); window = new Gtk.Window( "Gtk Frame" ); window.ReallocateRedraws = true; window.DeleteEvent += new DeleteEventHandler( OnDeleteEvent ); window.Resize( 640, 480 ); Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); glarea.Events = Gdk.EventMask.PointerMotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask; glarea.Realized += new EventHandler( OnRealized ); glarea.ConfigureEvent += new ConfigureEventHandler( OnConfigure ); glarea.ExposeEvent += new ExposeEventHandler( OnExpose ); glarea.MapEvent += new MapEventHandler( OnMap ); glarea.UnmapEvent += new UnmapEventHandler( OnUnmap ); glarea.MotionNotifyEvent += new MotionNotifyEventHandler( OnMotionNotify ); glarea.ButtonReleaseEvent += new ButtonReleaseEventHandler( OnButtonRelease ); glarea.ButtonPressEvent += new ButtonPressEventHandler( OnButtonPress ); Debug.WriteLine( "Init rotation entry fields" ); rotX_entry = new Entry(); rotX_entry.ActivatesDefault = true; rotY_entry = new Entry(); rotY_entry.ActivatesDefault = true; rotZ_entry = new Entry(); rotZ_entry.ActivatesDefault = true; Debug.WriteLine( "Init speed entry fields" ); speedX_entry = new Entry(); speedX_entry.ActivatesDefault = true; speedY_entry = new Entry(); speedY_entry.ActivatesDefault = true; speedZ_entry = new Entry(); speedZ_entry.ActivatesDefault = true; Debug.WriteLine( "Init Table-Layout rotTable" ); Table rotTable = new Table( 2, 3, false ); rotTable.Attach( new Label( "x-rotation: " ), 0, 1, 0, 1 ); rotTable.Attach( rotX_entry, 1, 2, 0, 1 ); rotTable.Attach( new Label( "y-rotation: " ), 0, 1, 1, 2 ); rotTable.Attach( rotY_entry, 1, 2, 1, 2 ); rotTable.Attach( new Label( "z-rotation: " ), 0, 1, 2, 3 ); rotTable.Attach( rotZ_entry, 1, 2, 2, 3 ); Debug.WriteLine( "Init Table-Layout speedTable" ); Table speedTable = new Table( 2, 3, false ); speedTable.Attach( new Label( "x-speed: " ), 0, 1, 0, 1 ); speedTable.Attach( speedX_entry, 1, 2, 0, 1 ); speedTable.Attach( new Label( "y-speed: " ), 0, 1, 1, 2 ); speedTable.Attach( speedY_entry, 1, 2, 1, 2 ); speedTable.Attach( new Label( "z-speed: " ), 0, 1, 2, 3 ); speedTable.Attach( speedZ_entry, 1, 2, 2, 3 ); Debug.WriteLine( "Init buttons" ); animate_tglbtn = new ToggleButton( "Animate" ); animate_tglbtn.Toggled += new EventHandler( OnButton ); reset_btn = new Button( "Reset" ); reset_btn.Clicked += new EventHandler( OnButton ); update_btn = new Button( "Update" ); update_btn.Clicked += new EventHandler( OnButton ); update_btn.CanFocus = true; update_btn.CanDefault = true; window.Default = update_btn; Debug.WriteLine( "Init Table-Layout buttonTable" ); Table buttonTable = new Table( 3, 1, true ); buttonTable.Attach( animate_tglbtn, 0, 1, 0, 1 ); buttonTable.Attach( reset_btn, 0, 1, 1, 2 ); buttonTable.Attach( update_btn, 0, 1, 2, 3 ); Debug.WriteLine( "Init HBox-Layout hbox" ); HBox hbox = new HBox( false, 4 ); hbox.PackStart( rotTable, false, true, 5 ); hbox.PackStart( speedTable, false, true, 5 ); hbox.PackEnd( buttonTable, false, true, 5 ); Debug.WriteLine( "Init VBox-Layout vbox" ); VBox vbox = new VBox( false, 2 ); vbox.PackStart( glarea, true, true, 5 ); vbox.PackEnd( hbox, false, true, 5 ); Debug.WriteLine( "Display Window" ); window.Add( vbox ); window.ShowAll(); setDefaults(); Debug.WriteLine( "MainLoop" ); Application.Run (); Debug.WriteLine( "Exiting GtkAdvaned()" ); Debug.Unindent(); } protected void updateValues() { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.updateValues()" ); bool p = animate; animate = false; Debug.WriteLine( "Setting speed" ); try { speedX = System.Convert.ToSingle( speedX_entry.Text ); } catch { speedX_entry.Text = speedX.ToString(); } try { speedY = System.Convert.ToSingle( speedY_entry.Text ); } catch { speedY_entry.Text = speedY.ToString(); } try { speedZ = System.Convert.ToSingle( speedZ_entry.Text ); } catch { speedZ_entry.Text = speedZ.ToString(); } Debug.WriteLine( "Setting angle" ); try { rotX = System.Convert.ToSingle( rotX_entry.Text ); } catch { rotX_entry.Text = rotX.ToString(); } try { rotY = System.Convert.ToSingle( rotY_entry.Text ); } catch { rotY_entry.Text = rotY.ToString(); } try { rotZ = System.Convert.ToSingle( rotZ_entry.Text ); } catch { rotZ_entry.Text = rotZ.ToString(); } animate = p; Debug.WriteLine( "Exiting GtkAdvanced.updateValues()" ); Debug.Unindent(); } protected void setDefaults() { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.setDefaults()" ); animate = false; rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; speedX = 0.1f; speedY = 0.2f; speedZ = 0.5f; Debug.WriteLine( "Exiting GtkAdvanced.setDefaults()" ); Debug.Unindent(); } protected bool Animate () { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.Animate()" ); rotX += speedX; rotY += speedY; rotZ += speedZ; if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); Debug.WriteLine( "Entering GtkAdvanced.Animate() *" ); Debug.Unindent(); return animate; } protected void OnMap (object obj, MapEventArgs args) { Debug.Indent(); Debug.WriteLine( "Enering GtkAdvanced.OnMap( object, MapEventArgs )" ); stop = false; Debug.WriteLine( "Exiting GtkAdvanced.OnMap( object, MapEventArgs )" ); Debug.Unindent(); } protected void OnUnmap (object obj, UnmapEventArgs args) { Debug.Indent(); Debug.WriteLine( "Enering GtkAdvanced.OnUnmap( object, UnapEventArgs )" ); stop = true; Debug.WriteLine( "Exiting GtkAdvanced.OnUnmap( object, UnapEventArgs )" ); Debug.Unindent(); } protected virtual void OnExpose (object obj, ExposeEventArgs args) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnExpose( object, ExposeEventArgs )" ); if (glarea.MakeCurrent()) { glClearColor( 0, 0, 0, 0 ); glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPushMatrix(); glRotatef( rotX, 1.0f, 0.0f, 0.0f ); glRotatef( rotY, 0.0f, 1.0f, 0.0f ); glRotatef( rotZ, 0.0f, 0.0f, 1.0f ); draw(); glPopMatrix(); glarea.SwapBuffers(); } else Debug.WriteLine( "MakeCurrent() failed" ); Debug.WriteLine( "Exiting GtkAdvanced.OnExpose( object, ExposeEventArgs )" ); Debug.Unindent(); } protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnMotionNotify( object, MotionNotifyEventArgs )" ); if ( (args.Event.State==Gdk.ModifierType.Button1Mask) || (args.Event.State==Gdk.ModifierType.Button3Mask) ) { int w = 0; int h = 0; glarea.GdkWindow.GetSize( out w, out h ); if ( args.Event.State==Gdk.ModifierType.Button1Mask ) { if ( mouseX>=0.0 ) { Debug.WriteLine( "y-rotation" ); rotY += ((float)(args.Event.X-mouseX)) * 360.0f / w; } else mouseX = args.Event.X; if ( mouseY>=0.0 ) { Debug.WriteLine( "x-rotation" ); rotX += ((float)(args.Event.Y-mouseY)) * 360.0f / h; mouseY = args.Event.Y; } else mouseY = args.Event.Y; } if ( args.Event.State==Gdk.ModifierType.Button3Mask ) { if ( mouseX>=0.0 ) { Debug.WriteLine( "y-rotation" ); rotZ += ((float)(args.Event.X-mouseX)) * 360.0f / w; } else mouseX = args.Event.X; } mouseX = args.Event.X; } Debug.WriteLine( "Exiting GtkAdvanced.OnMotionNotify( object, MotionNotifyEventArgs )" ); Debug.Unindent(); } protected void OnButtonPress( object obj, ButtonPressEventArgs args ) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnButtonPress( object, ButtonPressEventArgs )" ); mouseX = args.Event.X; mouseY = args.Event.Y; Debug.WriteLine( "Exiting GtkAdvanced.OnButtonPress( object, ButtonPressEventArgs )" ); Debug.Unindent(); } protected void OnButtonRelease( object obj, ButtonReleaseEventArgs args ) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnButtonRelease( object, ButtonReleaseEventArgs )" ); mouseX = -1.0; mouseY = -1.0; Debug.WriteLine( "Exiting GtkAdvanced.OnButtonRelease( object, ButtonReleaseEventArgs )" ); Debug.Unindent(); } protected virtual void draw() { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.draw()" ); Debug.WriteLine( "Exiting GtkAdvanced.draw()" ); Debug.Unindent(); } protected virtual void OnConfigure (object obj, ConfigureEventArgs args) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); if (glarea.MakeCurrent()) { glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); double h = (double) glarea.Allocation.Height / (double) (glarea.Allocation.Width); glFrustum( -1.0, 1.0, -h, h, 5.0f, 5.0 ); Console.WriteLine( glGetError() ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); } else Debug.WriteLine( "MakeCurrent() failed" ); Debug.WriteLine( "Exiting GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); Debug.Unindent(); } protected void OnRealized (object obj, EventArgs args) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnRealized( object, EventArgs )" ); if (glarea.MakeCurrent()) { glShadeModel( GL_SMOOTH ); glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); glClearDepth( 1.0f ); //glEnable( GL_DEPTH_TEST ); DepthTest = true; glDepthFunc( GL_LEQUAL ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); } else Debug.WriteLine( "MakeCurrent() failed" ); Debug.WriteLine( "Exiting GtkAdvanced.OnRealized( object, EventArgs )" ); Debug.Unindent(); } protected void OnButton( object obj, EventArgs args ) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnButton( objec, EventArgs )" ); if (obj==reset_btn) { setDefaults(); } else if (obj==animate_tglbtn) { animate = animate_tglbtn.Active; } else if (obj==update_btn) { updateValues(); } Debug.WriteLine( "Exiting GtkAdvanced.OnButton( objec, EventArgs )" ); Debug.Unindent(); } protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Debug.Indent(); Debug.WriteLine( "Entering GtkAdvanced.OnDeleteEvent( object, DeleteEventArgs )" ); Application.Quit (); Debug.WriteLine( "Exiting GtkAdvanced.OnDeleteEvent( object, DeleteEventArgs )" ); Debug.Unindent(); } protected float rotX { get { Debug.WriteLine( "rotX->get" ); return propRotX; } set { Debug.WriteLine( "rotX->set" ); propRotX = value; while (propRotX<0) propRotX += 360.0f; while (propRotX>=360.0f) propRotX -= 360.0f; rotX_entry.Text = propRotX.ToString(); if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } protected float rotY { get { Debug.WriteLine( "rotY->get" ); return propRotY; } set { Debug.WriteLine( "rotY->set" ); propRotY = value; while (propRotY<0) propRotY += 360.0f; while (propRotY>=360.0f) propRotY -= 360.0f; rotY_entry.Text = propRotY.ToString(); if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } protected float rotZ { get { Debug.WriteLine( "rotZ->get" ); return propRotZ; } set { Debug.WriteLine( "rotZ->set" ); propRotZ = value; while (propRotZ<0) propRotZ += 360.0f; while (propRotZ>=360.0f) propRotZ -= 360.0f; rotZ_entry.Text = propRotZ.ToString(); if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } protected float speedX { get { Debug.WriteLine( "speedX->get" ); return propSpeedX; } set { Debug.WriteLine( "speedX->set" ); propSpeedX = value; while (propSpeedX<=-360.0f) propSpeedX += 360.0f; while (propSpeedX>=360.0f) propSpeedX -= 360.0f; speedX_entry.Text = propSpeedX.ToString(); } } protected float speedY { get { Debug.WriteLine( "speedY->get" ); return propSpeedY; } set { Debug.WriteLine( "speedY->set" ); propSpeedY = value; while (propSpeedY<=-360.0f) propSpeedY += 360.0f; while (propSpeedY>=360.0f) propSpeedY -= 360.0f; speedY_entry.Text = propSpeedY.ToString(); } } protected float speedZ { get { Debug.WriteLine( "speedZ->get" ); return propSpeedZ; } set { Debug.WriteLine( "speedZ->set" ); propSpeedZ = value; while (propSpeedZ<=-360.0f) propSpeedZ += 360.0f; while (propSpeedZ>=360.0f) propSpeedZ -= 360.0f; speedZ_entry.Text = propSpeedZ.ToString(); } } protected bool animate { get { Debug.WriteLine( "animate->get" ); return propAnimate; } set { Debug.WriteLine( "animate->set" ); if ( value && !propAnimate ) GLib.Idle.Add (new IdleHandler (Animate)); propAnimate = value; animate_tglbtn.Active = value; } } } --- NEW FILE: Makefile --- CC=mcs DEBUG=/d:DEBUG DEBUG= OPTS=$(DEBUG) LIBS=csdGL_Gtk.dll csdMath.dll csdGLtools.dll MCS=$(CC) $(OPTS) -lib:/usr/lib/mono/gtk-sharp -lib:/usr/lib/mono/csDragons PACKAGE=csDragons LIBOPTS=$(foreach lib,$(LIBS),-r $(lib)) all: lesson01.exe lesson02.exe %.exe:%.cs Framework.cs $(MCS) -r:glib-sharp.dll -r:gdk-sharp.dll -r:gtk-sharp.dll -r:csdGL_Gtk.dll $^ -o $@ clean: rm -f *.exe .IGNORE: clean .EXPORT_ALL_VARIABLES: .PHONY: clean --- NEW FILE: lesson02.cs --- using csDragons.OpenGL; using System; using System.Diagnostics; public class Lesson02 : Framework { public Lesson02() : base( "Lesson 02" ) {} protected override void draw() { if (glarea.MakeCurrent()) { glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPushMatrix(); glLoadIdentity(); glTranslatef(-1.5f,0.0f,-6.0f); glBegin(GL_TRIANGLES); glVertex3f( 0.0f, 1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f); glEnd(); glTranslatef( 3.0f, 0.0f, 0.0f); glBegin(GL_QUADS); glVertex3f(-1.0f, 1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f); glEnd(); glPopMatrix(); } else Debug.WriteLine( "MakeCurrent() failed!" ); } public static void Main( string[] args) { Debug.Listeners.Add( new TextWriterTraceListener( Console.Out ) ); Debug.AutoFlush = true; Lesson02 gl = new Lesson02(); } } |
From: Tim R. <ti...@us...> - 2004-08-02 08:27:53
|
Update of /cvsroot/csdopenglnet/tutorials/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25747/gtk Log Message: Directory /cvsroot/csdopenglnet/tutorials/gtk added to the repository |
From: Tim R. <ti...@us...> - 2004-08-02 08:27:45
|
Update of /cvsroot/csdopenglnet/csdOpenGL/doxygen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25589/doxygen Modified Files: Makefile Log Message: small syntax error Index: Makefile =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/doxygen/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 27 Jul 2004 13:38:46 -0000 1.3 --- Makefile 2 Aug 2004 08:27:31 -0000 1.4 *************** *** 1,17 **** ! all: base ! ! base: xml/gl_8h.xml - freeglut: xml/freeglut_8h.xml xml/gl_8h.xml: /usr/include/GL/gl.h doxygen doxygen.conf - xml/freeglut_8h.xml: /usr/include/GL/freeglut.h - doxygen freeglut.conf - - all: - doxygen doxygen.conf - clean: rm -rf html --- 1,8 ---- ! all: xml/gl_8h.xml xml/gl_8h.xml: /usr/include/GL/gl.h doxygen doxygen.conf clean: rm -rf html |
From: Tim R. <ti...@us...> - 2004-08-02 08:27:45
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25589/generator Modified Files: gtkArea.cs Log Message: small syntax error Index: gtkArea.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/gtkArea.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtkArea.cs 1 Aug 2004 13:42:01 -0000 1.4 --- gtkArea.cs 2 Aug 2004 08:27:32 -0000 1.5 *************** *** 71,75 **** * * This method causes OpenGL to swap buffers if possible, ! */s public void SwapBuffers() { Debug.Indent(); --- 71,75 ---- * * This method causes OpenGL to swap buffers if possible, ! */ public void SwapBuffers() { Debug.Indent(); |
From: Tim R. <ti...@us...> - 2004-08-01 13:42:09
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31733 Modified Files: gtkArea.cs typedef.cs Removed Files: Gears.cs TimsGLGtk.cs gear.cs test.cs Log Message: cleanup --- Gears.cs DELETED --- Index: gtkArea.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/gtkArea.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkArea.cs 27 Jul 2004 13:38:46 -0000 1.3 --- gtkArea.cs 1 Aug 2004 13:42:01 -0000 1.4 *************** *** 7,16 **** --- 7,26 ---- 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(); *************** *** 25,28 **** --- 35,42 ---- } + /** + * This constructor creates the GLX context with the specified parameters + * @param attr GLX parameter list + */ public GtkGLArea( uint[] attr) : base(type) { Debug.Indent(); *************** *** 36,40 **** Debug.Unindent(); } ! public bool MakeCurrent() { Debug.Indent(); --- 50,59 ---- 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(); *************** *** 49,52 **** --- 68,75 ---- } + /** \brief OpenGL swapBuffers() + * + * This method causes OpenGL to swap buffers if possible, + */s public void SwapBuffers() { Debug.Indent(); --- test.cs DELETED --- --- TimsGLGtk.cs DELETED --- --- gear.cs DELETED --- Index: typedef.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/typedef.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** typedef.cs 12 Jul 2004 17:17:55 -0000 1.1.1.1 --- typedef.cs 1 Aug 2004 13:42:01 -0000 1.2 *************** *** 101,104 **** --- 101,111 ---- } + /** \brief this method adds a callback + * + * This method creates a callback representing delegate with unique name. + * @param param the callback parameters + * @param name the name of the function, which uses this callback as parameter + * @param c the position inside the parameterlist + */ public void addCallBack( string param, string name, int c ) { string ret = ""; *************** *** 146,149 **** --- 153,157 ---- } + protected string buildPar( string s ) { int i = s.LastIndexOf( ' ' ); // find crossover between type and name *************** *** 181,184 **** --- 189,196 ---- } + /** \brief write delegates + * + * This method writes the created delegates + */ public void write() { Debug.Indent(); |
From: Tim R. <ti...@us...> - 2004-08-01 13:26:54
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29602/generator Modified Files: Makefile csdGL.cs gtkContext.cs Added Files: Exceptions.cs Log Message: added a property for each glEnabled-flag Index: gtkContext.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/gtkContext.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtkContext.cs 27 Jul 2004 13:38:46 -0000 1.5 --- gtkContext.cs 1 Aug 2004 13:26:42 -0000 1.6 *************** *** 7,13 **** using System.Runtime.InteropServices; - public class NoGLContextException : Exception {} - public class NoXDisplayException : Exception {} - public class GdkGLContext : csdGLXTokens { --- 7,10 ---- *************** *** 78,82 **** IntPtr visualInfo = glXChooseVisual( xdisplay, gdk_x11_get_default_screen(), attributeList ); ! if (xdisplay==IntPtr.Zero) throw new NoGLContextException(); try { --- 75,79 ---- IntPtr visualInfo = glXChooseVisual( xdisplay, gdk_x11_get_default_screen(), attributeList ); ! if (visualInfo==IntPtr.Zero) throw new NoGLContextException(); try { Index: Makefile =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 27 Jul 2004 11:24:53 -0000 1.7 --- Makefile 1 Aug 2004 13:26:42 -0000 1.8 *************** *** 1,5 **** FILES=generator.cs AssemblyInfo.cs define.cs typedef.cs function.cs ! GLUTFILES=csdGLBase.cs csdGL.cs csdGLUBase.cs csdGLUTBase.cs csdFreeGLUTBase.cs csdFreeGLUT_extBase.cs csdFreeGLUT_stdBase.cs ! GLFILES=csdGLBase.cs csdGL.cs csdGLUBase.cs csdGLUTBase.cs CC=mcs --- 1,4 ---- FILES=generator.cs AssemblyInfo.cs define.cs typedef.cs function.cs ! GLFILES=csdGLBase.cs csdGL.cs csdGLUBase.cs csdGLUTBase.cs Exceptions.cs CC=mcs *************** *** 34,46 **** mono ./csdGenerator.exe glut_8h.xml libcsdGL.so csdGLUTBase csdGLUBase csdGLUTBase.cs gl_8h.xml - csdFreeGLUTBase.cs: csdGenerator.exe gl_8h.xml freeglut_8h.xml - mono ./csdGenerator.exe freeglut_8h.xml libcsdGL.so csdFreeGLUTBase csdGLUBase csdFreeGLUTBase.cs gl_8h.xml - - csdFreeGLUT_extBase.cs: csdGenerator.exe gl_8h.xml freeglut_ext_8h.xml - mono ./csdGenerator.exe freeglut_ext_8h.xml libcsdGL.so csdFreeGLUT_extBase csdFreeGLUTBase csdFreeGLUT_extBase.cs glu_8h.xml gl_8h.xml - - csdFreeGLUT_stdBase.cs: csdGenerator.exe gl_8h.xml freeglut_std_8h.xml - mono ./csdGenerator.exe freeglut_std_8h.xml libcsdGL.so csdFreeGLUT_stdBase csdFreeGLUT_extBase csdFreeGLUT_stdBase.cs glu_8h.xml gl_8h.xml - gl_8h.xml: --- 33,36 ---- *************** *** 53,65 **** ln -sf ../doxygen/xml/glut_8h.xml . - freeglut_8h.xml: - ln -sf ../doxygen/xml/freeglut_8h.xml . - - freeglut_std_8h.xml: - ln -sf ../doxygen/xml/freeglut_std_8h.xml . - - freeglut_ext_8h.xml: - ln -sf ../doxygen/xml/freeglut_ext_8h.xml . - glxtokens_8h.xml: ln -sf ../doxygen/xml/glxtokens_8h.xml . --- 43,46 ---- Index: csdGL.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/csdGL.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** csdGL.cs 1 Aug 2004 10:55:47 -0000 1.2 --- csdGL.cs 1 Aug 2004 13:26:42 -0000 1.3 *************** *** 1,11 **** using System; ! using System.Runtime.InteropServices; ! namespace csDragons { namespace OpenGL { public class csdGL : csdGLUTBase { } --- 1,515 ---- 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: 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 {} } } |
From: Tim R. <ti...@us...> - 2004-08-01 13:26:50
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29602/samples Modified Files: gtkAdvanced.cs Log Message: added a property for each glEnabled-flag Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gtkAdvanced.cs 31 Jul 2004 18:00:40 -0000 1.8 --- gtkAdvanced.cs 1 Aug 2004 13:26:42 -0000 1.9 *************** *** 129,133 **** bool p = animate; animate = false; ! Debug.WriteLine( "Setting speed" ); try { --- 129,133 ---- bool p = animate; animate = false; ! Debug.WriteLine( "Setting speed" ); try { *************** *** 322,335 **** Debug.WriteLine( "Entering GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); ! if (glarea.MakeCurrent()) { glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); - glMatrixMode( GL_PROJECTION ); glLoadIdentity(); ! float h = (float) glarea.Allocation.Height / (float) (glarea.Allocation.Width); ! glFrustum( -1.0f, 1.0f, -h, h, 5.0f, 5.0f ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); - glEnd(); } else Debug.WriteLine( "MakeCurrent() failed" ); --- 322,334 ---- Debug.WriteLine( "Entering GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); ! if (glarea.MakeCurrent()) { glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); ! double h = (double) glarea.Allocation.Height / (double) (glarea.Allocation.Width); ! glFrustum( -1.0, 1.0, -h, h, 5.0f, 5.0 ); ! Console.WriteLine( glGetError() ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); } else Debug.WriteLine( "MakeCurrent() failed" ); *************** *** 346,350 **** glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); glClearDepth( 1.0f ); ! glEnable( GL_DEPTH_TEST ); glDepthFunc( GL_LEQUAL ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); --- 345,350 ---- glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); glClearDepth( 1.0f ); ! //glEnable( GL_DEPTH_TEST ); ! DepthTest = true; glDepthFunc( GL_LEQUAL ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); |
From: Tim R. <ti...@us...> - 2004-08-01 10:55:55
|
Update of /cvsroot/csdopenglnet/csdOpenGL/cbonding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31045/cbonding Modified Files: Makefile csdGL.c csdGL.h Removed Files: libtest.cs Log Message: removed manual dllimport-calls Index: Makefile =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/cbonding/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 17 Jul 2004 17:30:40 -0000 1.4 --- Makefile 1 Aug 2004 10:55:46 -0000 1.5 *************** *** 4,8 **** ! all: libcsdGL.so libtest.exe libcsdGL.so: csdGL.o --- 4,8 ---- ! all: libcsdGL.so libcsdGL.so: csdGL.o --- libtest.cs DELETED --- Index: csdGL.h =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/cbonding/csdGL.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** csdGL.h 12 Jul 2004 17:18:12 -0000 1.1.1.1 --- csdGL.h 1 Aug 2004 10:55:47 -0000 1.2 *************** *** 7,27 **** #include <stdlib.h> - typedef void (*DisplayFunc) (void); - typedef void (*KeyboardFunc) (unsigned char key, int x, int y); - typedef void (*TimerFunc) (int value); - typedef void (*ReshapeFunc) (int width, int height); - - void csdReshapeFunc( ReshapeFunc func ); - void csdTimerFunc( unsigned int millis, TimerFunc func, int value ); - void csdSwapBuffers(); - void csdInitDisplayMode( unsigned int mode ); - void csdInitWindowSize( int width, int height ); - void csdMainLoop(); - int csdCreateWindow( const char *title ); - void csdDisplayFunc( DisplayFunc func ); - void csdKeyboardFunc( KeyboardFunc func ); - void csdPostRedisplay(); - - void arrayTest( const float elems[] ); - #endif --- 7,9 ---- Index: csdGL.c =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/cbonding/csdGL.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** csdGL.c 12 Jul 2004 17:18:12 -0000 1.1.1.1 --- csdGL.c 1 Aug 2004 10:55:47 -0000 1.2 *************** *** 1,49 **** #include "csdGL.h" - void csdSwapBuffers() { - glutSwapBuffers(); - } - - void csdReshapeFunc( ReshapeFunc func ) { - glutReshapeFunc( func ); - } - - void csdInitDisplayMode( unsigned int mode ) { - glutInitDisplayMode( mode ); - } - - void csdInitWindowSize( int width, int height ) { - glutInitWindowSize( width, height ); - } - - void csdMainLoop() { - glutMainLoop(); - } - - int csdCreateWindow( const char *title ) { - return glutCreateWindow( title ); - } - - void csdDisplayFunc( DisplayFunc func ) { - glutDisplayFunc( func ); - } - - void csdKeyboardFunc( KeyboardFunc func ) { - glutKeyboardFunc( func ); - } - - void csdPostRedisplay() { - glutPostRedisplay(); - } - - void csdTimerFunc( unsigned int millis, TimerFunc func, int value ) { - glutTimerFunc( millis, func, value ); - } - - void arrayTest( const float elems[] ) { - printf( "HALLO\n" ); - int i = 0; - for ( i=0; i<16; i++ ) { - printf( "==> %f\n", elems[i] ); - } - } --- 1,2 ---- |
From: Tim R. <ti...@us...> - 2004-08-01 10:55:55
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31045/generator Modified Files: csdGL.cs Log Message: removed manual dllimport-calls Index: csdGL.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/csdGL.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** csdGL.cs 12 Jul 2004 17:17:56 -0000 1.1.1.1 --- csdGL.cs 1 Aug 2004 10:55:47 -0000 1.2 *************** *** 6,47 **** namespace OpenGL { - public delegate void cbDisplayFunc(); - public delegate void cbKeyboardFunc( byte key, int x, int y ); - public delegate void cbTimerFunc( int value ); - public delegate void cbReshapeFunc( int width, int height ); - public class csdGL : csdGLUTBase { - const string lib = "libcsdGL.so"; - - [ DllImport(lib) ] - public static extern void csdReshapeFunc( cbReshapeFunc func ); - - [ DllImport(lib) ] - public static extern void csdTimerFunc( uint millis, cbTimerFunc func, int value ); - - [ DllImport(lib) ] - public static extern void csdSwapBuffers(); - - [ DllImport(lib) ] - public static extern void csdInitDisplayMode( uint mode ); - - [ DllImport(lib) ] - public static extern void csdInitWindowSize( int width, int height ); - - [ DllImport(lib) ] - public static extern void csdMainLoop(); - - [ DllImport(lib) ] - public static extern int csdCreateWindow( string title ); - - [ DllImport(lib) ] - public static extern void csdDisplayFunc( cbDisplayFunc func ); - - [ DllImport(lib) ] - public static extern void csdKeyboardFunc( cbKeyboardFunc func ); - - [ DllImport(lib) ] - public static extern void csdPostRedisplay(); } --- 6,11 ---- |
From: Tim R. <ti...@us...> - 2004-07-31 18:00:50
|
Update of /cvsroot/csdopenglnet/csdOpenGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30200 Modified Files: Makefile Log Message: mouse rotation for all axis Index: Makefile =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 19 Jul 2004 16:45:37 -0000 1.3 --- Makefile 31 Jul 2004 18:00:39 -0000 1.4 *************** *** 9,13 **** $(MAKE) -C doc ! test: all $(MAKE) -C samples --- 9,13 ---- $(MAKE) -C doc ! test: $(MAKE) -C samples |
From: Tim R. <ti...@us...> - 2004-07-31 18:00:50
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30200/samples Modified Files: gtkAdvanced.cs Log Message: mouse rotation for all axis Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gtkAdvanced.cs 31 Jul 2004 16:41:11 -0000 1.7 --- gtkAdvanced.cs 31 Jul 2004 18:00:40 -0000 1.8 *************** *** 124,130 **** --- 124,134 ---- protected void updateValues() { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.updateValues()" ); + bool p = animate; animate = false; + Debug.WriteLine( "Setting speed" ); try { speedX = System.Convert.ToSingle( speedX_entry.Text ); *************** *** 143,146 **** --- 147,151 ---- } + Debug.WriteLine( "Setting angle" ); try { rotX = System.Convert.ToSingle( rotX_entry.Text ); *************** *** 160,166 **** --- 165,176 ---- animate = p; + Debug.WriteLine( "Exiting GtkAdvanced.updateValues()" ); + Debug.Unindent(); } protected void setDefaults() { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.setDefaults()" ); + animate = false; rotX = 0.0f; *************** *** 170,192 **** --- 180,227 ---- speedY = 0.2f; speedZ = 0.5f; + + Debug.WriteLine( "Exiting GtkAdvanced.setDefaults()" ); + Debug.Unindent(); } protected bool Animate () { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.Animate()" ); + rotX += speedX; rotY += speedY; rotZ += speedZ; if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); + + Debug.WriteLine( "Entering GtkAdvanced.Animate() *" ); + Debug.Unindent(); + return animate; } protected void OnMap (object obj, MapEventArgs args) { + Debug.Indent(); + Debug.WriteLine( "Enering GtkAdvanced.OnMap( object, MapEventArgs )" ); + stop = false; + + Debug.WriteLine( "Exiting GtkAdvanced.OnMap( object, MapEventArgs )" ); + Debug.Unindent(); } protected void OnUnmap (object obj, UnmapEventArgs args) { + Debug.Indent(); + Debug.WriteLine( "Enering GtkAdvanced.OnUnmap( object, UnapEventArgs )" ); + stop = true; + + Debug.WriteLine( "Exiting GtkAdvanced.OnUnmap( object, UnapEventArgs )" ); + Debug.Unindent(); } protected virtual void OnExpose (object obj, ExposeEventArgs args) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnExpose( object, ExposeEventArgs )" ); + if (glarea.MakeCurrent()) { glClearColor( 0, 0, 0, 0 ); *************** *** 199,236 **** glPopMatrix(); glarea.SwapBuffers(); ! } } protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { ! ! if (args.Event.State==Gdk.ModifierType.Button1Mask) { int w = 0; int h = 0; glarea.GdkWindow.GetSize( out w, out h ); ! if ( mouseX>=0.0 ) { ! rotY += ((float)(args.Event.X-mouseX)) * 360.0f / w; ! mouseX = args.Event.X; ! } else mouseX = args.Event.X; ! ! if ( mouseY>=0.0 ) { ! rotX += ((float)(args.Event.Y-mouseY)) * 360.0f / h; ! mouseY = args.Event.Y; ! } else mouseY = args.Event.Y; } } protected void OnButtonPress( object obj, ButtonPressEventArgs args ) { mouseX = args.Event.X; mouseY = args.Event.Y; } protected void OnButtonRelease( object obj, ButtonReleaseEventArgs args ) { mouseX = -1.0; mouseY = -1.0; } protected virtual void draw() { if (glarea.MakeCurrent()) { glTranslatef( -0.5f, -0.5f, 0.0f ); --- 234,305 ---- glPopMatrix(); glarea.SwapBuffers(); ! } else Debug.WriteLine( "MakeCurrent() failed" ); ! ! Debug.WriteLine( "Exiting GtkAdvanced.OnExpose( object, ExposeEventArgs )" ); ! Debug.Unindent(); } protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { ! Debug.Indent(); ! Debug.WriteLine( "Entering GtkAdvanced.OnMotionNotify( object, MotionNotifyEventArgs )" ); ! ! if ( (args.Event.State==Gdk.ModifierType.Button1Mask) || (args.Event.State==Gdk.ModifierType.Button3Mask) ) { int w = 0; int h = 0; glarea.GdkWindow.GetSize( out w, out h ); + + if ( args.Event.State==Gdk.ModifierType.Button1Mask ) { + if ( mouseX>=0.0 ) { + Debug.WriteLine( "y-rotation" ); + rotY += ((float)(args.Event.X-mouseX)) * 360.0f / w; + } else mouseX = args.Event.X; + if ( mouseY>=0.0 ) { + Debug.WriteLine( "x-rotation" ); + rotX += ((float)(args.Event.Y-mouseY)) * 360.0f / h; + mouseY = args.Event.Y; + } else mouseY = args.Event.Y; + } ! if ( args.Event.State==Gdk.ModifierType.Button3Mask ) { ! if ( mouseX>=0.0 ) { ! Debug.WriteLine( "y-rotation" ); ! rotZ += ((float)(args.Event.X-mouseX)) * 360.0f / w; ! } else mouseX = args.Event.X; ! } + mouseX = args.Event.X; + } + + Debug.WriteLine( "Exiting GtkAdvanced.OnMotionNotify( object, MotionNotifyEventArgs )" ); + Debug.Unindent(); } protected void OnButtonPress( object obj, ButtonPressEventArgs args ) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnButtonPress( object, ButtonPressEventArgs )" ); + mouseX = args.Event.X; mouseY = args.Event.Y; + + Debug.WriteLine( "Exiting GtkAdvanced.OnButtonPress( object, ButtonPressEventArgs )" ); + Debug.Unindent(); } protected void OnButtonRelease( object obj, ButtonReleaseEventArgs args ) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnButtonRelease( object, ButtonReleaseEventArgs )" ); + mouseX = -1.0; mouseY = -1.0; + + Debug.WriteLine( "Exiting GtkAdvanced.OnButtonRelease( object, ButtonReleaseEventArgs )" ); + Debug.Unindent(); } protected virtual void draw() { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.draw()" ); + if (glarea.MakeCurrent()) { glTranslatef( -0.5f, -0.5f, 0.0f ); *************** *** 243,250 **** glVertex2f( 1.0f, 0.0f); glEnd(); ! } ! } protected virtual void OnConfigure (object obj, ConfigureEventArgs args) { if (glarea.MakeCurrent()) { glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); --- 312,325 ---- glVertex2f( 1.0f, 0.0f); glEnd(); ! } else Debug.WriteLine( "MakeCurrent() failed!" ); ! ! Debug.WriteLine( "Exiting GtkAdvanced.draw()" ); ! Debug.Unindent(); ! } protected virtual void OnConfigure (object obj, ConfigureEventArgs args) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); + if (glarea.MakeCurrent()) { glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); *************** *** 256,274 **** glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); - //glTranslatef( 0.0f, 0.0f, -40.0f); glEnd(); ! } } protected void OnRealized (object obj, EventArgs args) { ! glShadeModel( GL_SMOOTH ); ! glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); ! glClearDepth( 1.0f ); ! glEnable( GL_DEPTH_TEST ); ! glDepthFunc( GL_LEQUAL ); ! glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); } protected void OnButton( object obj, EventArgs args ) { if (obj==reset_btn) { setDefaults(); --- 331,362 ---- glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glEnd(); ! } else Debug.WriteLine( "MakeCurrent() failed" ); ! ! Debug.WriteLine( "Exiting GtkAdvanced.OnConfigure( object, ConfigureEventArgs )" ); ! Debug.Unindent(); } protected void OnRealized (object obj, EventArgs args) { ! Debug.Indent(); ! Debug.WriteLine( "Entering GtkAdvanced.OnRealized( object, EventArgs )" ); ! ! if (glarea.MakeCurrent()) { ! glShadeModel( GL_SMOOTH ); ! glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); ! glClearDepth( 1.0f ); ! glEnable( GL_DEPTH_TEST ); ! glDepthFunc( GL_LEQUAL ); ! glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); ! } else Debug.WriteLine( "MakeCurrent() failed" ); ! ! Debug.WriteLine( "Exiting GtkAdvanced.OnRealized( object, EventArgs )" ); ! Debug.Unindent(); } protected void OnButton( object obj, EventArgs args ) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnButton( objec, EventArgs )" ); + if (obj==reset_btn) { setDefaults(); *************** *** 278,281 **** --- 366,372 ---- updateValues(); } + + Debug.WriteLine( "Exiting GtkAdvanced.OnButton( objec, EventArgs )" ); + Debug.Unindent(); } *************** *** 291,296 **** protected float rotX { ! get { return propRotX; } set { propRotX = value; while (propRotX<0) propRotX += 360.0f; --- 382,388 ---- protected float rotX { ! get { Debug.WriteLine( "rotX->get" ); return propRotX; } set { + Debug.WriteLine( "rotX->set" ); propRotX = value; while (propRotX<0) propRotX += 360.0f; *************** *** 302,307 **** protected float rotY { ! get { return propRotY; } set { propRotY = value; while (propRotY<0) propRotY += 360.0f; --- 394,400 ---- protected float rotY { ! get { Debug.WriteLine( "rotY->get" ); return propRotY; } set { + Debug.WriteLine( "rotY->set" ); propRotY = value; while (propRotY<0) propRotY += 360.0f; *************** *** 313,318 **** protected float rotZ { ! get { return propRotZ; } set { propRotZ = value; while (propRotZ<0) propRotZ += 360.0f; --- 406,412 ---- protected float rotZ { ! get { Debug.WriteLine( "rotZ->get" ); return propRotZ; } set { + Debug.WriteLine( "rotZ->set" ); propRotZ = value; while (propRotZ<0) propRotZ += 360.0f; *************** *** 324,329 **** protected float speedX { ! get { return propSpeedX; } set { propSpeedX = value; while (propSpeedX<=-360.0f) propSpeedX += 360.0f; --- 418,424 ---- protected float speedX { ! get { Debug.WriteLine( "speedX->get" ); return propSpeedX; } set { + Debug.WriteLine( "speedX->set" ); propSpeedX = value; while (propSpeedX<=-360.0f) propSpeedX += 360.0f; *************** *** 334,339 **** protected float speedY { ! get { return propSpeedY; } set { propSpeedY = value; while (propSpeedY<=-360.0f) propSpeedY += 360.0f; --- 429,435 ---- protected float speedY { ! get { Debug.WriteLine( "speedY->get" ); return propSpeedY; } set { + Debug.WriteLine( "speedY->set" ); propSpeedY = value; while (propSpeedY<=-360.0f) propSpeedY += 360.0f; *************** *** 344,349 **** protected float speedZ { ! get { return propSpeedZ; } set { propSpeedZ = value; while (propSpeedZ<=-360.0f) propSpeedZ += 360.0f; --- 440,446 ---- protected float speedZ { ! get { Debug.WriteLine( "speedZ->get" ); return propSpeedZ; } set { + Debug.WriteLine( "speedZ->set" ); propSpeedZ = value; while (propSpeedZ<=-360.0f) propSpeedZ += 360.0f; *************** *** 354,359 **** protected bool animate { ! get { return propAnimate; } set { if ( value && !propAnimate ) GLib.Idle.Add (new IdleHandler (Animate)); propAnimate = value; --- 451,457 ---- protected bool animate { ! get { Debug.WriteLine( "animate->get" ); return propAnimate; } set { + Debug.WriteLine( "animate->set" ); if ( value && !propAnimate ) GLib.Idle.Add (new IdleHandler (Animate)); propAnimate = value; |
From: Tim R. <ti...@us...> - 2004-07-31 16:41:19
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17891 Modified Files: gtkAdvanced.cs Log Message: mouse rotation with speed commensurate to window size Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gtkAdvanced.cs 31 Jul 2004 16:29:45 -0000 1.6 --- gtkAdvanced.cs 31 Jul 2004 16:41:11 -0000 1.7 *************** *** 203,214 **** protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { ! if (args.Event.State==Gdk.ModifierType.Button1Mask) { if ( mouseX>=0.0 ) { ! rotY += ((float)(args.Event.X-mouseX)) * speedY; } else mouseX = args.Event.X; if ( mouseY>=0.0 ) { ! rotX += ((float)(args.Event.Y-mouseY)) * speedX; } else mouseY = args.Event.Y; } } --- 203,222 ---- protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { ! if (args.Event.State==Gdk.ModifierType.Button1Mask) { + int w = 0; + int h = 0; + glarea.GdkWindow.GetSize( out w, out h ); + if ( mouseX>=0.0 ) { ! rotY += ((float)(args.Event.X-mouseX)) * 360.0f / w; ! mouseX = args.Event.X; } else mouseX = args.Event.X; + if ( mouseY>=0.0 ) { ! rotX += ((float)(args.Event.Y-mouseY)) * 360.0f / h; ! mouseY = args.Event.Y; } else mouseY = args.Event.Y; + } } |
From: Tim R. <ti...@us...> - 2004-07-31 16:29:54
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16560 Modified Files: gtkAdvanced.cs Log Message: first try Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtkAdvanced.cs 31 Jul 2004 16:01:01 -0000 1.5 --- gtkAdvanced.cs 31 Jul 2004 16:29:45 -0000 1.6 *************** *** 25,28 **** --- 25,30 ---- protected bool propAnimate; protected bool stop = true; + protected double mouseX = 0.0; + protected double mouseY = 0.0; public GtkAdvanced() { *************** *** 41,52 **** Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); ! glarea.Events = Gdk.EventMask.PointerMotionMask; ! glarea.Realized += new EventHandler (OnRealized); ! glarea.ConfigureEvent += new ConfigureEventHandler (OnConfigure); ! glarea.ExposeEvent += new ExposeEventHandler (OnExpose); ! glarea.MapEvent += new MapEventHandler (OnMap); ! glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! glarea.MotionNotifyEvent += new MotionNotifyEventHandler (OnMotionNotify) ; ! Debug.WriteLine( "Init rotation entry fields" ); rotX_entry = new Entry(); rotX_entry.ActivatesDefault = true; --- 43,56 ---- Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); ! glarea.Events = Gdk.EventMask.PointerMotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask; ! glarea.Realized += new EventHandler( OnRealized ); ! glarea.ConfigureEvent += new ConfigureEventHandler( OnConfigure ); ! glarea.ExposeEvent += new ExposeEventHandler( OnExpose ); ! glarea.MapEvent += new MapEventHandler( OnMap ); ! glarea.UnmapEvent += new UnmapEventHandler( OnUnmap ); ! glarea.MotionNotifyEvent += new MotionNotifyEventHandler( OnMotionNotify ); ! glarea.ButtonReleaseEvent += new ButtonReleaseEventHandler( OnButtonRelease ); ! glarea.ButtonPressEvent += new ButtonPressEventHandler( OnButtonPress ); ! Debug.WriteLine( "Init rotation entry fields" ); rotX_entry = new Entry(); rotX_entry.ActivatesDefault = true; *************** *** 198,206 **** } ! protected void OnMotionNotify( object obj, MotionNotifyEventArgs args){ ! Console.WriteLine( args.Event.X ); } --- 202,225 ---- } ! protected void OnMotionNotify( object obj, MotionNotifyEventArgs args) { ! if (args.Event.State==Gdk.ModifierType.Button1Mask) { ! if ( mouseX>=0.0 ) { ! rotY += ((float)(args.Event.X-mouseX)) * speedY; ! } else mouseX = args.Event.X; ! if ( mouseY>=0.0 ) { ! rotX += ((float)(args.Event.Y-mouseY)) * speedX; ! } else mouseY = args.Event.Y; ! } ! } + protected void OnButtonPress( object obj, ButtonPressEventArgs args ) { + mouseX = args.Event.X; + mouseY = args.Event.Y; + } + protected void OnButtonRelease( object obj, ButtonReleaseEventArgs args ) { + mouseX = -1.0; + mouseY = -1.0; } *************** *** 270,273 **** --- 289,293 ---- while (propRotX>=360.0f) propRotX -= 360.0f; rotX_entry.Text = propRotX.ToString(); + if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } *************** *** 280,283 **** --- 300,304 ---- while (propRotY>=360.0f) propRotY -= 360.0f; rotY_entry.Text = propRotY.ToString(); + if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } *************** *** 290,293 **** --- 311,315 ---- while (propRotZ>=360.0f) propRotZ -= 360.0f; rotZ_entry.Text = propRotZ.ToString(); + if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); } } |
From: Kai R. <kre...@us...> - 2004-07-31 16:01:10
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11787/samples Modified Files: Makefile.gtk gtkAdvanced.cs Log Message: preliminary mouse event handler added Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtkAdvanced.cs 31 Jul 2004 13:57:25 -0000 1.4 --- gtkAdvanced.cs 31 Jul 2004 16:01:01 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- using csDragons.OpenGL; using GLib; + using GdkSharp; using Gtk; using GtkSharp; *************** *** 8,12 **** public class GtkAdvanced : csdGL { ! protected Window window; protected GtkGLArea glarea; protected Entry rotX_entry; --- 9,13 ---- public class GtkAdvanced : csdGL { ! protected Gtk.Window window; protected GtkGLArea glarea; protected Entry rotX_entry; *************** *** 40,43 **** --- 41,45 ---- Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); + glarea.Events = Gdk.EventMask.PointerMotionMask; glarea.Realized += new EventHandler (OnRealized); glarea.ConfigureEvent += new ConfigureEventHandler (OnConfigure); *************** *** 45,48 **** --- 47,51 ---- glarea.MapEvent += new MapEventHandler (OnMap); glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); + glarea.MotionNotifyEvent += new MotionNotifyEventHandler (OnMotionNotify) ; Debug.WriteLine( "Init rotation entry fields" ); *************** *** 195,198 **** --- 198,208 ---- } + protected void OnMotionNotify( object obj, MotionNotifyEventArgs args){ + + Console.WriteLine( args.Event.X ); + + + } + protected virtual void draw() { if (glarea.MakeCurrent()) { Index: Makefile.gtk =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/Makefile.gtk,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.gtk 31 Jul 2004 11:45:59 -0000 1.3 --- Makefile.gtk 31 Jul 2004 16:01:01 -0000 1.4 *************** *** 24,28 **** %.exe:%.cs ! $(MCS) -r:glib-sharp.dll -r gtk-sharp.dll -r:csdGL_Gtk.dll -r:csdGLtools.dll -r:csdMath.dll -r:System.Drawing $^ -o $@ --- 24,28 ---- %.exe:%.cs ! $(MCS) -r:glib-sharp.dll -r:gdk-sharp.dll -r:gtk-sharp.dll -r:csdGL_Gtk.dll -r:csdGLtools.dll -r:csdMath.dll -r:System.Drawing $^ -o $@ |
From: Tim R. <ti...@us...> - 2004-07-31 13:57:35
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26235 Modified Files: gtkAdvanced.cs Log Message: all but mouse Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkAdvanced.cs 31 Jul 2004 12:48:22 -0000 1.3 --- gtkAdvanced.cs 31 Jul 2004 13:57:25 -0000 1.4 *************** *** 16,21 **** protected Entry speedY_entry; protected Entry speedZ_entry; - public GtkAdvanced() { Debug.Indent(); --- 16,28 ---- protected Entry speedY_entry; protected Entry speedZ_entry; + protected Button reset_btn; + protected ToggleButton animate_tglbtn; + protected Button update_btn; + + protected float propRotX, propRotY, propRotZ; + protected float propSpeedX, propSpeedY, propSpeedZ; + protected bool propAnimate; + protected bool stop = true; public GtkAdvanced() { Debug.Indent(); *************** *** 33,46 **** Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); Debug.WriteLine( "Init rotation entry fields" ); ! rotX_entry = new Entry(); ! rotY_entry = new Entry(); ! rotZ_entry = new Entry(); Debug.WriteLine( "Init speed entry fields" ); ! speedX_entry = new Entry(); ! speedY_entry = new Entry(); ! speedZ_entry = new Entry(); Debug.WriteLine( "Init Table-Layout rotTable" ); --- 40,58 ---- Debug.WriteLine( "Init GtkGLArea" ); glarea = new GtkGLArea(); + glarea.Realized += new EventHandler (OnRealized); + glarea.ConfigureEvent += new ConfigureEventHandler (OnConfigure); + glarea.ExposeEvent += new ExposeEventHandler (OnExpose); + glarea.MapEvent += new MapEventHandler (OnMap); + glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); Debug.WriteLine( "Init rotation entry fields" ); ! rotX_entry = new Entry(); rotX_entry.ActivatesDefault = true; ! rotY_entry = new Entry(); rotY_entry.ActivatesDefault = true; ! rotZ_entry = new Entry(); rotZ_entry.ActivatesDefault = true; Debug.WriteLine( "Init speed entry fields" ); ! speedX_entry = new Entry(); speedX_entry.ActivatesDefault = true; ! speedY_entry = new Entry(); speedY_entry.ActivatesDefault = true; ! speedZ_entry = new Entry(); speedZ_entry.ActivatesDefault = true; Debug.WriteLine( "Init Table-Layout rotTable" ); *************** *** 62,69 **** speedTable.Attach( speedZ_entry, 1, 2, 2, 3 ); Debug.WriteLine( "Init Table-Layout buttonTable" ); ! Table buttonTable = new Table( 2, 1, true ); ! buttonTable.Attach( new ToggleButton( "Animate" ), 0, 1, 0, 1 ); ! buttonTable.Attach( new Button( "Reset" ), 0, 1, 1, 2 ); Debug.WriteLine( "Init HBox-Layout hbox" ); --- 74,93 ---- speedTable.Attach( speedZ_entry, 1, 2, 2, 3 ); + Debug.WriteLine( "Init buttons" ); + animate_tglbtn = new ToggleButton( "Animate" ); + animate_tglbtn.Toggled += new EventHandler( OnButton ); + reset_btn = new Button( "Reset" ); + reset_btn.Clicked += new EventHandler( OnButton ); + update_btn = new Button( "Update" ); + update_btn.Clicked += new EventHandler( OnButton ); + update_btn.CanFocus = true; + update_btn.CanDefault = true; + window.Default = update_btn; + Debug.WriteLine( "Init Table-Layout buttonTable" ); ! Table buttonTable = new Table( 3, 1, true ); ! buttonTable.Attach( animate_tglbtn, 0, 1, 0, 1 ); ! buttonTable.Attach( reset_btn, 0, 1, 1, 2 ); ! buttonTable.Attach( update_btn, 0, 1, 2, 3 ); Debug.WriteLine( "Init HBox-Layout hbox" ); *************** *** 75,79 **** Debug.WriteLine( "Init VBox-Layout vbox" ); VBox vbox = new VBox( false, 2 ); ! vbox.PackStart( new Button( "GL" ), true, true, 5 ); vbox.PackEnd( hbox, false, true, 5 ); --- 99,103 ---- Debug.WriteLine( "Init VBox-Layout vbox" ); VBox vbox = new VBox( false, 2 ); ! vbox.PackStart( glarea, true, true, 5 ); vbox.PackEnd( hbox, false, true, 5 ); *************** *** 81,84 **** --- 105,111 ---- window.Add( vbox ); window.ShowAll(); + + setDefaults(); + Debug.WriteLine( "MainLoop" ); Application.Run (); *************** *** 88,92 **** --- 115,246 ---- } + + protected void updateValues() { + bool p = animate; + animate = false; + + try { + speedX = System.Convert.ToSingle( speedX_entry.Text ); + } catch { + speedX_entry.Text = speedX.ToString(); + } + try { + speedY = System.Convert.ToSingle( speedY_entry.Text ); + } catch { + speedY_entry.Text = speedY.ToString(); + } + try { + speedZ = System.Convert.ToSingle( speedZ_entry.Text ); + } catch { + speedZ_entry.Text = speedZ.ToString(); + } + + try { + rotX = System.Convert.ToSingle( rotX_entry.Text ); + } catch { + rotX_entry.Text = rotX.ToString(); + } + try { + rotY = System.Convert.ToSingle( rotY_entry.Text ); + } catch { + rotY_entry.Text = rotY.ToString(); + } + try { + rotZ = System.Convert.ToSingle( rotZ_entry.Text ); + } catch { + rotZ_entry.Text = rotZ.ToString(); + } + + animate = p; + } + + protected void setDefaults() { + animate = false; + rotX = 0.0f; + rotY = 0.0f; + rotZ = 0.0f; + speedX = 0.1f; + speedY = 0.2f; + speedZ = 0.5f; + } + protected bool Animate () { + rotX += speedX; + rotY += speedY; + rotZ += speedZ; + if ( (glarea!=null) && (!stop) ) glarea.QueueDraw (); + return animate; + } + + protected void OnMap (object obj, MapEventArgs args) { + stop = false; + } + + protected void OnUnmap (object obj, UnmapEventArgs args) { + stop = true; + } + + protected virtual void OnExpose (object obj, ExposeEventArgs args) { + if (glarea.MakeCurrent()) { + glClearColor( 0, 0, 0, 0 ); + glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + glPushMatrix(); + glRotatef( rotX, 1.0f, 0.0f, 0.0f ); + glRotatef( rotY, 0.0f, 1.0f, 0.0f ); + glRotatef( rotZ, 0.0f, 0.0f, 1.0f ); + draw(); + glPopMatrix(); + glarea.SwapBuffers(); + } + } + + protected virtual void draw() { + if (glarea.MakeCurrent()) { + glTranslatef( -0.5f, -0.5f, 0.0f ); + glBegin( GL_TRIANGLES ); + glColor3f( 1.0f, 0.0f, 0.0f ); + glVertex2f( 0.0f, 0.0f); + glColor3f( 0.0f, 1.0f, 0.0f ); + glVertex2f( 0.5f, 1.0f); + glColor3f( 0.0f, 0.0f, 1.0f ); + glVertex2f( 1.0f, 0.0f); + glEnd(); + } + } + + protected virtual void OnConfigure (object obj, ConfigureEventArgs args) { + if (glarea.MakeCurrent()) { + glViewport(0, 0, glarea.Allocation.Width, glarea.Allocation.Height); + + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + float h = (float) glarea.Allocation.Height / (float) (glarea.Allocation.Width); + glFrustum( -1.0f, 1.0f, -h, h, 5.0f, 5.0f ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + //glTranslatef( 0.0f, 0.0f, -40.0f); + glEnd(); + } + } + + protected void OnRealized (object obj, EventArgs args) { + glShadeModel( GL_SMOOTH ); + glClearColor( 0.0f, 0.0f, 0.0f, 0.5f ); + glClearDepth( 1.0f ); + glEnable( GL_DEPTH_TEST ); + glDepthFunc( GL_LEQUAL ); + glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); + } + + protected void OnButton( object obj, EventArgs args ) { + if (obj==reset_btn) { + setDefaults(); + } else if (obj==animate_tglbtn) { + animate = animate_tglbtn.Active; + } else if (obj==update_btn) { + updateValues(); + } + } + protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Debug.Indent(); *************** *** 99,102 **** --- 253,327 ---- } + protected float rotX { + get { return propRotX; } + set { + propRotX = value; + while (propRotX<0) propRotX += 360.0f; + while (propRotX>=360.0f) propRotX -= 360.0f; + rotX_entry.Text = propRotX.ToString(); + } + } + + protected float rotY { + get { return propRotY; } + set { + propRotY = value; + while (propRotY<0) propRotY += 360.0f; + while (propRotY>=360.0f) propRotY -= 360.0f; + rotY_entry.Text = propRotY.ToString(); + } + } + + protected float rotZ { + get { return propRotZ; } + set { + propRotZ = value; + while (propRotZ<0) propRotZ += 360.0f; + while (propRotZ>=360.0f) propRotZ -= 360.0f; + rotZ_entry.Text = propRotZ.ToString(); + } + } + + protected float speedX { + get { return propSpeedX; } + set { + propSpeedX = value; + while (propSpeedX<=-360.0f) propSpeedX += 360.0f; + while (propSpeedX>=360.0f) propSpeedX -= 360.0f; + speedX_entry.Text = propSpeedX.ToString(); + } + } + + protected float speedY { + get { return propSpeedY; } + set { + propSpeedY = value; + while (propSpeedY<=-360.0f) propSpeedY += 360.0f; + while (propSpeedY>=360.0f) propSpeedY -= 360.0f; + speedY_entry.Text = propSpeedY.ToString(); + } + } + + protected float speedZ { + get { return propSpeedZ; } + set { + propSpeedZ = value; + while (propSpeedZ<=-360.0f) propSpeedZ += 360.0f; + while (propSpeedZ>=360.0f) propSpeedZ -= 360.0f; + speedZ_entry.Text = propSpeedZ.ToString(); + } + } + + protected bool animate { + get { return propAnimate; } + set { + if ( value && !propAnimate ) GLib.Idle.Add (new IdleHandler (Animate)); + propAnimate = value; + animate_tglbtn.Active = value; + } + } + + + public static void Main( string[] args) { Debug.Listeners.Add( new TextWriterTraceListener( Console.Out ) ); |
From: Tim R. <ti...@us...> - 2004-07-31 12:48:37
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16645 Modified Files: gtkAdvanced.cs Log Message: tada Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkAdvanced.cs 31 Jul 2004 12:24:42 -0000 1.2 --- gtkAdvanced.cs 31 Jul 2004 12:48:22 -0000 1.3 *************** *** 13,16 **** --- 13,20 ---- protected Entry rotY_entry; protected Entry rotZ_entry; + protected Entry speedX_entry; + protected Entry speedY_entry; + protected Entry speedZ_entry; + public GtkAdvanced() { *************** *** 34,56 **** rotY_entry = new Entry(); rotZ_entry = new Entry(); ! Debug.WriteLine( "Init Table-Layout table1" ); ! Table table1 = new Table( 2, 3, false ); ! table1.Attach( new Label( "x-rotation: " ), 0, 1, 0, 1 ); ! table1.Attach( rotX_entry, 1, 2, 0, 1 ); ! table1.Attach( new Label( "y-rotation: " ), 0, 1, 1, 2 ); ! table1.Attach( rotY_entry, 1, 2, 1, 2 ); ! table1.Attach( new Label( "z-rotation: " ), 0, 1, 2, 3 ); ! table1.Attach( rotZ_entry, 1, 2, 2, 3 ); ! Debug.WriteLine( "Init Table-Layout table2" ); Debug.WriteLine( "Init HBox-Layout hbox" ); ! HBox hbox = new HBox( false, 2 ); ! hbox.PackStart( table1, false, true, 5 ); Debug.WriteLine( "Init VBox-Layout vbox" ); VBox vbox = new VBox( false, 2 ); ! vbox.PackStart( glarea, true, true, 5 ); vbox.PackEnd( hbox, false, true, 5 ); --- 38,79 ---- rotY_entry = new Entry(); rotZ_entry = new Entry(); + + Debug.WriteLine( "Init speed entry fields" ); + speedX_entry = new Entry(); + speedY_entry = new Entry(); + speedZ_entry = new Entry(); ! Debug.WriteLine( "Init Table-Layout rotTable" ); ! Table rotTable = new Table( 2, 3, false ); ! rotTable.Attach( new Label( "x-rotation: " ), 0, 1, 0, 1 ); ! rotTable.Attach( rotX_entry, 1, 2, 0, 1 ); ! rotTable.Attach( new Label( "y-rotation: " ), 0, 1, 1, 2 ); ! rotTable.Attach( rotY_entry, 1, 2, 1, 2 ); ! rotTable.Attach( new Label( "z-rotation: " ), 0, 1, 2, 3 ); ! rotTable.Attach( rotZ_entry, 1, 2, 2, 3 ); ! Debug.WriteLine( "Init Table-Layout speedTable" ); ! Table speedTable = new Table( 2, 3, false ); ! speedTable.Attach( new Label( "x-speed: " ), 0, 1, 0, 1 ); ! speedTable.Attach( speedX_entry, 1, 2, 0, 1 ); ! speedTable.Attach( new Label( "y-speed: " ), 0, 1, 1, 2 ); ! speedTable.Attach( speedY_entry, 1, 2, 1, 2 ); ! speedTable.Attach( new Label( "z-speed: " ), 0, 1, 2, 3 ); ! speedTable.Attach( speedZ_entry, 1, 2, 2, 3 ); ! ! Debug.WriteLine( "Init Table-Layout buttonTable" ); ! Table buttonTable = new Table( 2, 1, true ); ! buttonTable.Attach( new ToggleButton( "Animate" ), 0, 1, 0, 1 ); ! buttonTable.Attach( new Button( "Reset" ), 0, 1, 1, 2 ); Debug.WriteLine( "Init HBox-Layout hbox" ); ! HBox hbox = new HBox( false, 4 ); ! hbox.PackStart( rotTable, false, true, 5 ); ! hbox.PackStart( speedTable, false, true, 5 ); ! hbox.PackEnd( buttonTable, false, true, 5 ); Debug.WriteLine( "Init VBox-Layout vbox" ); VBox vbox = new VBox( false, 2 ); ! vbox.PackStart( new Button( "GL" ), true, true, 5 ); vbox.PackEnd( hbox, false, true, 5 ); |
From: Tim R. <ti...@us...> - 2004-07-31 12:25:01
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14219 Modified Files: gtkAdvanced.cs Log Message: bka Index: gtkAdvanced.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkAdvanced.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gtkAdvanced.cs 31 Jul 2004 11:45:59 -0000 1.1 --- gtkAdvanced.cs 31 Jul 2004 12:24:42 -0000 1.2 *************** *** 7,10 **** --- 7,78 ---- public class GtkAdvanced : csdGL { + + protected Window window; + protected GtkGLArea glarea; + protected Entry rotX_entry; + protected Entry rotY_entry; + protected Entry rotZ_entry; + + public GtkAdvanced() { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvaned()" ); + + Debug.WriteLine( "Init Application" ); + Application.Init(); + + Debug.WriteLine( "Init Window" ); + window = new Gtk.Window( "Gtk Frame" ); + window.ReallocateRedraws = true; + window.DeleteEvent += new DeleteEventHandler( OnDeleteEvent ); + window.Resize( 640, 480 ); + + Debug.WriteLine( "Init GtkGLArea" ); + glarea = new GtkGLArea(); + + Debug.WriteLine( "Init rotation entry fields" ); + rotX_entry = new Entry(); + rotY_entry = new Entry(); + rotZ_entry = new Entry(); + + Debug.WriteLine( "Init Table-Layout table1" ); + Table table1 = new Table( 2, 3, false ); + table1.Attach( new Label( "x-rotation: " ), 0, 1, 0, 1 ); + table1.Attach( rotX_entry, 1, 2, 0, 1 ); + table1.Attach( new Label( "y-rotation: " ), 0, 1, 1, 2 ); + table1.Attach( rotY_entry, 1, 2, 1, 2 ); + table1.Attach( new Label( "z-rotation: " ), 0, 1, 2, 3 ); + table1.Attach( rotZ_entry, 1, 2, 2, 3 ); + + Debug.WriteLine( "Init Table-Layout table2" ); + + Debug.WriteLine( "Init HBox-Layout hbox" ); + HBox hbox = new HBox( false, 2 ); + hbox.PackStart( table1, false, true, 5 ); + + Debug.WriteLine( "Init VBox-Layout vbox" ); + VBox vbox = new VBox( false, 2 ); + vbox.PackStart( glarea, true, true, 5 ); + vbox.PackEnd( hbox, false, true, 5 ); + + Debug.WriteLine( "Display Window" ); + window.Add( vbox ); + window.ShowAll(); + Debug.WriteLine( "MainLoop" ); + Application.Run (); + + Debug.WriteLine( "Exiting GtkAdvaned()" ); + Debug.Unindent(); + + } + + protected void OnDeleteEvent (object obj, DeleteEventArgs args) { + Debug.Indent(); + Debug.WriteLine( "Entering GtkAdvanced.OnDeleteEvent( object, DeleteEventArgs )" ); + + Application.Quit (); + + Debug.WriteLine( "Exiting GtkAdvanced.OnDeleteEvent( object, DeleteEventArgs )" ); + Debug.Unindent(); + } public static void Main( string[] args) { |
From: Tim R. <ti...@us...> - 2004-07-31 11:46:14
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8807 Modified Files: Makefile.gtk gtkFrame.cs Added Files: gtkAdvanced.cs Log Message: highend framework for OpenGL examples :) --- NEW FILE: gtkAdvanced.cs --- using csDragons.OpenGL; using GLib; using Gtk; using GtkSharp; using System; using System.Diagnostics; public class GtkAdvanced : csdGL { public static void Main( string[] args) { Debug.Listeners.Add( new TextWriterTraceListener( Console.Out ) ); Debug.AutoFlush = true; GtkAdvanced gl = new GtkAdvanced(); } } Index: Makefile.gtk =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/Makefile.gtk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.gtk 30 Jul 2004 06:46:14 -0000 1.2 --- Makefile.gtk 31 Jul 2004 11:45:59 -0000 1.3 *************** *** 9,13 **** LIBOPTS=$(foreach lib,$(LIBS),-r $(lib)) ! all: $(LIBS) gtkTriangle.exe gtkGears.exe gtkTexture.exe gtkFrame.exe csdGL_Gtk.dll: libcsdGL.so --- 9,13 ---- LIBOPTS=$(foreach lib,$(LIBS),-r $(lib)) ! all: $(LIBS) gtkTriangle.exe gtkGears.exe gtkTexture.exe gtkFrame.exe gtkAdvanced.exe csdGL_Gtk.dll: libcsdGL.so Index: gtkFrame.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gtkFrame.cs 31 Jul 2004 11:19:16 -0000 1.6 --- gtkFrame.cs 31 Jul 2004 11:45:59 -0000 1.7 *************** *** 17,20 **** --- 17,21 ---- protected VScale scaleRotX; protected HScale scaleRotY; + protected VScale scaleRotZ; protected int oldHeight = 0; protected int oldWidth = 0; *************** *** 54,61 **** scaleRotY.ValueChanged += new EventHandler( valueChanged ); Debug.WriteLine( "Init HBox 1" ); ! HBox hbox1 = new HBox( false, 2 ); hbox1.PackStart( scaleRotX, false, true, 5 ); ! hbox1.PackEnd( glarea, true, true, 5 ); Debug.WriteLine( "Init VBox 1" ); --- 55,68 ---- scaleRotY.ValueChanged += new EventHandler( valueChanged ); + Debug.WriteLine( "Init scaleRotZ" ); + scaleRotZ = new VScale( 0.0, 359.5, 0.1 ); + scaleRotZ.ValuePos = PositionType.Bottom; + scaleRotZ.ValueChanged += new EventHandler( valueChanged ); + Debug.WriteLine( "Init HBox 1" ); ! HBox hbox1 = new HBox( false, 3 ); hbox1.PackStart( scaleRotX, false, true, 5 ); ! hbox1.PackStart( glarea, true, true, 5 ); ! hbox1.PackEnd( scaleRotZ, false, true, 5 ); Debug.WriteLine( "Init VBox 1" ); *************** *** 77,80 **** --- 84,88 ---- if (obj==scaleRotX) rotX = (float)scaleRotX.Value; if (obj==scaleRotY) rotY = (float)scaleRotY.Value; + if (obj==scaleRotZ) rotZ = (float)scaleRotZ.Value; } |
From: Tim R. <ti...@us...> - 2004-07-31 11:19:25
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5648 Modified Files: gtkFrame.cs Log Message: the sample now uses box layouts Index: gtkFrame.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtkFrame.cs 30 Jul 2004 11:58:36 -0000 1.5 --- gtkFrame.cs 31 Jul 2004 11:19:16 -0000 1.6 *************** *** 14,18 **** protected float propRotY = 0.0f; protected float propRotZ = 0.0f; - protected Fixed fixedLayout; protected Gtk.Window window; protected VScale scaleRotX; --- 14,17 ---- *************** *** 34,41 **** window.Resize( 640, 480 ); - fixedLayout = new Fixed(); - fixedLayout.SizeAllocated += new SizeAllocatedHandler( OnResize ); - fixedLayout.Show(); - window.Add( fixedLayout ); window.ShowAll(); --- 33,36 ---- *************** *** 48,52 **** glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); - fixedLayout.Put( glarea, 55, 10 ); Debug.WriteLine( "Init scaleRotX" ); --- 43,46 ---- *************** *** 54,58 **** scaleRotX.ValuePos = PositionType.Bottom; scaleRotX.ValueChanged += new EventHandler( valueChanged ); - fixedLayout.Put( scaleRotX, 10, 10 ); Debug.WriteLine( "Init scaleRotY" ); --- 48,51 ---- *************** *** 60,68 **** scaleRotY.ValuePos = PositionType.Left; scaleRotY.ValueChanged += new EventHandler( valueChanged ); ! fixedLayout.Put( scaleRotY, 10, 100 ); ! oldWidth = 1; ! fixedLayout.ShowAll(); ! Debug.WriteLine( "MainLoop" ); Application.Run (); --- 53,70 ---- scaleRotY.ValuePos = PositionType.Left; scaleRotY.ValueChanged += new EventHandler( valueChanged ); ! ! Debug.WriteLine( "Init HBox 1" ); ! HBox hbox1 = new HBox( false, 2 ); ! hbox1.PackStart( scaleRotX, false, true, 5 ); ! hbox1.PackEnd( glarea, true, true, 5 ); ! Debug.WriteLine( "Init VBox 1" ); ! VBox vbox1 = new VBox( false, 2 ); ! vbox1.PackStart( hbox1, true, true, 5 ); ! vbox1.PackEnd( scaleRotY, false, true, 5 ); ! ! window.Add( vbox1 ); ! window.ShowAll(); ! Debug.WriteLine( "MainLoop" ); Application.Run (); *************** *** 76,108 **** if (obj==scaleRotY) rotY = (float)scaleRotY.Value; } ! ! protected void OnResize( object obj, SizeAllocatedArgs args ) { ! if ( (oldWidth!=args.Allocation.Width) || (oldHeight!=args.Allocation.Height) ) { ! oldWidth = args.Allocation.Width; ! oldHeight = args.Allocation.Height; ! OnResize( oldWidth, oldHeight ); ! } ! } ! ! protected void OnResize( int width, int height ) { ! resize( glarea, height - 65, width - 65 ); ! resize( scaleRotX, height - 45, 35 ); ! resize( scaleRotY, 35, width - 20 ); ! move( scaleRotY, 10, height - 45 ); ! } ! ! protected void resize( Widget wdg, int h, int w ) { ! if (wdg!=null) { ! if ( (h>0) && (wdg.HeightRequest!=h) ) wdg.HeightRequest = h; ! if ( (w>0) && (wdg.WidthRequest!=w) ) wdg.WidthRequest = w; ! } ! } ! ! protected void move( Widget wdg, int x, int y ) { ! if ( (fixedLayout!=null) && (wdg!=null) ) { ! fixedLayout.Move( scaleRotY, x, y ); ! } ! } ! protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Application.Quit (); --- 78,82 ---- if (obj==scaleRotY) rotY = (float)scaleRotY.Value; } ! protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Application.Quit (); |
From: Tim R. <ti...@us...> - 2004-07-30 11:58:47
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24270 Modified Files: gtkFrame.cs Log Message: there was a feedback which causes the kernel kill Index: gtkFrame.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtkFrame.cs 30 Jul 2004 11:17:02 -0000 1.4 --- gtkFrame.cs 30 Jul 2004 11:58:36 -0000 1.5 *************** *** 48,52 **** glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! //fixedLayout.Put( glarea, 55, 55 ); Debug.WriteLine( "Init scaleRotX" ); --- 48,52 ---- glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! fixedLayout.Put( glarea, 55, 10 ); Debug.WriteLine( "Init scaleRotX" ); *************** *** 141,152 **** protected virtual void draw() { ! glBegin( GL_TRIANGLES ); ! glColor3f( 1.0f, 0.0f, 0.0f ); ! glVertex2f( 0.0f, 0.0f); ! glColor3f( 0.0f, 1.0f, 0.0f ); ! glVertex2f( 0.5f, 1.0f); ! glColor3f( 0.0f, 0.0f, 1.0f ); ! glVertex2f( 1.0f, 0.0f); ! glEnd(); } --- 141,154 ---- protected virtual void draw() { ! if (glarea.MakeCurrent()) { ! glBegin( GL_TRIANGLES ); ! glColor3f( 1.0f, 0.0f, 0.0f ); ! glVertex2f( 0.0f, 0.0f); ! glColor3f( 0.0f, 1.0f, 0.0f ); ! glVertex2f( 0.5f, 1.0f); ! glColor3f( 0.0f, 0.0f, 1.0f ); ! glVertex2f( 1.0f, 0.0f); ! glEnd(); ! } } *************** *** 195,202 **** protected float rotX { ! get { return rotX; } set { propRotX = value; while (propRotX<0) propRotX += 360.0f; while (propRotX>=360.0f) propRotX -= 360.0f; if (glarea!=null) glarea.QueueDraw(); } --- 197,205 ---- protected float rotX { ! get { return propRotX; } set { propRotX = value; while (propRotX<0) propRotX += 360.0f; while (propRotX>=360.0f) propRotX -= 360.0f; + scaleRotX.Value = value; if (glarea!=null) glarea.QueueDraw(); } *************** *** 204,211 **** protected float rotY { ! get { return rotY; } set { propRotY = value; while (propRotY<0) propRotY += 360.0f; while (propRotY>=360.0f) propRotY -= 360.0f; if (glarea!=null) glarea.QueueDraw(); } --- 207,215 ---- protected float rotY { ! get { return propRotY; } set { propRotY = value; while (propRotY<0) propRotY += 360.0f; while (propRotY>=360.0f) propRotY -= 360.0f; + scaleRotY.Value = value; if (glarea!=null) glarea.QueueDraw(); } *************** *** 213,217 **** protected float rotZ { ! get { return rotZ; } set { propRotZ = value; while (propRotZ<0) propRotZ += 360.0f; --- 217,221 ---- protected float rotZ { ! get { return propRotZ; } set { propRotZ = value; while (propRotZ<0) propRotZ += 360.0f; |
From: Tim R. <ti...@us...> - 2004-07-30 11:17:17
|
Update of /cvsroot/csdopenglnet/csdOpenGL/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18733 Modified Files: gtkFrame.cs Log Message: isnserted scales for x and y rotation but kernell still kills programm when adding OpenGL Index: gtkFrame.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/samples/gtkFrame.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkFrame.cs 30 Jul 2004 10:31:05 -0000 1.3 --- gtkFrame.cs 30 Jul 2004 11:17:02 -0000 1.4 *************** *** 17,20 **** --- 17,23 ---- protected Gtk.Window window; protected VScale scaleRotX; + protected HScale scaleRotY; + protected int oldHeight = 0; + protected int oldWidth = 0; public GtkFrame() { *************** *** 45,53 **** glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! //fixedLayout.Put( glarea, 100, 50 ); ! fixedLayout.Put( new Button ("HALLO"), 100, 100 ); ! fixedLayout.ShowAll(); Debug.WriteLine( "MainLoop" ); Application.Run (); --- 48,68 ---- glarea.UnmapEvent += new UnmapEventHandler (OnUnmap); ! //fixedLayout.Put( glarea, 55, 55 ); ! Debug.WriteLine( "Init scaleRotX" ); ! scaleRotX = new VScale( 0.0, 359.9, 0.1 ); ! scaleRotX.ValuePos = PositionType.Bottom; ! scaleRotX.ValueChanged += new EventHandler( valueChanged ); ! fixedLayout.Put( scaleRotX, 10, 10 ); + Debug.WriteLine( "Init scaleRotY" ); + scaleRotY = new HScale( 0.0, 359.9, 0.1 ); + scaleRotY.ValuePos = PositionType.Left; + scaleRotY.ValueChanged += new EventHandler( valueChanged ); + fixedLayout.Put( scaleRotY, 10, 100 ); + + oldWidth = 1; + fixedLayout.ShowAll(); + Debug.WriteLine( "MainLoop" ); Application.Run (); *************** *** 57,62 **** } protected void OnResize( object obj, SizeAllocatedArgs args ) { ! resize( glarea, args.Allocation.Height - 150, args.Allocation.Width - 150 ); } --- 72,93 ---- } + protected void valueChanged( object obj, EventArgs e ) { + if (obj==scaleRotX) rotX = (float)scaleRotX.Value; + if (obj==scaleRotY) rotY = (float)scaleRotY.Value; + } + protected void OnResize( object obj, SizeAllocatedArgs args ) { ! if ( (oldWidth!=args.Allocation.Width) || (oldHeight!=args.Allocation.Height) ) { ! oldWidth = args.Allocation.Width; ! oldHeight = args.Allocation.Height; ! OnResize( oldWidth, oldHeight ); ! } ! } ! ! protected void OnResize( int width, int height ) { ! resize( glarea, height - 65, width - 65 ); ! resize( scaleRotX, height - 45, 35 ); ! resize( scaleRotY, 35, width - 20 ); ! move( scaleRotY, 10, height - 45 ); } *************** *** 68,71 **** --- 99,108 ---- } + protected void move( Widget wdg, int x, int y ) { + if ( (fixedLayout!=null) && (wdg!=null) ) { + fixedLayout.Move( scaleRotY, x, y ); + } + } + protected void OnDeleteEvent (object obj, DeleteEventArgs args) { Application.Quit (); |